|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.molae.pipe.text.FormatTransformer
public final class FormatTransformer
A text format as a transformer.
| Constructor Summary | |
|---|---|
FormatTransformer(Format base)
Creates a new FormatTransformer based on the specified format. |
|
FormatTransformer(Format base,
boolean injective)
Creates a new FormatTransformer based on the specified format. |
|
| Method Summary | |
|---|---|
boolean |
isRetrievable(String input)
Returns the value specified in the constructor. |
Object |
retransform(String input)
Calls parseObject(String) of the underlying format. |
String |
toString()
Returns a string representation of the object. |
String |
transform(Object input)
Calls format(Object) of the underlying format. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FormatTransformer(Format base,
boolean injective)
base - the base formatinjective - indicates if this transformer is injective
for all objects except null
NullPointerException - base is null.public FormatTransformer(Format base)
base - the base format
NullPointerException - base is null.| Method Detail |
|---|
public String toString()
toString in class Objectpublic String transform(Object input)
format(Object) of the underlying format.
transform in interface TwoWayTransformer<Object,String>input - the object to be transformed, should be left unchanged
IllegalArgumentException - if the Format cannot format the type
of objectpublic Object retransform(String input)
parseObject(String) of the underlying format.
retransform in interface TwoWayTransformer<Object,String>input - the object for which the transformation origin is searched.
ClassCastException - if the input object is not a string
IllegalArgumentException - if a parsing exception occurredpublic boolean isRetrievable(String input)
isRetrievable in interface TwoWayTransformer<Object,String>input - the object for which the transformation origin is searched.
true if the origin of the specified object can
be calculated.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||