Package com.unboundid.util.args
Class AttributeNameArgumentValueValidator
java.lang.Object
com.unboundid.util.args.ArgumentValueValidator
com.unboundid.util.args.AttributeNameArgumentValueValidator
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class AttributeNameArgumentValueValidator
extends ArgumentValueValidator
implements Serializable
This class provides an implementation of an argument value validator that is
expected to be used with a string argument and ensures that all values for
the argument are valid attribute type names (or numeric OIDs) or attribute
descriptions (a name or OID with attribute options). It can optionally use a
provided schema to verify that the specified attribute type is defined.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of this attribute name argument value validator that will not permit attribute options and will not attempt to verify that the specified attribute type is defined in a schema.AttributeNameArgumentValueValidator(boolean allowOptions, Schema schema) Creates a new instance of this attribute name argument value validator with the provided information. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether to allow values that include one or more attribute options.Retrieves the schema that will be used to verify that attribute types specified in argument values are defined, if any.toString()Retrieves a string representation of this argument value validator.voidtoString(StringBuilder buffer) Appends a string representation of this argument value validator to the provided buffer.voidvalidateArgumentValue(Argument argument, String valueString) Examines the value(s) assigned to the provided argument to determine whether they are acceptable.
-
Constructor Details
-
AttributeNameArgumentValueValidator
public AttributeNameArgumentValueValidator()Creates a new instance of this attribute name argument value validator that will not permit attribute options and will not attempt to verify that the specified attribute type is defined in a schema. -
AttributeNameArgumentValueValidator
Creates a new instance of this attribute name argument value validator with the provided information.- Parameters:
allowOptions- Indicates whether to allow values that include one or more attribute options.schema- An optional schema that can be used to verify that the specified attribute type is defined.
-
-
Method Details
-
allowOptions
Indicates whether to allow values that include one or more attribute options.- Returns:
trueif values will be allowed to include attribute options, orfalseif not.
-
getSchema
Retrieves the schema that will be used to verify that attribute types specified in argument values are defined, if any.- Returns:
- The schema that will be used to verify that attribute types
specified in argument values are defined, or
nullif no such validation will be performed.
-
validateArgumentValue
public void validateArgumentValue(@NotNull Argument argument, @NotNull String valueString) throws ArgumentException Examines the value(s) assigned to the provided argument to determine whether they are acceptable.- Specified by:
validateArgumentValuein classArgumentValueValidator- Parameters:
argument- The argument to which the value is being provided.valueString- The string representation of the value to be validated. This value will have already passed any normal validation performed by the argument.- Throws:
ArgumentException- If the provided value is determined to be unacceptable.
-
toString
Retrieves a string representation of this argument value validator. -
toString
Appends a string representation of this argument value validator to the provided buffer.- Parameters:
buffer- The buffer to which the string representation should be appended.
-