Top Description Fields Constructors Methods
javax.security.auth.callback

public Class TextInputCallback

extends Object
implements Callback, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javax.security.auth.callback.Callback

Underlying security services instantiate and pass a TextInputCallback to the handle method of a CallbackHandler to retrieve generic text information.

Since
1.4
See Also
javax.security.auth.callback.CallbackHandler

Field Summary

Modifier and TypeField and Description
private final String
private String
private final String
private static final long

Constructor Summary

AccessConstructor and Description
public
TextInputCallback(String
the prompt used to request the information.
prompt
)

Construct a TextInputCallback with a prompt.

public
TextInputCallback(String
the prompt used to request the information.
prompt
,
String
the text to be used as the default text displayed with the prompt.
defaultText
)

Construct a TextInputCallback with a prompt and default input value.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the default text, or null if this TextInputCallback was not instantiated with defaultText.
getDefaultText
()

Get the default text.

public String

Returns:

the prompt.
getPrompt
()

Get the prompt.

public String

Returns:

the retrieved text, which may be null.
getText
()

Get the retrieved text.

public void
setText(String
the retrieved text, which may be null.
text
)

Set the retrieved text.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultTextback to summary
private final String defaultText
Since
1.4
inputTextback to summary
private String inputText
Since
1.4
promptback to summary
private final String prompt
Since
1.4
serialVersionUIDback to summary
private static final long serialVersionUID
Annotations
@Serial

Constructor Detail

TextInputCallbackback to summary
public TextInputCallback(String prompt)

Construct a TextInputCallback with a prompt.

Parameters
prompt:String

the prompt used to request the information.

Exceptions
IllegalArgumentException:
if prompt is null or if prompt has a length of 0.
TextInputCallbackback to summary
public TextInputCallback(String prompt, String defaultText)

Construct a TextInputCallback with a prompt and default input value.

Parameters
prompt:String

the prompt used to request the information.

defaultText:String

the text to be used as the default text displayed with the prompt.

Exceptions
IllegalArgumentException:
if prompt is null, if prompt has a length of 0, if defaultText is null or if defaultText has a length of 0.

Method Detail

getDefaultTextback to summary
public String getDefaultText()

Get the default text.

Returns:String

the default text, or null if this TextInputCallback was not instantiated with defaultText.

getPromptback to summary
public String getPrompt()

Get the prompt.

Returns:String

the prompt.

getTextback to summary
public String getText()

Get the retrieved text.

Returns:String

the retrieved text, which may be null.

See Also
setText
setTextback to summary
public void setText(String text)

Set the retrieved text.

Parameters
text:String

the retrieved text, which may be null.

See Also
getText