de.unihalle.informatik.Alida.dataio.provider.cmdline
Class ALDNativeDataIOCmdline

java.lang.Object
  extended by de.unihalle.informatik.Alida.dataio.provider.cmdline.ALDStandardizedDataIOCmdline
      extended by de.unihalle.informatik.Alida.dataio.provider.cmdline.ALDNativeDataIOCmdline
All Implemented Interfaces:
ALDDataIO, ALDDataIOCmdline

@ALDDataIOProvider
public class ALDNativeDataIOCmdline
extends ALDStandardizedDataIOCmdline

DataIO provider for primitive datatypes, Java wrapper types, and arrays (1D and 2D) from comamand line. As this provider extends ALDStandardizedDataIOCmdline it implements the Alida syntax conventions.

Author:
moeller

Field Summary
 
Fields inherited from class de.unihalle.informatik.Alida.dataio.provider.cmdline.ALDStandardizedDataIOCmdline
DERIVEDCLASS_CHAR, FILEIO_CHAR
 
Constructor Summary
ALDNativeDataIOCmdline()
           
 
Method Summary
 java.lang.String formatAsString(java.lang.Object obj)
          Returns the string representations of this object This method is assumed to directly format the obj into the string return and make no prior interpretation regarding a file to be used.
 java.lang.Object parse(java.lang.reflect.Field field, java.lang.Class<?> cl, java.lang.String valueString)
          Method to parse native data from a string.
 java.util.Collection<java.lang.Class<?>> providedClasses()
          Interface method to announce all classes handled by this provider.
 
Methods inherited from class de.unihalle.informatik.Alida.dataio.provider.cmdline.ALDStandardizedDataIOCmdline
formatAsString, getValueStringFromFile, readData, writeData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ALDNativeDataIOCmdline

public ALDNativeDataIOCmdline()
Method Detail

formatAsString

public java.lang.String formatAsString(java.lang.Object obj)
Description copied from class: ALDStandardizedDataIOCmdline
Returns the string representations of this object This method is assumed to directly format the obj into the string return and make no prior interpretation regarding a file to be used.

Specified by:
formatAsString in class ALDStandardizedDataIOCmdline
Parameters:
obj - object to format
Returns:
string representations of the object

parse

public java.lang.Object parse(java.lang.reflect.Field field,
                              java.lang.Class<?> cl,
                              java.lang.String valueString)
Method to parse native data from a string.

Note that the field argument is ignored here.

The clpassed to the method should contain the class which is to be returned. If it is null, null is returned. Likewise if something else goes wrong, the return value is null.

Note that 1D arrays have to be encoded in one of the following ways, i.e. with or without enclosing brackets:

For arrays containing only a single element using brackets is obligatory.

2D arrays have to be encoded as follows:

Specified by:
parse in class ALDStandardizedDataIOCmdline
Parameters:
field - Field of object to be returned
cl - Class of object to be returned.
valueString - Source from where to read data (e.g. a filename).
Returns:
Object read from valueString
See Also:
ALDDataIOManagerCmdline

providedClasses

public java.util.Collection<java.lang.Class<?>> providedClasses()
Description copied from interface: ALDDataIO
Interface method to announce all classes handled by this provider.

Returns:
Collection of classes provided