org.apache.wicket.markup.transformer
Class AbstractTransformerBehavior

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by org.apache.wicket.markup.transformer.AbstractTransformerBehavior
All Implemented Interfaces:
java.io.Serializable, IClusterable, IComponentAwareEventSink, IComponentAwareHeaderContributor, ITransformer
Direct Known Subclasses:
XsltTransformerBehavior

public abstract class AbstractTransformerBehavior
extends Behavior
implements ITransformer

A IBehavior 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
AbstractTransformerBehavior()
          Construct.
 
Method Summary
 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  java.lang.CharSequence transform(Component component, java.lang.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, canCallListenerInterface, getStatelessHint, isEnabled, isTemporary, onComponentTag, onConfigure, onEvent, onException, renderHead, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTransformerBehavior

public AbstractTransformerBehavior()
Construct.

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 -
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 class Behavior
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 class Behavior
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.

Overrides:
detach in class Behavior
Parameters:
component - the component that initiates the detachment of this behavior

transform

public abstract java.lang.CharSequence transform(Component component,
                                                 java.lang.CharSequence output)
                                          throws java.lang.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 interface ITransformer
Parameters:
component - The associated Wicket component
output - The markup generated by the child components
Returns:
The output which will be appended to the original response
Throws:
java.lang.Exception


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.