T
- type of validatablepublic class CompoundValidator<T> extends Behavior implements IValidator<T>
IValidator
. Once an error is reported against the IValidatable
being
checked, the rest of the validator chain is ignored.Constructor and Description |
---|
CompoundValidator()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
CompoundValidator<T> |
add(IValidator<T> validator)
Adds an
IValidator 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(Component component)
Bind this handler to the given component.
|
void |
detach(Component component)
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)
|
List<IValidator<T>> |
getValidators()
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 |
onEvent(Component component,
IEvent<?> event)
Called to notify the behavior about any events sent to the component
|
void |
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 |
onRemove(Component component)
Called to notify that the component is being removed from its parent
|
void |
renderHead(Component component,
IHeaderResponse response)
Render to the web response whatever the component wants to contribute to the head section.
|
void |
unbind(Component component)
Notifies the behavior it is removed from the specified component
|
void |
validate(IValidatable<T> validatable)
Validates the
IValidatable instance. |
canCallListener, isEnabled, isTemporary, onAttribute, onTag
public final CompoundValidator<T> add(IValidator<T> validator)
IValidator
to the chain of validators.validator
- an IValidator
to be addedValidationError
for chaining purposespublic final void validate(IValidatable<T> validatable)
IValidator
IValidatable
instance. Validation errors should be reported using
the IValidatable.error(IValidationError)
method.validate
in interface IValidator<T>
validatable
- the IValidatable
instance being validatedIValidator.validate(IValidatable)
public final List<IValidator<T>> getValidators()
IValidator
s inside this onepublic void beforeRender(Component component)
Behavior
beforeRender
in class Behavior
component
- the component that has this behavior coupledpublic void afterRender(Component component)
Behavior
afterRender
in class Behavior
component
- the component that has this behavior coupledpublic void bind(Component component)
Behavior
public void unbind(Component component)
Behavior
public void detach(Component component)
Behavior
public void onException(Component component, RuntimeException exception)
Behavior
Behavior.afterRender(Component)
, you should do the same in the implementation of this method.onException
in class Behavior
component
- the component that has a reference to this behavior and during which processing
the exception occurredexception
- the unexpected exceptionpublic boolean getStatelessHint(Component component)
Behavior
getStatelessHint
in class Behavior
component
- the component that has this behavior coupled.public void onComponentTag(Component component, ComponentTag tag)
Behavior
onComponentTag
in class Behavior
component
- the component that renders this tag currentlytag
- the tag that is renderedpublic void renderHead(Component component, IHeaderResponse response)
Behavior
renderHead
in interface IComponentAwareHeaderContributor
renderHead
in class Behavior
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 objectpublic void onConfigure(Component component)
Behavior
onConfigure
in class Behavior
component
- the component being configuredpublic void onEvent(Component component, IEvent<?> event)
Behavior
onEvent
in interface IComponentAwareEventSink
onEvent
in class Behavior
component
- component that owns this sink. For example, if the implementation of this
interface is a Behavior
then component parameter will contain the
component to which the behavior is attached.IComponentAwareEventSink.onEvent(org.apache.wicket.Component,
org.apache.wicket.event.IEvent)
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.