TextInputCallback (Java Platform SE 8 ) (original) (raw)
- javax.security.auth.callback.TextInputCallback
All Implemented Interfaces:
Serializable, Callback
Direct Known Subclasses:
RealmCallback
public class TextInputCallback
extends Object
implements Callback, Serializable
Underlying security services instantiate and pass aTextInputCallback
to the handle
method of a CallbackHandler
to retrieve generic text information.
See Also:
CallbackHandler, Serialized Form
Constructor Summary
Constructors
Constructor Description TextInputCallback(String prompt) Construct a TextInputCallback with a prompt. TextInputCallback(String prompt,String defaultText) Construct a TextInputCallback with a prompt and default input value. Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method Description String getDefaultText() Get the default text. String getPrompt() Get the prompt. String getText() Get the retrieved text. void setText(String text) Set the retrieved text. * ### Methods inherited from class java.lang.[Object](../../../../java/lang/Object.html "class in java.lang") `[clone](../../../../java/lang/Object.html#clone--), [equals](../../../../java/lang/Object.html#equals-java.lang.Object-), [finalize](../../../../java/lang/Object.html#finalize--), [getClass](../../../../java/lang/Object.html#getClass--), [hashCode](../../../../java/lang/Object.html#hashCode--), [notify](../../../../java/lang/Object.html#notify--), [notifyAll](../../../../java/lang/Object.html#notifyAll--), [toString](../../../../java/lang/Object.html#toString--), [wait](../../../../java/lang/Object.html#wait--), [wait](../../../../java/lang/Object.html#wait-long-), [wait](../../../../java/lang/Object.html#wait-long-int-)`
Constructor Detail
* #### TextInputCallback public TextInputCallback([String](../../../../java/lang/String.html "class in java.lang") prompt) Construct a `TextInputCallback` with a prompt. Parameters: `prompt` \- the prompt used to request the information. Throws: `[IllegalArgumentException](../../../../java/lang/IllegalArgumentException.html "class in java.lang")` \- if `prompt` is null or if `prompt` has a length of 0. * #### TextInputCallback public TextInputCallback([String](../../../../java/lang/String.html "class in java.lang") prompt, [String](../../../../java/lang/String.html "class in java.lang") 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](../../../../java/lang/IllegalArgumentException.html "class in java.lang")` \- 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 public [String](../../../../java/lang/String.html "class in java.lang") getPrompt() Returns: the prompt. * #### getDefaultText public [String](../../../../java/lang/String.html "class in java.lang") getDefaultText() Returns: the default text, or null if this `TextInputCallback` was not instantiated with `defaultText`. * #### setText public void setText([String](../../../../java/lang/String.html "class in java.lang") text) Parameters: `text` \- the retrieved text, which may be null. See Also: [getText()](../../../../javax/security/auth/callback/TextInputCallback.html#getText--) * #### getText public [String](../../../../java/lang/String.html "class in java.lang") getText() Returns: the retrieved text, which may be null. See Also: [setText(java.lang.String)](../../../../javax/security/auth/callback/TextInputCallback.html#setText-java.lang.String-)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.