FileDocCategorySizeDatePackage
TextInputCallback.javaAPI DocJava SE 5 API3061Fri Aug 26 14:57:48 BST 2005javax.security.auth.callback

TextInputCallback

public class TextInputCallback extends Object implements Callback, Serializable

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

version
1.14, 12/19/03
see
javax.security.auth.callback.CallbackHandler

Fields Summary
private static final long
serialVersionUID
private String
prompt
private String
defaultText
private String
inputText
Constructors Summary
public TextInputCallback(String prompt)
Construct a TextInputCallback with a prompt.

param
prompt the prompt used to request the information.
exception
IllegalArgumentException if prompt is null or if prompt has a length of 0.


                          			            
       
	if (prompt == null || prompt.length() == 0)
	    throw new IllegalArgumentException();
	this.prompt = prompt;
    
public TextInputCallback(String prompt, String defaultText)
Construct a TextInputCallback with a prompt and default input value.

param
prompt the prompt used to request the information.

param
defaultText the text to be used as the default text displayed with the prompt.
exception
IllegalArgumentException if prompt is null, if prompt has a length of 0, if defaultText is null or if defaultText has a length of 0.

	if (prompt == null || prompt.length() == 0 ||
	    defaultText == null || defaultText.length() == 0)
	    throw new IllegalArgumentException();

	this.prompt = prompt;
	this.defaultText = defaultText;
    
Methods Summary
public java.lang.StringgetDefaultText()
Get the default text.

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

	return defaultText;
    
public java.lang.StringgetPrompt()
Get the prompt.

return
the prompt.

	return prompt;
    
public java.lang.StringgetText()
Get the retrieved text.

return
the retrieved text, which may be null.
see
#setText

	return inputText;
    
public voidsetText(java.lang.String text)
Set the retrieved text.

param
text the retrieved text, which may be null.
see
#getText

	this.inputText = text;