2362N/A * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * <p> Underlying security services instantiate and pass a 0N/A * <code>ChoiceCallback</code> to the <code>handle</code> 0N/A * method of a <code>CallbackHandler</code> to display a list of choices 0N/A * and to retrieve the selected choice(s). 0N/A * @see javax.security.auth.callback.CallbackHandler 0N/A * @serial the list of choices 0N/A * @serial the choice to be used as the default choice 0N/A * @serial whether multiple selections are allowed from the list of 0N/A * @serial the selected choices, represented as indexes into the 0N/A * <code>choices</code> list. 0N/A * Construct a <code>ChoiceCallback</code> with a prompt, 0N/A * a list of choices, a default choice, and a boolean specifying 0N/A * whether or not multiple selections from the list of choices are allowed. 0N/A * @param prompt the prompt used to describe the list of choices. <p> 0N/A * @param choices the list of choices. <p> 0N/A * @param defaultChoice the choice to be used as the default choice 0N/A * when the list of choices are displayed. This value 0N/A * is represented as an index into the 0N/A * <code>choices</code> array. <p> 0N/A * @param multipleSelectionsAllowed boolean specifying whether or 0N/A * not multiple selections can be made from the 0N/A * @exception IllegalArgumentException if <code>prompt</code> is null, 0N/A * if <code>prompt</code> has a length of 0, 0N/A * if <code>choices</code> is null, 0N/A * if <code>choices</code> has a length of 0, 0N/A * if any element from <code>choices</code> is null, 0N/A * if any element from <code>choices</code> 0N/A * has a length of 0 or if <code>defaultChoice</code> 0N/A * does not fall within the array boundaries of 0N/A * <code>choices</code>. 0N/A * @return the prompt. 0N/A * Get the list of choices. 0N/A * @return the list of choices. 0N/A * Get the defaultChoice. 0N/A * @return the defaultChoice, represented as an index into 0N/A * the <code>choices</code> list. 0N/A * Get the boolean determining whether multiple selections from 0N/A * the <code>choices</code> list are allowed. 0N/A * @return whether multiple selections are allowed. 0N/A * Set the selected choice. 0N/A * @param selection the selection represented as an index into the 0N/A * <code>choices</code> list. 0N/A * @see #getSelectedIndexes 0N/A * Set the selected choices. 0N/A * @param selections the selections represented as indexes into the 0N/A * <code>choices</code> list. 0N/A * @exception UnsupportedOperationException if multiple selections are 0N/A * not allowed, as determined by 0N/A * <code>allowMultipleSelections</code>. 0N/A * @see #getSelectedIndexes 0N/A * Get the selected choices. 0N/A * @return the selected choices, represented as indexes into the 0N/A * <code>choices</code> list. 0N/A * @see #setSelectedIndexes