jaxx.tags.validator
Class BeanValidatorHandler

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

public class BeanValidatorHandler
extends DefaultObjectHandler


Nested Class Summary
static class BeanValidatorHandler.CompiledBeanValidator
          The compiled objet representing a BeanValidator to be generated in JAXXObject
 
Field Summary
static java.lang.String AUTOFIELD_ATTRIBUTE
           
static java.lang.String BEAN_ATTRIBUTE
           
static java.lang.String BEAN_CLASS_ATTRIBUTE
           
static java.lang.String BEAN_INITIALIZER_ATTRIBUTE
           
static java.lang.String CONTEXT_NAME_ATTRIBUTE
           
static java.lang.String ERROR_LIST_ATTRIBUTE
           
static java.lang.String ERROR_LIST_DEFAULT
           
static java.lang.String ERROR_LIST_MODEL_ATTRIBUTE
           
static java.lang.String ERROR_LIST_MODEL_DEFAULT
           
static java.lang.String ERROR_TABLE_ATTRIBUTE
           
static java.lang.String ERROR_TABLE_DEFAULT
           
static java.lang.String ERROR_TABLE_MODEL_ATTRIBUTE
           
static java.lang.String ERROR_TABLE_MODEL_DEFAULT
           
static java.lang.String PARENT_VALIDATOR_ATTRIBUTE
           
static java.lang.String STRICT_MODE_ATTRIBUTE
           
static java.lang.String TAG
           
static java.lang.String UI_CLASS_ATTRIBUTE
           
protected static java.util.Map<JAXXCompiler,java.util.List<java.lang.String>> validatedComponents
           
protected static java.util.Map<JAXXCompiler,java.util.List<BeanValidatorHandler.CompiledBeanValidator>> validators
           
 
Fields inherited from class jaxx.tags.DefaultObjectHandler
jaxxBeanInfo, objectMap
 
Constructor Summary
BeanValidatorHandler(ClassDescriptor beanClass)
           
 
Method Summary
protected  void compileChildTagFirstPass(org.w3c.dom.Element tag, JAXXCompiler compiler)
          Compiles a child of the current tag.
 void compileSecondPass(org.w3c.dom.Element tag, JAXXCompiler compiler)
          Performs the second pass of compilation on an XML tag from a JAXX source file.
protected  CompiledObject createCompiledObject(java.lang.String id, JAXXCompiler compiler)
          Creates the CompiledObject which will represent the object created by this TagHandler.
static java.util.List<BeanValidatorHandler.CompiledBeanValidator> getValidators(JAXXCompiler compiler)
           
static boolean hasValidator(JAXXCompiler compiler)
           
static boolean isBeanUsedByValidator(JAXXCompiler compiler, java.lang.String beanId)
          Test if a given bean is attached to a validator.
static boolean isComponentUsedByValidator(JAXXCompiler compiler, java.lang.String componentId)
          Test if a given CompiledObject is attached to a validator.
 void setAttribute(CompiledObject object, java.lang.String propertyName, java.lang.String stringValue, boolean inline, JAXXCompiler compiler)
          Set a single property on an object.
protected  void setDefaults(CompiledObject object, org.w3c.dom.Element tag, JAXXCompiler compiler)
          Initializes the default settings of the object, prior to setting its attribute values.
 
Methods inherited from class jaxx.tags.DefaultObjectHandler
addEventHandler, addProxyEventInfo, addProxyEventInfo, addProxyEventInfo, addProxyEventInfo, applyStylesheets, compileChildrenFirstPass, compileChildrenSecondPass, compileChildTagSecondPass, compileFirstPass, configureProxyEventInfo, constantValue, convertFromString, getAddMemberListenerCode, getApplyPropertyOrDataBindingCode, getAttributeComparator, getAttributeOrdering, getBeanClass, getGetPropertyCode, getJAXXBeanInfo, getJAXXBeanInfo, getMemberDependencies, getPropertyType, getRemoveMemberListenerCode, getSetPropertyCode, init, isEventHandlerName, isMemberBound, isPropertyInherited, registerCompiledObject, scanAttributesForDependencies, setAttributes, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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_NAME_ATTRIBUTE

public static final java.lang.String CONTEXT_NAME_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 Detail

BeanValidatorHandler

public BeanValidatorHandler(ClassDescriptor beanClass)
Method Detail

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 compile
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(java.lang.String, java.lang.String, java.lang.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)


Copyright © 2008-2009 CodeLutin. All Rights Reserved.