net.sf.japaki.basic
Class FixedTargetTransformer<T>

java.lang.Object
  extended by net.sf.japaki.basic.FixedTargetTransformer<T>
All Implemented Interfaces:
TwoWayTransformer<Object,T>

public class FixedTargetTransformer<T>
extends Object
implements TwoWayTransformer<Object,T>

A transformer that always returns a constant value.


Constructor Summary
protected FixedTargetTransformer(T target)
          Creates a new transformer with the given target value.
 
Method Summary
 boolean isRetrievable(T input)
          Returns false.
static
<T> TwoWayTransformer<Object,T>
newInstance(T target)
          Creates a new transformer with the given target value.
 Object retransform(T input)
          Not implemented.
 T transform(Object input)
          Always returns the predefined target value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedTargetTransformer

protected FixedTargetTransformer(T target)
Creates a new transformer with the given target value.

Parameters:
target - the fixed target value for the new transformer
Method Detail

newInstance

public static <T> TwoWayTransformer<Object,T> newInstance(T target)
Creates a new transformer with the given target value.

Parameters:
target - the fixed target value for the new transformer
Returns:
the created transformer

transform

public T transform(Object input)
Always returns the predefined target value.

Specified by:
transform in interface TwoWayTransformer<Object,T>
Parameters:
input - ignored
Returns:
the fixed target

retransform

public Object retransform(T input)
Not implemented.

Specified by:
retransform in interface TwoWayTransformer<Object,T>
Parameters:
input - the object for which the transformation origin is searched.
Returns:
the transformation origin of the specified object.
Throws:
UnsupportedOperationException - always

isRetrievable

public boolean isRetrievable(T input)
Returns false.

Specified by:
isRetrievable in interface TwoWayTransformer<Object,T>
Parameters:
input - the object for which the transformation origin is searched.
Returns:
always false