jfun.yan.containers
Class ComponentTransformer

java.lang.Object
  extended by jfun.yan.containers.ComponentTransformer
All Implemented Interfaces:
java.io.Serializable

public abstract class ComponentTransformer
extends java.lang.Object
implements java.io.Serializable

This class represents a combinator to transform Component objects.

Codehaus.org.

Author:
Ben Yu
See Also:
Serialized Form

Constructor Summary
ComponentTransformer()
           
 
Method Summary
 ComponentTransformer seq(ComponentTransformer ct)
          Create a new ComponentTransformer by sequencing this transformer and another transformer.
abstract  Component transform(Component cc)
          Transforms one Component object to another.
 Component transform(java.lang.Object key, Component cc)
          Transforms one Component object to another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentTransformer

public ComponentTransformer()
Method Detail

transform

public abstract Component transform(Component cc)
Transforms one Component object to another.

Parameters:
cc - the Component object to transform.
Returns:
the transformed Component object.

transform

public Component transform(java.lang.Object key,
                           Component cc)
Transforms one Component object to another. By default, this delegates to transform(cc);

Parameters:
key - the component key.
cc - the component.
Returns:
the transformed Component object.

seq

public final ComponentTransformer seq(ComponentTransformer ct)
Create a new ComponentTransformer by sequencing this transformer and another transformer. i.e., t1.seq(t2).transform(cc) is equivalent to t2.transform(t1.transform(cc)).

Parameters:
ct - the ComponentTransformer object to sequence with.
Returns:
the new ComponentTransformer object.