Class AbstractTransformerBehavior
- java.lang.Object
-
- org.apache.wicket.behavior.Behavior
-
- org.apache.wicket.markup.transformer.AbstractTransformerBehavior
-
- All Implemented Interfaces:
Serializable
,IComponentAwareEventSink
,IComponentAwareHeaderContributor
,ITransformer
,IClusterable
- Direct Known Subclasses:
XsltTransformerBehavior
public abstract class AbstractTransformerBehavior extends Behavior implements ITransformer
ABehavior
which can be added to any component. It allows to post-process (transform) the markup generated by the component.- Author:
- Juergen Donnerstag
- See Also:
AbstractOutputTransformerContainer
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractTransformerBehavior()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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
detach(Component component)
Allows the behavior to detach any state it has attached during request processing.protected BufferedWebResponse
newResponse(WebResponse originalResponse)
Create a new response object which is used to store the markup generated by the child objects.abstract CharSequence
transform(Component component, CharSequence output)
Will be invoked after all child components have been processed to allow for transforming the markup generated.-
Methods inherited from class org.apache.wicket.behavior.Behavior
bind, canCallListener, getStatelessHint, isEnabled, isTemporary, onAttribute, onComponentTag, onConfigure, onEvent, onException, onRemove, onTag, renderHead, unbind
-
-
-
-
Constructor Detail
-
AbstractTransformerBehavior
public AbstractTransformerBehavior()
-
-
Method Detail
-
newResponse
protected BufferedWebResponse newResponse(WebResponse originalResponse)
Create a new response object which is used to store the markup generated by the child objects.- Parameters:
originalResponse
- the original web response ornull
if it isn't aWebResponse
- Returns:
- Response object. Must not be null
-
beforeRender
public void beforeRender(Component component)
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
public void afterRender(Component component)
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
-
detach
public void detach(Component component)
Description copied from class:Behavior
Allows the behavior to detach any state it has attached during request processing.
-
transform
public abstract CharSequence transform(Component component, CharSequence output) throws Exception
Description copied from interface:ITransformer
Will be invoked after all child components have been processed to allow for transforming the markup generated.- Specified by:
transform
in interfaceITransformer
- Parameters:
component
- The associated Wicket componentoutput
- The markup generated by the child components- Returns:
- The output which will be appended to the original response
- Throws:
Exception
-
-