Package jaxx.compiler.tags.validator
Class BeanValidatorHandler
java.lang.Object
jaxx.compiler.tags.DefaultObjectHandler
jaxx.compiler.tags.validator.BeanValidatorHandler
- All Implemented Interfaces:
TagHandler
public class BeanValidatorHandler extends DefaultObjectHandler
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBeanValidatorHandler.CompiledBeanValidatorThe compiled objet representing a BeanValidator to be generated in JAXXObjectNested classes/interfaces inherited from class jaxx.compiler.tags.DefaultObjectHandler
DefaultObjectHandler.ProxyEventInfo -
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAUTOFIELD_ATTRIBUTEstatic java.lang.StringBEAN_ATTRIBUTEstatic java.lang.StringBEAN_CLASS_ATTRIBUTEstatic java.lang.StringBEAN_INITIALIZER_ATTRIBUTEstatic java.lang.StringCONTEXT_ATTRIBUTEstatic java.lang.StringERROR_LIST_ATTRIBUTEstatic java.lang.StringERROR_LIST_DEFAULTstatic java.lang.StringERROR_LIST_MODEL_ATTRIBUTEstatic java.lang.StringERROR_LIST_MODEL_DEFAULTstatic java.lang.StringERROR_TABLE_ATTRIBUTEstatic java.lang.StringERROR_TABLE_DEFAULTstatic java.lang.StringERROR_TABLE_MODEL_ATTRIBUTEstatic java.lang.StringERROR_TABLE_MODEL_DEFAULTstatic java.lang.StringPARENT_VALIDATOR_ATTRIBUTEstatic java.lang.StringSTRICT_MODE_ATTRIBUTEstatic java.lang.StringTAGstatic java.lang.StringUI_CLASS_ATTRIBUTEprotected static java.util.Map<JAXXCompiler,java.util.List<java.lang.String>>validatedComponentsprotected static java.util.Map<JAXXCompiler,java.util.List<BeanValidatorHandler.CompiledBeanValidator>>validatorsFields inherited from class jaxx.compiler.tags.DefaultObjectHandler
ABSTRACT_ATTRIBUTE, BORDER_LAYOUT_PREFIX, CONSTRAINTS_ATTRIBUTE, CONSTRUCTOR_PARAMS_ATTRIBUTE, DECORATOR_ATTRIBUTE, DISPLAYED_MNEMONIC_ATTRIBUTE, DISPLAYED_MNEMONIC_INDEX_ATTRIBUTE, GENERIC_TYPE_ATTRIBUTE, GRID_LAYOUT_PREFIX, HANDLER_ATTRIBUTE, ID_ATTRIBUTE, IMPLEMENTS_ATTRIBUTE, INITIALIZER_ATTRIBUTE, JAVA_BEAN_ATTRIBUTE, jaxxBeanInfo, LAYOUT_ATTRIBUTE, MNEMONIC_ATTRIBUTE, objectMap, STYLE_CLASS_ATTRIBUTE, SUPER_GENERIC_TYPE_ATTRIBUTEFields inherited from interface jaxx.compiler.tags.TagHandler
XMLNS_ATTRIBUTE -
Constructor Summary
Constructors Constructor Description BeanValidatorHandler(ClassDescriptor beanClass) -
Method Summary
Modifier and Type Method Description protected voidcompileChildTagFirstPass(org.w3c.dom.Element tag, JAXXCompiler compiler)Compiles a child of the current tag.voidcompileSecondPass(org.w3c.dom.Element tag, JAXXCompiler compiler)Performs the second pass of compilation on an XML tag from a JAXX source file.protected CompiledObjectcreateCompiledObject(java.lang.String id, JAXXCompiler compiler)Creates theCompiledObjectwhich will represent the object created by thisTagHandler.static java.util.List<BeanValidatorHandler.CompiledBeanValidator>getValidators(JAXXCompiler compiler)static booleanhasValidator(JAXXCompiler compiler)static booleanisBeanUsedByValidator(JAXXCompiler compiler, java.lang.String beanId)Test if a given bean is attached to a validator.static booleanisComponentUsedByValidator(JAXXCompiler compiler, java.lang.String componentId)Test if a given CompiledObject is attached to a validator.voidsetAttribute(CompiledObject object, java.lang.String propertyName, java.lang.String stringValue, boolean inline, JAXXCompiler compiler)Set a single property on an object.protected voidsetDefaults(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.compiler.tags.DefaultObjectHandler
addEventHandler, addProxyEventInfo, addProxyEventInfo, addProxyEventInfo, addProxyEventInfo, applyStylesheets, compileChildrenFirstPass, compileChildrenSecondPass, compileChildTagSecondPass, compileFirstPass, configureProxyEventInfo, constantValue, convertFromString, getAttributeComparator, getAttributeOrdering, getBeanClass, getEventClass, getEventInfo, getGetPropertyCode, getJAXXBeanInfo, getJAXXBeanInfo, getPropertyType, getSetPropertyCode, init, isEventHandlerName, isMemberBound, isPropertyInherited, registerCompiledObject, safeInit, scanAttributesForDependencies, setAttributeFromCss, setAttributes, setProperty, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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
-
-
Constructor Details
-
BeanValidatorHandler
-
-
Method Details
-
createCompiledObject
Description copied from class:DefaultObjectHandlerCreates theCompiledObjectwhich will represent the object created by thisTagHandler.- Overrides:
createCompiledObjectin classDefaultObjectHandler- Parameters:
id- theCompiledObject'sID.compiler- compiler to use- Returns:
- the
CompiledObjectto use
-
compileChildTagFirstPass
protected void compileChildTagFirstPass(org.w3c.dom.Element tag, JAXXCompiler compiler) throws CompilerException, java.io.IOExceptionDescription copied from class:DefaultObjectHandlerCompiles a child of the current tag. The default implementation callsJAXXCompiler.compileFirstPass.- Overrides:
compileChildTagFirstPassin classDefaultObjectHandler- Parameters:
tag- the child tag to runcompiler- the currentJAXXCompiler- Throws:
CompilerException- if a compilation error occursjava.io.IOException- if an I/O error occurs
-
compileSecondPass
public void compileSecondPass(org.w3c.dom.Element tag, JAXXCompiler compiler) throws CompilerException, java.io.IOExceptionDescription copied from interface:TagHandlerPerforms the second pass of compilation on an XML tag from a JAXX source file.TagHandlerimplementations affect the generated.javafile by calling methods in theJAXXCompiler.- Specified by:
compileSecondPassin interfaceTagHandler- Overrides:
compileSecondPassin classDefaultObjectHandler- Parameters:
tag- the XML tag to compilecompiler- the active JAXXCompiler- Throws:
CompilerException- if a compilation error occursjava.io.IOException- if an I/O error occurs
-
setDefaults
Description copied from class:DefaultObjectHandlerInitializes the default settings of the object, prior to setting its attribute values. The default implementation does nothing.- Overrides:
setDefaultsin classDefaultObjectHandler- Parameters:
object- the object to initializetag- the tag being compiledcompiler- the currentJAXXCompiler
-
setAttribute
public void setAttribute(CompiledObject object, java.lang.String propertyName, java.lang.String stringValue, boolean inline, JAXXCompiler compiler)Description copied from class:DefaultObjectHandlerSet 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 usingDefaultObjectHandler.convertFromString(String, String, Class).- Overrides:
setAttributein classDefaultObjectHandler- Parameters:
object- the object on which to set the propertypropertyName- the name of the property to setstringValue- the raw string value of the property from the XMLinline-trueif the value was directly specified as an inline class tag attribute,falseotherwise (a default value, specified in CSS, etc.)compiler- the currentJAXXCompiler
-
isBeanUsedByValidator
Test if a given bean is attached to a validator.- Parameters:
compiler- current compiler to usebeanId- the bean to test- Returns:
trueif the given bean is attached to a validator,falseotherwise
-
hasValidator
- Parameters:
compiler- compiler to use- Returns:
trueif some validators were detected,falseotherwise
-
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 usecomponentId- the compiled object to test- Returns:
trueif the given compiled object is attached to a validator,falseotherwise
-
getValidators
public static java.util.List<BeanValidatorHandler.CompiledBeanValidator> getValidators(JAXXCompiler compiler)
-