APIdia Launch Partner
Top Description Fields Constructors Methods
javax.security.auth.callback

public Class NameCallback

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 NameCallback to the handle method of a CallbackHandler to retrieve name 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
NameCallback(String
the prompt used to request the name.
prompt
)

Construct a NameCallback with a prompt.

public
NameCallback(String
the prompt used to request the information.
prompt
,
String
the name to be used as the default name displayed with the prompt.
defaultName
)

Construct a NameCallback with a prompt and default name.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the default name, or null if this NameCallback was not instantiated with a defaultName.
getDefaultName
()

Get the default name.

public String

Returns:

the retrieved name (which may be null)
getName
()

Get the retrieved name.

public String

Returns:

the prompt.
getPrompt
()

Get the prompt.

public void
setName(String
the retrieved name (which may be null).
name
)

Set the retrieved name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultNameback to summary
private final String defaultName
Since
1.4
inputNameback to summary
private String inputName
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

NameCallbackback to summary
public NameCallback(String prompt)

Construct a NameCallback with a prompt.

Parameters
prompt:String

the prompt used to request the name.

Exceptions
IllegalArgumentException:
if prompt is null or if prompt has a length of 0.
NameCallbackback to summary
public NameCallback(String prompt, String defaultName)

Construct a NameCallback with a prompt and default name.

Parameters
prompt:String

the prompt used to request the information.

defaultName:String

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

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

Method Detail

getDefaultNameback to summary
public String getDefaultName()

Get the default name.

Returns:String

the default name, or null if this NameCallback was not instantiated with a defaultName.

getNameback to summary
public String getName()

Get the retrieved name.

Returns:String

the retrieved name (which may be null)

See Also
setName
getPromptback to summary
public String getPrompt()

Get the prompt.

Returns:String

the prompt.

setNameback to summary
public void setName(String name)

Set the retrieved name.

Parameters
name:String

the retrieved name (which may be null).

See Also
getName