java.lang.Object
org.apache.wicket.behavior.Behavior
org.apache.wicket.validation.CompoundValidator<T>
- Type Parameters:
T
- type of validatable
- All Implemented Interfaces:
Serializable
,IComponentAwareEventSink
,IComponentAwareHeaderContributor
,IClusterable
,IValidator<T>
A compound
IValidator
. Once an error is reported against the IValidatable
being
checked, the rest of the validator chain is ignored.- Since:
- 1.2.6
- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal CompoundValidator<T>
add
(IValidator<T> validator) Adds anIValidator
to the chain of validators.void
afterRender
(Component component) Called when a component that has this behavior coupled was rendered.void
beforeRender
(Component component) Called when a component is about to render.void
Bind this handler to the given component.void
Allows the behavior to detach any state it has attached during request processing.boolean
getStatelessHint
(Component component) This method returns false if the behavior generates a callback url (for example ajax behaviors)final List<IValidator<T>>
Gets an unmodifiable list of the registered validators.void
onComponentTag
(Component component, ComponentTag tag) Called any time a component that has this behavior registered is rendering the component tag.void
onConfigure
(Component component) Called immediately after the onConfigure method in a component.void
Called to notify the behavior about any events sent to the componentvoid
onException
(Component component, RuntimeException exception) In case an unexpected exception happened anywhere between Behavior.onComponentTag(org.apache.wicket.Component, org.apache.wicket.markup.ComponentTag) and Behavior.afterRender(org.apache.wicket.Component), onException() will be called for any behavior.void
Called to notify that the component is being removed from its parentvoid
renderHead
(Component component, IHeaderResponse response) Render to the web response whatever the component wants to contribute to the head section.void
Notifies the behavior it is removed from the specified componentfinal void
validate
(IValidatable<T> validatable) Validates theIValidatable
instance.Methods inherited from class org.apache.wicket.behavior.Behavior
canCallListener, isEnabled, isTemporary, onAttribute, onTag
-
Constructor Details
-
CompoundValidator
public CompoundValidator()Constructor.
-
-
Method Details
-
add
Adds anIValidator
to the chain of validators.- Parameters:
validator
- anIValidator
to be added- Returns:
- this
ValidationError
for chaining purposes
-
validate
Description copied from interface:IValidator
Validates theIValidatable
instance. Validation errors should be reported using theIValidatable.error(IValidationError)
method.- Specified by:
validate
in interfaceIValidator<T>
- Parameters:
validatable
- theIValidatable
instance being validated- See Also:
-
getValidators
Gets an unmodifiable list of the registered validators.- Returns:
- unmodifiable list of delegate
IValidator
s inside this one
-
beforeRender
Description copied from class:Behavior
Called when a component is about to render.- Overrides:
beforeRender
in classBehavior
- Parameters:
component
- the component that has this behavior coupled
-
afterRender
Description copied from class:Behavior
Called when a component that has this behavior coupled was rendered.- Overrides:
afterRender
in classBehavior
- Parameters:
component
- the component that has this behavior coupled
-
bind
Description copied from class:Behavior
Bind this handler to the given component. This method is called by the host component immediately after this behavior is added to it. This method is useful if you need to do initialization based on the component it is attached and you can't wait to do it at render time. Keep in mind that if you decide to keep a reference to the host component, it is not thread safe anymore, and should thus only be used in situations where you do not reuse the behavior for multiple components. -
unbind
Description copied from class:Behavior
Notifies the behavior it is removed from the specified component -
detach
Description copied from class:Behavior
Allows the behavior to detach any state it has attached during request processing. -
onException
Description copied from class:Behavior
In case an unexpected exception happened anywhere between Behavior.onComponentTag(org.apache.wicket.Component, org.apache.wicket.markup.ComponentTag) and Behavior.afterRender(org.apache.wicket.Component), onException() will be called for any behavior. Typically, if you clean up resources inBehavior.afterRender(Component)
, you should do the same in the implementation of this method.- Overrides:
onException
in classBehavior
- Parameters:
component
- the component that has a reference to this behavior and during which processing the exception occurredexception
- the unexpected exception
-
getStatelessHint
Description copied from class:Behavior
This method returns false if the behavior generates a callback url (for example ajax behaviors)- Overrides:
getStatelessHint
in classBehavior
- Parameters:
component
- the component that has this behavior coupled.- Returns:
- boolean true or false.
-
onComponentTag
Description copied from class:Behavior
Called any time a component that has this behavior registered is rendering the component tag.- Overrides:
onComponentTag
in classBehavior
- Parameters:
component
- the component that renders this tag currentlytag
- the tag that is rendered
-
renderHead
Description copied from class:Behavior
Render to the web response whatever the component wants to contribute to the head section.- Specified by:
renderHead
in interfaceIComponentAwareHeaderContributor
- Overrides:
renderHead
in classBehavior
- Parameters:
component
- component which is contributing to the response. This parameter is here to give the component as the context for component-awares implementing this interfaceresponse
- Response object
-
onConfigure
Description copied from class:Behavior
Called immediately after the onConfigure method in a component. Since this is before the rendering cycle has begun, the behavior can modify the configuration of the component (i.e. setVisible(false))- Overrides:
onConfigure
in classBehavior
- Parameters:
component
- the component being configured
-
onEvent
Description copied from class:Behavior
Called to notify the behavior about any events sent to the component- Specified by:
onEvent
in interfaceIComponentAwareEventSink
- Overrides:
onEvent
in classBehavior
- Parameters:
component
- component that owns this sink. For example, if the implementation of this interface is aBehavior
then component parameter will contain the component to which the behavior is attached.- See Also:
-
onRemove
Description copied from class:Behavior
Called to notify that the component is being removed from its parent
-