Package com.unboundid.util.args
Class LDAPURLArgumentValueValidator
java.lang.Object
com.unboundid.util.args.ArgumentValueValidator
com.unboundid.util.args.LDAPURLArgumentValueValidator
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class LDAPURLArgumentValueValidator
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 LDAP URLs. It can optionally indicate which elements
are required to be present in the URL.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of this LDAP URL argument value validator that will accept values that represent any valid LDAP URL.LDAPURLArgumentValueValidator(boolean requireHost, boolean requirePort, boolean requireBaseDN, boolean requireAttributes, boolean requireScope, boolean requireFilter) Creates a new instance of this LDAP URL argument value validator that will accept values that represent valid LDAP URLs with the specified constraints. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether LDAP URL values are required to include the attributes element with at least one attribute description.booleanIndicates whether LDAP URL values are required to include a non-empty base DN element.booleanIndicates whether LDAP URL values are required to include the filter element.booleanIndicates whether LDAP URL values are required to include the host element.booleanIndicates whether LDAP URL values are required to include the port element.booleanIndicates whether LDAP URL values are required to include the scope element.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
-
LDAPURLArgumentValueValidator
public LDAPURLArgumentValueValidator()Creates a new instance of this LDAP URL argument value validator that will accept values that represent any valid LDAP URL. -
LDAPURLArgumentValueValidator
public LDAPURLArgumentValueValidator(boolean requireHost, boolean requirePort, boolean requireBaseDN, boolean requireAttributes, boolean requireScope, boolean requireFilter) Creates a new instance of this LDAP URL argument value validator that will accept values that represent valid LDAP URLs with the specified constraints.- Parameters:
requireHost- Indicates whether LDAP URL values are required to include the host element.requirePort- Indicates whether LDAP URL values are required to include the port element.requireBaseDN- Indicates whether LDAP URL values are required to include a non-empty base DN element.requireAttributes- Indicates whether LDAP URL values are required to include an attribute list with at least one attribute description.requireScope- Indicates whether LDAP URL values are required to include the scope element.requireFilter- Indicates whether LDAP URL values are required to include the filter element.
-
-
Method Details
-
requireHost
Indicates whether LDAP URL values are required to include the host element.- Returns:
trueif LDAP URL values are required to include the host element, orfalseif not.
-
requirePort
Indicates whether LDAP URL values are required to include the port element.- Returns:
trueif LDAP URL values are required to include the port element, orfalseif not.
-
requireBaseDN
Indicates whether LDAP URL values are required to include a non-empty base DN element.- Returns:
trueif LDAP URL values are required to include a non-empty base DN element, orfalseif not.
-
requireAttributes
Indicates whether LDAP URL values are required to include the attributes element with at least one attribute description.- Returns:
trueif LDAP URL values are required to include the attributes element, orfalseif not.
-
requireScope
Indicates whether LDAP URL values are required to include the scope element.- Returns:
trueif LDAP URL values are required to include the scope element, orfalseif not.
-
requireFilter
Indicates whether LDAP URL values are required to include the filter element.- Returns:
trueif LDAP URL values are required to include the filter element, orfalseif not.
-
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.
-