Class StringEnumValidator

  • All Implemented Interfaces:
    PropertyValidator

    public class StringEnumValidator
    extends java.lang.Object
    implements PropertyValidator
    Validates a string property value against a collection of valid values; if the value cannot be cast to a string or the value doesn't appear in the collection of valid values, then an error will be reported.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String[] validValues
      An array of valid values for the string enumeration.
    • Constructor Summary

      Constructors 
      Constructor Description
      StringEnumValidator​(java.lang.String[] validValues)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object validate​(java.lang.Object value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • validValues

        private java.lang.String[] validValues
        An array of valid values for the string enumeration.
    • Constructor Detail

      • StringEnumValidator

        public StringEnumValidator​(java.lang.String[] validValues)
    • Method Detail

      • validate

        public java.lang.Object validate​(java.lang.Object value)
        Specified by:
        validate in interface PropertyValidator