Class BeanValidatorHandler

java.lang.Object
jaxx.compiler.tags.DefaultObjectHandler
jaxx.compiler.tags.validator.BeanValidatorHandler
All Implemented Interfaces:
TagHandler

public class BeanValidatorHandler
extends DefaultObjectHandler
  • Field Details

    • TAG

      public static final java.lang.String TAG
      See Also:
      Constant Field Values
    • BEAN_ATTRIBUTE

      public static final java.lang.String BEAN_ATTRIBUTE
      See Also:
      Constant Field Values
    • BEAN_CLASS_ATTRIBUTE

      public static final java.lang.String BEAN_CLASS_ATTRIBUTE
      See Also:
      Constant Field Values
    • BEAN_INITIALIZER_ATTRIBUTE

      public static final java.lang.String BEAN_INITIALIZER_ATTRIBUTE
      See Also:
      Constant Field Values
    • ERROR_LIST_MODEL_ATTRIBUTE

      public static final java.lang.String ERROR_LIST_MODEL_ATTRIBUTE
      See Also:
      Constant Field Values
    • ERROR_TABLE_MODEL_ATTRIBUTE

      public static final java.lang.String ERROR_TABLE_MODEL_ATTRIBUTE
      See Also:
      Constant Field Values
    • ERROR_LIST_ATTRIBUTE

      public static final java.lang.String ERROR_LIST_ATTRIBUTE
      See Also:
      Constant Field Values
    • ERROR_TABLE_ATTRIBUTE

      public static final java.lang.String ERROR_TABLE_ATTRIBUTE
      See Also:
      Constant Field Values
    • ERROR_LIST_MODEL_DEFAULT

      public static final java.lang.String ERROR_LIST_MODEL_DEFAULT
      See Also:
      Constant Field Values
    • ERROR_TABLE_MODEL_DEFAULT

      public static final java.lang.String ERROR_TABLE_MODEL_DEFAULT
      See Also:
      Constant Field Values
    • ERROR_LIST_DEFAULT

      public static final java.lang.String ERROR_LIST_DEFAULT
      See Also:
      Constant Field Values
    • ERROR_TABLE_DEFAULT

      public static final java.lang.String ERROR_TABLE_DEFAULT
      See Also:
      Constant Field Values
    • AUTOFIELD_ATTRIBUTE

      public static final java.lang.String AUTOFIELD_ATTRIBUTE
      See Also:
      Constant Field Values
    • UI_CLASS_ATTRIBUTE

      public static final java.lang.String UI_CLASS_ATTRIBUTE
      See Also:
      Constant Field Values
    • STRICT_MODE_ATTRIBUTE

      public static final java.lang.String STRICT_MODE_ATTRIBUTE
      See Also:
      Constant Field Values
    • CONTEXT_ATTRIBUTE

      public static final java.lang.String CONTEXT_ATTRIBUTE
      See Also:
      Constant Field Values
    • PARENT_VALIDATOR_ATTRIBUTE

      public static final java.lang.String PARENT_VALIDATOR_ATTRIBUTE
      See Also:
      Constant Field Values
    • validators

      protected static java.util.Map<JAXXCompiler,​java.util.List<BeanValidatorHandler.CompiledBeanValidator>> validators
    • validatedComponents

      protected static java.util.Map<JAXXCompiler,​java.util.List<java.lang.String>> validatedComponents
  • Constructor Details

    • BeanValidatorHandler

      public BeanValidatorHandler​(ClassDescriptor beanClass)
  • Method Details

    • createCompiledObject

      protected CompiledObject createCompiledObject​(java.lang.String id, JAXXCompiler compiler)
      Description copied from class: DefaultObjectHandler
      Creates the CompiledObject which will represent the object created by this TagHandler.
      Overrides:
      createCompiledObject in class DefaultObjectHandler
      Parameters:
      id - the CompiledObject's ID.
      compiler - compiler to use
      Returns:
      the CompiledObject to use
    • compileChildTagFirstPass

      protected void compileChildTagFirstPass​(org.w3c.dom.Element tag, JAXXCompiler compiler) throws CompilerException, java.io.IOException
      Description copied from class: DefaultObjectHandler
      Compiles a child of the current tag. The default implementation calls JAXXCompiler.compileFirstPass.
      Overrides:
      compileChildTagFirstPass in class DefaultObjectHandler
      Parameters:
      tag - the child tag to run
      compiler - the current JAXXCompiler
      Throws:
      CompilerException - if a compilation error occurs
      java.io.IOException - if an I/O error occurs
    • compileSecondPass

      public void compileSecondPass​(org.w3c.dom.Element tag, JAXXCompiler compiler) throws CompilerException, java.io.IOException
      Description copied from interface: TagHandler
      Performs the second pass of compilation on an XML tag from a JAXX source file. TagHandler implementations affect the generated .java file by calling methods in the JAXXCompiler.
      Specified by:
      compileSecondPass in interface TagHandler
      Overrides:
      compileSecondPass in class DefaultObjectHandler
      Parameters:
      tag - the XML tag to compile
      compiler - the active JAXXCompiler
      Throws:
      CompilerException - if a compilation error occurs
      java.io.IOException - if an I/O error occurs
    • setDefaults

      protected void setDefaults​(CompiledObject object, org.w3c.dom.Element tag, JAXXCompiler compiler)
      Description copied from class: DefaultObjectHandler
      Initializes the default settings of the object, prior to setting its attribute values. The default implementation does nothing.
      Overrides:
      setDefaults in class DefaultObjectHandler
      Parameters:
      object - the object to initialize
      tag - the tag being compiled
      compiler - the current JAXXCompiler
    • setAttribute

      public void setAttribute​(CompiledObject object, java.lang.String propertyName, java.lang.String stringValue, boolean inline, JAXXCompiler compiler)
      Description copied from class: DefaultObjectHandler
      Set a single property on an object. The value may be either a simple value or contain data binding expressions. Simple values are first converted to the property's type using DefaultObjectHandler.convertFromString(String, String, Class).
      Overrides:
      setAttribute in class DefaultObjectHandler
      Parameters:
      object - the object on which to set the property
      propertyName - the name of the property to set
      stringValue - the raw string value of the property from the XML
      inline - true if the value was directly specified as an inline class tag attribute, false otherwise (a default value, specified in CSS, etc.)
      compiler - the current JAXXCompiler
    • isBeanUsedByValidator

      public static boolean isBeanUsedByValidator​(JAXXCompiler compiler, java.lang.String beanId)
      Test if a given bean is attached to a validator.
      Parameters:
      compiler - current compiler to use
      beanId - the bean to test
      Returns:
      true if the given bean is attached to a validator, false otherwise
    • hasValidator

      public static boolean hasValidator​(JAXXCompiler compiler)
      Parameters:
      compiler - compiler to use
      Returns:
      true if some validators were detected, false otherwise
    • isComponentUsedByValidator

      public static boolean isComponentUsedByValidator​(JAXXCompiler compiler, java.lang.String componentId)
      Test if a given CompiledObject is attached to a validator.
      Parameters:
      compiler - compiler to use
      componentId - the compiled object to test
      Returns:
      true if the given compiled object is attached to a validator, false otherwise
    • getValidators

      public static java.util.List<BeanValidatorHandler.CompiledBeanValidator> getValidators​(JAXXCompiler compiler)