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

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

@ALDDataIOProvider
public class ALDCollectionDataIOCmdline
extends ALDStandardizedDataIOCmdline

DataIO provider for collections from command line. As this provider extends ALDStandardizedDataIOCmdline it implements the Alida syntax conventions.

Author:
posch

Field Summary
 
Fields inherited from class de.unihalle.informatik.Alida.dataio.provider.cmdline.ALDStandardizedDataIOCmdline
DERIVEDCLASS_CHAR, FILEIO_CHAR
 
Constructor Summary
ALDCollectionDataIOCmdline()
           
 
Method Summary
 java.lang.String formatAsString(java.lang.Object obj)
          Returns the string representations of collection.
 java.lang.Object parse(java.lang.reflect.Field field, java.lang.Class<?> cl, java.lang.String valueString)
          Returns a collection instantiated from valueString.
 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, readData, writeData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ALDCollectionDataIOCmdline

public ALDCollectionDataIOCmdline()
Method Detail

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

parse

public java.lang.Object parse(java.lang.reflect.Field field,
                              java.lang.Class<?> cl,
                              java.lang.String valueString)
                       throws ALDDataIOProviderException,
                              ALDDataIOManagerException
Returns a collection instantiated from valueString. valueString is assume to contain a comma separated list of nested valueString for each element of the collection enclosed in matching square brackets, e.g. [1.2 , 2.2 , 3.1]. The class of the elements of the collection is determined using ALDCollectionDataIOHelper.lookupType(java.lang.reflect.Field).

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:
Collection read from valueString.
Throws:
ALDDataIOProviderException
ALDDataIOManagerException
See Also:
ALDDataIOManagerCmdline

formatAsString

public java.lang.String formatAsString(java.lang.Object obj)
                                throws ALDDataIOManagerException,
                                       ALDDataIOProviderException
Returns the string representations of collection. The format is a specified for parsing.

Specified by:
formatAsString in class ALDStandardizedDataIOCmdline
Parameters:
obj - object to format
Returns:
string representations of the object
Throws:
ALDDataIOManagerException
ALDDataIOProviderException
See Also:
parse(Field,Class,String)


Copyright © 2010-2014 Martin Luther University Halle-Wittenberg. All Rights Reserved.