Underlying security services instantiate and pass a
ChoiceCallback
to the handle
method of a CallbackHandler
to display a list of choices
and to retrieve the selected choice(s).
javax.security.auth.callback.CallbackHandler
Modifier and Type | Field and Description |
---|---|
private String[] | |
private final int | |
private final boolean | |
private final String | |
private int[] | |
private static final long |
Access | Constructor and Description |
---|---|
public | ChoiceCallback(String
the prompt used to describe the list of choices. prompt, String[] the list of choices. The array is cloned to protect
against subsequent modification. choices, int the choice to be used as the default choice
when the list of choices are displayed. This value
is represented as an index into the
defaultChoice, boolean choices array.boolean specifying whether multiple
selections can be made from the list of choices. multipleSelectionsAllowed)Construct a |
Modifier and Type | Method and Description |
---|---|
public boolean | Returns: whether multiple selections are allowed.Get the boolean determining whether multiple selections from
the |
public String[] | |
public int | Returns: the defaultChoice, represented as an index into thechoices list.Get the defaultChoice. |
public String | |
public int[] | Returns: a copy of the selected choices, represented as indexes into thechoices list.Get the selected choices. |
private void | readObject(ObjectInputStream
the stream)ObjectInputStream from which data is readRestores the state of this object from the stream. |
public void | setSelectedIndex(int
the selection represented as an index into the
selection)choices list.Set the selected choice. |
public void | setSelectedIndexes(int[]
the selections represented as indexes into the
selections)choices list. The array is cloned to protect
against subsequent modification.Set the selected choices. |
choices | back to summary |
---|---|
private String[] choices
|
defaultChoice | back to summary |
---|---|
private final int defaultChoice
|
multipleSelectionsAllowed | back to summary |
---|---|
private final boolean multipleSelectionsAllowed
|
prompt | back to summary |
---|---|
private final String prompt
|
selections | back to summary |
---|---|
private int[] selections
|
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID
|
ChoiceCallback | back to summary |
---|---|
public ChoiceCallback(String prompt, String[] choices, int defaultChoice, boolean multipleSelectionsAllowed) Construct a
|
allowMultipleSelections | back to summary |
---|---|
public boolean allowMultipleSelections() Get the boolean determining whether multiple selections from
the
|
getChoices | back to summary |
---|---|
public String[] getChoices() Get the list of choices.
|
getDefaultChoice | back to summary |
---|---|
public int getDefaultChoice() Get the defaultChoice.
|
getPrompt | back to summary |
---|---|
public String getPrompt() Get the prompt.
|
getSelectedIndexes | back to summary |
---|---|
public int[] getSelectedIndexes() Get the selected choices.
|
readObject | back to summary |
---|---|
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException Restores the state of this object from the stream.
|
setSelectedIndex | back to summary |
---|---|
public void setSelectedIndex(int selection) Set the selected choice.
|
setSelectedIndexes | back to summary |
---|---|
public void setSelectedIndexes(int[] selections) Set the selected choices.
|