Class BeanValidatorHandler
- java.lang.Object
-
- org.nuiton.jaxx.compiler.tags.DefaultObjectHandler
-
- org.nuiton.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 JAXXObject-
Nested classes/interfaces inherited from class org.nuiton.jaxx.compiler.tags.DefaultObjectHandler
DefaultObjectHandler.ProxyEventInfo
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTOFIELD_ATTRIBUTEstatic StringBEAN_ATTRIBUTEstatic StringBEAN_CLASS_ATTRIBUTEstatic StringBEAN_INITIALIZER_ATTRIBUTEstatic StringCONTEXT_ATTRIBUTEstatic StringERROR_LIST_ATTRIBUTEstatic StringERROR_LIST_DEFAULTstatic StringERROR_LIST_MODEL_ATTRIBUTEstatic StringERROR_LIST_MODEL_DEFAULTstatic StringERROR_TABLE_ATTRIBUTEstatic StringERROR_TABLE_DEFAULTstatic StringERROR_TABLE_MODEL_ATTRIBUTEstatic StringERROR_TABLE_MODEL_DEFAULTstatic StringPARENT_VALIDATOR_ATTRIBUTEstatic StringSTRICT_MODE_ATTRIBUTEstatic StringTAGstatic StringUI_CLASS_ATTRIBUTEprotected static Map<JAXXCompiler,List<String>>validatedComponentsprotected static Map<JAXXCompiler,List<BeanValidatorHandler.CompiledBeanValidator>>validators-
Fields inherited from class org.nuiton.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, I18N_ATTRIBUTE, I18N_PROPERTY_ATTRIBUTE, ID_ATTRIBUTE, IMPLEMENTS_ATTRIBUTE, INITIALIZER_ATTRIBUTE, JAVA_BEAN_ATTRIBUTE, jaxxBeanInfo, LAYOUT_ATTRIBUTE, MNEMONIC_ATTRIBUTE, objectMap, OVERRIDE_PARAMETER, STYLE_CLASS_ATTRIBUTE, SUPER_GENERIC_TYPE_ATTRIBUTE
-
Fields inherited from interface org.nuiton.jaxx.compiler.tags.TagHandler
XMLNS_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description BeanValidatorHandler(ClassDescriptor beanClass)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcompileChildTagFirstPass(Element tag, JAXXCompiler compiler)Compiles a child of the current tag.voidcompileSecondPass(Element tag, JAXXCompiler compiler)Performs the second pass of compilation on an XML tag from a JAXX source file.protected CompiledObjectcreateCompiledObject(String id, JAXXCompiler compiler)Creates theCompiledObjectwhich will represent the object created by thisTagHandler.static List<BeanValidatorHandler.CompiledBeanValidator>getValidators(JAXXCompiler compiler)static booleanhasValidator(JAXXCompiler compiler)static booleanisBeanUsedByValidator(JAXXCompiler compiler, String beanId)Test if a given bean is attached to a validator.static booleanisComponentUsedByValidator(JAXXCompiler compiler, String componentId)Test if a given CompiledObject is attached to a validator.voidsetAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler)Set a single property on an object.protected voidsetDefaults(CompiledObject object, Element tag, JAXXCompiler compiler)Initializes the default settings of the object, prior to setting its attribute values.-
Methods inherited from class org.nuiton.jaxx.compiler.tags.DefaultObjectHandler
addEventHandler, addProxyEventInfo, addProxyEventInfo, addProxyEventInfo, addProxyEventInfo, applyStylesheets, cleanConstructorParams, compileChildrenFirstPass, compileChildrenSecondPass, compileChildTagSecondPass, compileFirstPass, configureProxyEventInfo, constantValue, convertFromString, getAttributeComparator, getAttributeOrdering, getBeanClass, getEventClass, getEventInfo, getGetPropertyCode, getJAXXBeanInfo, getJAXXBeanInfo, getPropertyType, getSafeCompiledObject, getSetPropertyCode, init, isEventHandlerName, isMemberBound, isPropertyInherited, registerCompiledObject, safeInit, scanAttributesForDependencies, setAttributeFromCss, setAttributes, setProperty, toString
-
-
-
-
Field Detail
-
TAG
public static final String TAG
- See Also:
- Constant Field Values
-
BEAN_ATTRIBUTE
public static final String BEAN_ATTRIBUTE
- See Also:
- Constant Field Values
-
BEAN_CLASS_ATTRIBUTE
public static final String BEAN_CLASS_ATTRIBUTE
- See Also:
- Constant Field Values
-
BEAN_INITIALIZER_ATTRIBUTE
public static final String BEAN_INITIALIZER_ATTRIBUTE
- See Also:
- Constant Field Values
-
ERROR_LIST_MODEL_ATTRIBUTE
public static final String ERROR_LIST_MODEL_ATTRIBUTE
- See Also:
- Constant Field Values
-
ERROR_TABLE_MODEL_ATTRIBUTE
public static final String ERROR_TABLE_MODEL_ATTRIBUTE
- See Also:
- Constant Field Values
-
ERROR_LIST_ATTRIBUTE
public static final String ERROR_LIST_ATTRIBUTE
- See Also:
- Constant Field Values
-
ERROR_TABLE_ATTRIBUTE
public static final String ERROR_TABLE_ATTRIBUTE
- See Also:
- Constant Field Values
-
ERROR_LIST_MODEL_DEFAULT
public static final String ERROR_LIST_MODEL_DEFAULT
- See Also:
- Constant Field Values
-
ERROR_TABLE_MODEL_DEFAULT
public static final String ERROR_TABLE_MODEL_DEFAULT
- See Also:
- Constant Field Values
-
ERROR_LIST_DEFAULT
public static final String ERROR_LIST_DEFAULT
- See Also:
- Constant Field Values
-
ERROR_TABLE_DEFAULT
public static final String ERROR_TABLE_DEFAULT
- See Also:
- Constant Field Values
-
AUTOFIELD_ATTRIBUTE
public static final String AUTOFIELD_ATTRIBUTE
- See Also:
- Constant Field Values
-
UI_CLASS_ATTRIBUTE
public static final String UI_CLASS_ATTRIBUTE
- See Also:
- Constant Field Values
-
STRICT_MODE_ATTRIBUTE
public static final String STRICT_MODE_ATTRIBUTE
- See Also:
- Constant Field Values
-
CONTEXT_ATTRIBUTE
public static final String CONTEXT_ATTRIBUTE
- See Also:
- Constant Field Values
-
PARENT_VALIDATOR_ATTRIBUTE
public static final String PARENT_VALIDATOR_ATTRIBUTE
- See Also:
- Constant Field Values
-
validators
protected static final Map<JAXXCompiler,List<BeanValidatorHandler.CompiledBeanValidator>> validators
-
validatedComponents
protected static final Map<JAXXCompiler,List<String>> validatedComponents
-
-
Constructor Detail
-
BeanValidatorHandler
public BeanValidatorHandler(ClassDescriptor beanClass)
-
-
Method Detail
-
createCompiledObject
protected CompiledObject createCompiledObject(String id, JAXXCompiler compiler)
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(Element tag, JAXXCompiler compiler) throws CompilerException, IOException
Description 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 occursIOException- if an I/O error occurs
-
compileSecondPass
public void compileSecondPass(Element tag, JAXXCompiler compiler) throws CompilerException, IOException
Description 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 occursIOException- if an I/O error occurs
-
setDefaults
protected void setDefaults(CompiledObject object, Element tag, JAXXCompiler compiler)
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, String propertyName, 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
public static boolean isBeanUsedByValidator(JAXXCompiler compiler, String beanId)
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
public static boolean hasValidator(JAXXCompiler compiler)
- Parameters:
compiler- compiler to use- Returns:
trueif some validators were detected,falseotherwise
-
isComponentUsedByValidator
public static boolean isComponentUsedByValidator(JAXXCompiler compiler, 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 List<BeanValidatorHandler.CompiledBeanValidator> getValidators(JAXXCompiler compiler)
-
-