Name
TextInputCallback
Synopsis
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); }
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.