Package net.sf.jguiraffe.transform
Class DummyTransformer
- java.lang.Object
-
- net.sf.jguiraffe.transform.DummyTransformer
-
- All Implemented Interfaces:
Transformer
,Validator
public class DummyTransformer extends Object implements Validator, Transformer
This class provides dummy implementations for the
Transformer
and theValidator
interfaces.Validation is implemented by always returning a validation result object indicating a successful validation. Transformation is implemented as a noop, by simply returning the passed in object. The services of this class can be obtained using a singleton instance.
- Version:
- $Id: DummyTransformer.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description DummyTransformer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DummyTransformer
getInstance()
Returns the singleton instance of this class.ValidationResult
isValid(Object o, TransformerContext ctx)
Performs validation.Object
transform(Object o, TransformerContext ctx)
Transforms the passed in object.
-
-
-
Method Detail
-
isValid
public ValidationResult isValid(Object o, TransformerContext ctx)
Performs validation. Always returns a positive result.
-
transform
public Object transform(Object o, TransformerContext ctx)
Transforms the passed in object. This implementation simply returns the same object.- Specified by:
transform
in interfaceTransformer
- Parameters:
o
- the object to be transformedctx
- the transformer context (ignored)- Returns:
- the resulting object
-
getInstance
public static DummyTransformer getInstance()
Returns the singleton instance of this class.- Returns:
- the shared instance
-
-