Java in a Nutshell, 5th Edition [Electronic resources]

نسخه متنی -صفحه : 1191/ 1002
نمايش فراداده

TextInputCallbackjavax.security.auth.callback

Java 1.4serializable

A Callback of this type is a request to prompt the user for text input; it is essentially a generic version of NameCallback. A CallbackHandler should call getPrompt( ) and should display the returned prompt text to the user. It should then allow the user to enter text, and provide the option of selecting the default text returned by getdefaultText( ). When the user has entered text (or selected the default text) it should pass the user's input to setText( ).

Figure 19-11. javax.security.auth.callback.TextInputCallback

public class

TextInputCallback implements Callback, Serializable { // Public Constructors public

TextInputCallback (String

prompt ); public

TextInputCallback (String

prompt , String

defaultText ); // Public Instance Methods public String

getDefaultText ( ); public String

getPrompt ( ); public String

getText ( ); public void

setText (String

text ); }