Class ValidatorHandler
- All Implemented Interfaces:
AttachedObjectHandler, EditableValueHolderAttachedObjectHandler, FaceletHandler, ValueHolderAttachedObjectHandler
Handles setting a Validator instance on an
EditableValueHolder parent. Will wire all attributes set to the
Validator instance created/fetched. Uses the "binding" attribute for grabbing instances to apply
attributes to.
Will only set/create Validator is the passed UIComponent's parent is null, signifying that it wasn't restored from an existing tree.
-
Field Summary
Fields inherited from class DelegatingMetaTagHandler
delegateFactoryModifier and TypeFieldDescriptionprotected TagHandlerDelegateFactoryClass that defines methods relating to helping tag handler instances.Fields inherited from class TagHandler
nextHandler, tag, tagIdModifier and TypeFieldDescriptionprotected final FaceletHandlerA reference to theFaceletHandlerthat represents the first nested child of thisTagHandlerinstance.protected final TagA reference to theTaginstance corresponding to thisTagHandlerinstance.protected final StringSeeTagConfig.getTagId(). -
Constructor Summary
ConstructorsConstructorDescriptionValidatorHandler(ValidatorConfig config) Construct this instance around the configuration information in argumentconfig -
Method Summary
Modifier and TypeMethodDescriptionprotected TagHandlerDelegateReturn the implementation specific delegate instance that provides the bulk of the work for this handler instance.Return theTagConfigsubclass used to configure this handler instance.Retrieve the id of the validator that is to be created and added to the parentEditableValueHolder.Methods inherited from class FaceletsAttachedObjectHandler
applyAttachedObject, getAttachedObjectHandlerHelper, getForModifier and TypeMethodDescriptionfinal voidapplyAttachedObject(FacesContext ctx, UIComponent parent) Take the necessary actions to apply the attached object represented by the tag for the concrete subclass of this class to the argumentparent.protected final AttachedObjectHandlerReturn the underlying handler for this tag handler instance.final StringgetFor()Return the value of the "for" attribute.Methods inherited from class DelegatingMetaTagHandler
apply, applyNextHandler, createMetaRuleset, getBinding, getTag, getTagAttribute, getTagId, isDisabled, setAttributesModifier and TypeMethodDescriptionvoidapply(FaceletContext ctx, UIComponent parent) The default implementation simply calls through toTagHandlerDelegate.apply(FaceletContext, UIComponent).voidInvoke theapply()method on this instance'sTagHandler.nextHandler.protected MetaRulesetcreateMetaRuleset(Class type) The default implementation simply calls through toTagHandlerDelegate.createMetaRuleset(Class)and returns the result.Return the "binding" attribute.getTag()Return a reference to theTaginstance corresponding to thisTagHandlerinstance.getTagAttribute(String localName) Return the named attribute from the tag attributes.getTagId()Return the tag id from theTagConfigused to instantiate this handler.booleanisDisabled(FaceletContext ctx) Returns the value of the "disabled" attribute.voidsetAttributes(FaceletContext ctx, Object instance) Invoking/extending this method will cause the results of the created MetaRuleset to auto-wire state to the passed instance.Methods inherited from class TagHandler
getAttribute, getRequiredAttribute, toStringModifier and TypeMethodDescriptionprotected final TagAttributegetAttribute(String localName) Utility method for fetching the appropriate TagAttributeprotected final TagAttributegetRequiredAttribute(String localName) Utility method for fetching a required TagAttributetoString()
-
Constructor Details
-
ValidatorHandler
Construct this instance around the configuration information in argument
config- Parameters:
config- theTagConfigsubclass for this kind of attached object.
-
-
Method Details
-
getTagHandlerDelegate
Return the implementation specific delegate instance that provides the bulk of the work for this handler instance.
- Specified by:
getTagHandlerDelegatein classDelegatingMetaTagHandler- Returns:
- the implementation specific delegate instance
-
getValidatorId
Retrieve the id of the validator that is to be created and added to the parent
EditableValueHolder. All subclasses should override this method because it is important for Facelets to have a unique way of identifying the validators that are added to thisEditableValueHolderand allows exclusions to work properly. An exclusion is a validator declaration that has the attribute "disabled" which resolves to false, instructing Facelets not to register a default validator with the same id.- Parameters:
ctx- the FaceletContext for thisFacelet- Returns:
- the validator-id
-
getValidatorConfig
Return the
TagConfigsubclass used to configure this handler instance.- Returns:
- the
TagConfigsubclass used to configure this handler instance.
-