de.unihalle.informatik.Alida.dataio.provider.cmdline
Class ALDCollectionDataIOCmdline
java.lang.Object
de.unihalle.informatik.Alida.dataio.provider.cmdline.ALDStandardizedDataIOCmdline
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALDCollectionDataIOCmdline
public ALDCollectionDataIOCmdline()
providedClasses
public Collection<Class<?>> providedClasses()
- Description copied from interface:
ALDDataIO
- Interface method to announce all classes handled by this provider.
- Returns:
- Collection of classes provided
parse
public Object parse(Field field,
Class<?> cl,
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 returnedcl
- 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 String formatAsString(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, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.