public abstract class ParametersTransformerImpl extends java.lang.Object implements ParametersTransformer
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
STANDARD_INPUT_SYMBOL
Symbol that signals that a file should be read from the standard
input.
|
| Constructor and Description |
|---|
ParametersTransformerImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected <T> ParameterTransformation<T> |
addTransformation(java.lang.Class<T> klass,
ParameterTransformation<T> transformation)
Adds a transformation.
|
<T> ParameterTransformation<T> |
getTransformation(java.lang.Class<T> klass)
Gets the transformation that can transform objects of the given type.
|
java.lang.String |
getTransformationDescription(java.lang.Class<?> klass)
Gets the description of the transformation for the given klass.
|
java.lang.Object |
transform(java.lang.String arg,
java.lang.Class<?> klass)
Transforms a parameter string to an object of a specific type.
|
java.lang.Object |
transformStream(java.io.InputStream istr,
java.lang.Class<?> klass)
Transforms the contents read from the given stream to an object of a
specific type.
|
java.lang.Object |
transformString(java.lang.String arg,
java.lang.Class<?> klass)
Transforms a parameter string containing the raw parameter value to
an object of a specific type.
|
public static final java.lang.String STANDARD_INPUT_SYMBOL
protected <T> ParameterTransformation<T> addTransformation(java.lang.Class<T> klass, ParameterTransformation<T> transformation)
T - the type of the resulting objectklass - the class of the resulting objecttransformation - the actual transformationpublic <T> ParameterTransformation<T> getTransformation(java.lang.Class<T> klass)
ParametersTransformergetTransformation in interface ParametersTransformerT - the type of the object the transformation transformsklass - the class of the object the transformation transformspublic java.lang.String getTransformationDescription(java.lang.Class<?> klass)
throws NoSuchTransformationException
ParametersTransformergetTransformationDescription in interface ParametersTransformerklass - the type of the object the transformation transformsNoSuchTransformationException - When no suitable transformation is availablepublic java.lang.Object transform(java.lang.String arg,
java.lang.Class<?> klass)
throws ModuleException
ParametersTransformertransform in interface ParametersTransformerarg - the parameter stringklass - the type of the object the parameter string should be
transformed toModuleException - When no suitable transformation is availableAptParameterTransformation.fileSource()public java.lang.Object transformString(java.lang.String arg,
java.lang.Class<?> klass)
throws ModuleException
ParametersTransformertransformString in interface ParametersTransformerarg - the parameter stringklass - the type of the object the parameter string should be
transformed toModuleException - When no suitable transformation is availablepublic java.lang.Object transformStream(java.io.InputStream istr,
java.lang.Class<?> klass)
throws ModuleException
ParametersTransformerParametersTransformer.transformString(String, Class).transformStream in interface ParametersTransformeristr - input stream to readklass - the type of the object the parameter string should be
transformed toModuleException - When no suitable transformation is available