@ALDDataIOProvider public class ALDParametrizedClassDataIOCmdline extends ALDStandardizedDataIOCmdline
ALDStandardizedDataIOCmdline it
implements the Alida syntax conventions.
For parametrized classes reading is done only for parameters annotated
with ALDClassParameter.
Either all annotated parameters are written/formated or a
subset as specified by a format string.
For oeprators reading is done only for IN and INOUT parameters. Either all OUT and INPUT parameters are written/formated or a subset as specified by a format string.
DERIVEDCLASS_CHAR, FILEIO_CHAR| Constructor and Description |
|---|
ALDParametrizedClassDataIOCmdline() |
| Modifier and Type | Method and Description |
|---|---|
String |
formatAsString(Object obj)
Generic formatter to string of parametrized classes.
|
String |
formatAsString(Object obj,
String formatString)
Format all parameters of this parametrized class annotated
with
ALDClassParameter
into a string. |
static LinkedList<String> |
lookupParameternames(ALDOperator op,
String pre)
Lookup all parameter names of the operator with prefix
pre. |
Object |
parse(Field field,
Class<?> cl,
String valueString)
Parser for parametrized classes and ALDOperators.
|
Object |
parse(Field field,
Class<?> cl,
String valueString,
ALDOperator op)
Generic Parser for parametrized classes and ALDOperators.
|
Collection<Class<?>> |
providedClasses()
Interface method to announce class for which IO is provided for
|
readData, writeDatapublic Collection<Class<?>> providedClasses()
public Object parse(Field field, Class<?> cl, String valueString) throws ALDDataIOProviderException, ALDDataIOManagerException
ALDDataIOCmdline.
For parametrized classes each name has to be an annotated parameter.
For operators each name has to be an IN or INOUT parameter name of the operator and receives its value from
the valueString.
If the list of name=value pairs is empty, i.e. no parameters are to be parsed, the empty string is accepted, too.
parse in class ALDStandardizedDataIOCmdlinefield - Field of object to be returnedcl - Class of object to be returned.valueString - Source from where to read data (e.g. a filename).ALDDataIOProviderExceptionALDDataIOManagerExceptionALDDataIOManagerCmdlinepublic Object parse(Field field, Class<?> cl, String valueString, ALDOperator op) throws ALDDataIOProviderException, ALDDataIOManagerException
ALDDataIOCmdline.
For parametrized classes each name has to be an annotated parameter.
For operators each name has to be an IN or INOUT parameter name of the operator and receives its value from
the valueString.
If the list of name=value pairs is empty, i.e. no parameters are to be parsed, the empty string is accepted, too.
For the class of the object to be read see ALDDataIOCmdline.
As a valueString a comma separated list of name=value pairs enclosed in curly brackets
is expected. Each name has to be a member of the class or a super class which is annotated
with ALDClassParameter.
The readData method of the provider for the class of the member variable
is used to read the objects value from value.
field - cl - valueString - op - if a ALDOperator is to be parse this is an instance of this class. Ignored when parsing
a parametrized classALDDataIOProviderExceptionALDDataIOManagerExceptionpublic String formatAsString(Object obj, String formatString) throws ALDDataIOProviderException, ALDDataIOManagerException
ALDClassParameter
into a string.
If formatString starts with a curly bracket it is assume
to contained a comma seprated list of name=value pairs enclosed in a
matching curly brackets.
In this case, only the (annotated) members named in this list are formated where the value
is passed to the writeData of the dataIO provider handling the parameter's type.
In extension, is a name equals * all members non listed in the
formatString are formated using the value of this pair.
If formatString does not start with a curly bracket all annotated
members are formated.
formatAsString in class ALDStandardizedDataIOCmdlineobj - parametrized class to be formatedformatString - ALDDataIOProviderExceptionALDDataIOManagerExceptionpublic String formatAsString(Object obj) throws ALDDataIOProviderException, ALDDataIOManagerException
ALDClassParameter.formatAsString in class ALDStandardizedDataIOCmdlineobj - object to formatALDDataIOProviderExceptionALDDataIOManagerExceptionpublic static LinkedList<String> lookupParameternames(ALDOperator op, String pre)
pre.
If one of the parameters exactly matches pre only this single
parameter name is returned.pre or the single parameter
exactly matching preCopyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.