Class OIDArgumentValueValidator

java.lang.Object
com.unboundid.util.args.ArgumentValueValidator
com.unboundid.util.args.OIDArgumentValueValidator
All Implemented Interfaces:
Serializable

This class provides an implementation of an argument value validator that ensures that values can be parsed as valid object identifiers.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new OID address argument value validator that will only accept strictly valid numeric OIDs.
    OIDArgumentValueValidator(boolean isStrict)
    Creates a new OID address argument value validator that will only accept valid numeric OIDs.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether this validator is configured to operate in strict mode.
    Retrieves a string representation of this argument value validator.
    void
    Appends a string representation of this argument value validator to the provided buffer.
    void
    validateArgumentValue(Argument argument, String valueString)
    Examines the value(s) assigned to the provided argument to determine whether they are acceptable.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OIDArgumentValueValidator

      Creates a new OID address argument value validator that will only accept strictly valid numeric OIDs.
    • OIDArgumentValueValidator

      public OIDArgumentValueValidator(boolean isStrict)
      Creates a new OID address argument value validator that will only accept valid numeric OIDs.
      Parameters:
      isStrict - Indicates whether to perform strict validation. If this is false, then the validator will only sure that each value is a dotted list of digits that does not start or end with a period and does not contain two consecutive periods. If this is true, then it will also ensure that it contains at least two components, that the value of the first component is not greater than two, and that the value of the second component is not greater than 39 if the value of the first component is zero or one.
  • Method Details

    • isStrict

      public boolean isStrict()
      Indicates whether this validator is configured to operate in strict mode. If it not operating in strict mode, then it will only ensure that each value is is a dotted list of digits that does not start or end with a period and does not contain two consecutive periods. If it is strict, then it will also ensure that it contains at least two components, that the value of the first component is not greater than two, and that the value of the second component is not greater than 39 if the value of the first component is zero or one.
      Returns:
      true if this validator is configured to operate in strict mode, or false if 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:
      validateArgumentValue in class ArgumentValueValidator
      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.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this argument value validator.
    • toString

      public void toString(@NotNull StringBuilder buffer)
      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.