javax.security.auth.callback
Class TextInputCallback

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.security.auth.callback.TextInputCallback
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Callback sample code for javax.security.auth.callback.Callback definition code for javax.security.auth.callback.Callback
Direct Known Subclasses:
RealmCallback sample code for javax.security.sasl.RealmCallback definition code for javax.security.sasl.RealmCallback

public class TextInputCallback
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Callback sample code for javax.security.auth.callback.Callback definition code for javax.security.auth.callback.Callback , Serializable sample code for java.io.Serializable definition code for java.io.Serializable

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

See Also:
CallbackHandler sample code for javax.security.auth.callback.CallbackHandler definition code for javax.security.auth.callback.CallbackHandler , Serialized Form

Constructor Summary
TextInputCallback sample code for javax.security.auth.callback.TextInputCallback.TextInputCallback(java.lang.String) definition code for javax.security.auth.callback.TextInputCallback.TextInputCallback(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  prompt)
          Construct a TextInputCallback with a prompt.
TextInputCallback sample code for javax.security.auth.callback.TextInputCallback.TextInputCallback(java.lang.String, java.lang.String) definition code for javax.security.auth.callback.TextInputCallback.TextInputCallback(java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  prompt, String sample code for java.lang.String definition code for java.lang.String  defaultText)
          Construct a TextInputCallback with a prompt and default input value.
 
Method Summary
 String sample code for java.lang.String definition code for java.lang.String getDefaultText sample code for javax.security.auth.callback.TextInputCallback.getDefaultText() definition code for javax.security.auth.callback.TextInputCallback.getDefaultText() ()
          Get the default text.
 String sample code for java.lang.String definition code for java.lang.String getPrompt sample code for javax.security.auth.callback.TextInputCallback.getPrompt() definition code for javax.security.auth.callback.TextInputCallback.getPrompt() ()
          Get the prompt.
 String sample code for java.lang.String definition code for java.lang.String getText sample code for javax.security.auth.callback.TextInputCallback.getText() definition code for javax.security.auth.callback.TextInputCallback.getText() ()
          Get the retrieved text.
 void setText sample code for javax.security.auth.callback.TextInputCallback.setText(java.lang.String) definition code for javax.security.auth.callback.TextInputCallback.setText(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  text)
          Set the retrieved text.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

TextInputCallback sample code for javax.security.auth.callback.TextInputCallback(java.lang.String) definition code for javax.security.auth.callback.TextInputCallback(java.lang.String)

public TextInputCallback(String sample code for java.lang.String definition code for java.lang.String  prompt)
Construct a TextInputCallback with a prompt.

Parameters:
prompt - the prompt used to request the information.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if prompt is null or if prompt has a length of 0.

TextInputCallback sample code for javax.security.auth.callback.TextInputCallback(java.lang.String, java.lang.String) definition code for javax.security.auth.callback.TextInputCallback(java.lang.String, java.lang.String)

public TextInputCallback(String sample code for java.lang.String definition code for java.lang.String  prompt,
                         String sample code for java.lang.String definition code for java.lang.String  defaultText)
Construct a TextInputCallback with a prompt and default input value.

Parameters:
prompt - the prompt used to request the information.

defaultText - the text to be used as the default text displayed with the prompt.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.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

getPrompt sample code for javax.security.auth.callback.TextInputCallback.getPrompt() definition code for javax.security.auth.callback.TextInputCallback.getPrompt()

public String sample code for java.lang.String definition code for java.lang.String  getPrompt()
Get the prompt.

Returns:
the prompt.

getDefaultText sample code for javax.security.auth.callback.TextInputCallback.getDefaultText() definition code for javax.security.auth.callback.TextInputCallback.getDefaultText()

public String sample code for java.lang.String definition code for java.lang.String  getDefaultText()
Get the default text.

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

setText sample code for javax.security.auth.callback.TextInputCallback.setText(java.lang.String) definition code for javax.security.auth.callback.TextInputCallback.setText(java.lang.String)

public void setText(String sample code for java.lang.String definition code for java.lang.String  text)
Set the retrieved text.

Parameters:
text - the retrieved text, which may be null.
See Also:
getText() sample code for javax.security.auth.callback.TextInputCallback.getText() definition code for javax.security.auth.callback.TextInputCallback.getText()

getText sample code for javax.security.auth.callback.TextInputCallback.getText() definition code for javax.security.auth.callback.TextInputCallback.getText()

public String sample code for java.lang.String definition code for java.lang.String  getText()
Get the retrieved text.

Returns:
the retrieved text, which may be null.
See Also:
setText(java.lang.String) sample code for javax.security.auth.callback.TextInputCallback.setText(java.lang.String) definition code for javax.security.auth.callback.TextInputCallback.setText(java.lang.String)