Class CssColourValidator

  • All Implemented Interfaces:
    com.opensymphony.xwork2.validator.FieldValidator, com.opensymphony.xwork2.validator.ShortCircuitableValidator, com.opensymphony.xwork2.validator.Validator

    public class CssColourValidator
    extends com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
    The following are valid values for a CSS colour declaration:

    • Any single word with no spaces.
    • # followed by 3 or 6 digits
    • rgb(n, n, n)
    • rgb(n%, n%, n%)
    • Field Summary

      • Fields inherited from class com.opensymphony.xwork2.validator.validators.FieldValidatorSupport

        currentValue, fieldName, type
      • Fields inherited from class com.opensymphony.xwork2.validator.validators.ValidatorSupport

        defaultMessage, EMPTY_STRING, messageKey, stack, textProviderFactory
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean check​(String thingToCheck)
      Separated for testability
      void validate​(Object object)  
      • Methods inherited from class com.opensymphony.xwork2.validator.validators.FieldValidatorSupport

        getCurrentValue, getFieldName, getValidatorType, setFieldName, setValidatorType
      • Methods inherited from class com.opensymphony.xwork2.validator.validators.ValidatorSupport

        addActionError, addFieldError, getDefaultMessage, getFieldValue, getMessage, getMessageKey, getMessageParameters, getValidatorContext, isShortCircuit, parse, setDefaultMessage, setMessageKey, setMessageParameters, setShortCircuit, setTextProviderFactory, setValidatorContext, setValueStack
      • Methods inherited from interface com.opensymphony.xwork2.validator.Validator

        getDefaultMessage, getMessage, getMessageKey, getMessageParameters, getValidatorContext, setDefaultMessage, setMessageKey, setMessageParameters, setValidatorContext, setValueStack
    • Constructor Detail

      • CssColourValidator

        public CssColourValidator()
    • Method Detail

      • validate

        public void validate​(Object object)
                      throws com.opensymphony.xwork2.validator.ValidationException
        Throws:
        com.opensymphony.xwork2.validator.ValidationException
      • check

        public static boolean check​(String thingToCheck)
        Separated for testability