/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
// Used by BooleanArgument
}
return defaults;
}
mustSpecify));
}
boolean defaultValue, boolean mustSpecify) {
mustSpecify));
}
}
mustSpecify, list));
}
throws IllegalConnectorArgumentsException {
throw new IllegalConnectorArgumentsException(
"Argument missing", name);
}
if (argument.mustSpecify()) {
throw new IllegalConnectorArgumentsException(
"Argument unspecified", name);
}
throw new IllegalConnectorArgumentsException(
"Argument invalid", name);
}
return argument;
}
}
}
boolean first = true;
if (!first) {
string += ", ";
}
first = false;
}
string += ")";
return string;
}
private boolean mustSpecify;
boolean mustSpecify) {
this.description = description;
this.mustSpecify = mustSpecify;
}
return name;
}
return label;
}
return description;
}
return value;
}
throw new NullPointerException("Can't set null value");
}
}
public boolean mustSpecify() {
return mustSpecify;
}
} else {
return false;
}
}
public int hashCode() {
return description().hashCode();
}
try {
return super.clone();
} catch (CloneNotSupportedException e) {
// Object should always support clone
throw new InternalException();
}
}
}
}
implements Connector.BooleanArgument {
boolean value,
boolean mustSpecify) {
if(trueString == null) {
}
}
/**
* Sets the value of the argument.
*/
}
/**
* Performs basic sanity check of argument.
* @return <code>true</code> if value is a string
* representation of a boolean value.
* @see #stringValueOf(boolean)
*/
}
/**
* Return the string representation of the <code>value</code>
* parameter.
* Does not set or examine the value or the argument.
* @return the localized String representation of the
* boolean value.
*/
}
/**
* Return the value of the argument as a boolean. Since
* the argument may not have been set or may have an invalid
* value {@link #isValid(String)} should be called on
* {@link #value()} to check its validity. If it is invalid
* the boolean returned by this method is undefined.
* @return the value of the argument as a boolean.
*/
public boolean booleanValue() {
}
}
implements Connector.IntegerArgument {
private final int min;
private final int max;
}
/**
* Sets the value of the argument.
* The value should be checked with {@link #isValid(int)}
* before setting it; invalid values will throw an exception
* when the connection is established - for example,
* on {@link LaunchingConnector#launch}
*/
}
/**
* Performs basic sanity check of argument.
* @return <code>true</code> if value represents an int that is
* <code>{@link #min()} <= value <= {@link #max()}</code>
*/
return false;
}
try {
} catch(NumberFormatException exc) {
return false;
}
}
/**
* Performs basic sanity check of argument.
* @return <code>true</code> if
* <code>{@link #min()} <= value <= {@link #max()}</code>
*/
}
/**
* Return the string representation of the <code>value</code>
* parameter.
* Does not set or examine the value or the argument.
* @return the String representation of the
* int value.
*/
// *** Should this be internationalized????
// *** Even Brian Beck was unsure if an Arabic programmer
// *** would expect port numbers in Arabic numerals,
// *** so punt for now.
return ""+value;
}
/**
* Return the value of the argument as a int. Since
* the argument may not have been set or may have an invalid
* value {@link #isValid(String)} should be called on
* {@link #value()} to check its validity. If it is invalid
* the int returned by this method is undefined.
* @return the value of the argument as a int.
*/
public int intValue() {
return 0;
}
try {
} catch(NumberFormatException exc) {
return 0;
}
}
/**
* The upper bound for the value.
* @return the maximum allowed value for this argument.
*/
public int max() {
return max;
}
/**
* The lower bound for the value.
* @return the minimum allowed value for this argument.
*/
public int min() {
return min;
}
}
implements Connector.StringArgument {
boolean mustSpecify) {
}
/**
* Performs basic sanity check of argument.
* @return <code>true</code> always
*/
return true;
}
}
implements Connector.SelectedArgument {
}
/**
* Return the possible values for the argument
* @return {@link List} of {@link String}
*/
return choices;
}
/**
* Performs basic sanity check of argument.
* @return <code>true</code> if value is one of {@link #choices()}.
*/
}
}
}