de.unihalle.informatik.Alida.dataio.provider.xmlbeans
Class ALDParametrizedClassDataIOXmlbeans

java.lang.Object
  extended by de.unihalle.informatik.Alida.dataio.provider.xmlbeans.ALDStandardizedDataIOXmlbeans
      extended by de.unihalle.informatik.Alida.dataio.provider.xmlbeans.ALDParametrizedClassDataIOXmlbeans
All Implemented Interfaces:
ALDDataIO, ALDDataIOXmlbeans

@ALDDataIOProvider
public class ALDParametrizedClassDataIOXmlbeans
extends ALDStandardizedDataIOXmlbeans

DataIO provider for parametrized classes and operators from command line. As this provider extends ALDStandardizedDataIOXmlbeans 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 operators 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.

Author:
posch

Constructor Summary
ALDParametrizedClassDataIOXmlbeans()
           
 
Method Summary
static LinkedList<String> lookupParameternames(ALDOperator op, String pre)
          Lookup all parameter names of the operator with prefix pre.
 Collection<Class<?>> providedClasses()
          Interface method to announce class for which IO is provided for
 Object readData(Field field, Class<?> cl, de.unihalle.informatik.Alida_xml.ALDXMLObjectType xmlObject, Object obj)
          Xmlbeans provider for parametrized classes and ALDOperators.
 de.unihalle.informatik.Alida_xml.ALDXMLObjectType writeData(Object obj)
          Transient members are not written.
 
Methods inherited from class de.unihalle.informatik.Alida.dataio.provider.xmlbeans.ALDStandardizedDataIOXmlbeans
readData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ALDParametrizedClassDataIOXmlbeans

public ALDParametrizedClassDataIOXmlbeans()
Method Detail

providedClasses

public Collection<Class<?>> providedClasses()
Interface method to announce class for which IO is provided for

Returns:
Collection of classes provided

readData

public Object readData(Field field,
                       Class<?> cl,
                       de.unihalle.informatik.Alida_xml.ALDXMLObjectType xmlObject,
                       Object obj)
                throws ALDDataIOProviderException,
                       ALDDataIOManagerException
Xmlbeans provider for parametrized classes and ALDOperators.

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.

The readData method of the provider for the class of the member variable is used to read the objects value from value.

Specified by:
readData in class ALDStandardizedDataIOXmlbeans
Parameters:
field -
cl -
valueString -
obj - if a ALDOperator is to be parse this may an instance of this class, otherwise a new instance is created. Ignored when parsing a parametrized class
Returns:
Throws:
ALDDataIOProviderException
ALDDataIOManagerException
See Also:
ALDDataIOManagerXmlbeans

writeData

public de.unihalle.informatik.Alida_xml.ALDXMLObjectType writeData(Object obj)
                                                            throws ALDDataIOProviderException,
                                                                   ALDDataIOManagerException
Transient members are not written.

For parametrized classes annotated members are written.

For operators all OUT and INOUT parameters are written.

Parameters:
obj - Object to be saved.
Returns:
obj as an ALDXMLObjectType
Throws:
ALDDataIOProviderException
ALDDataIOManagerException

lookupParameternames

public static LinkedList<String> lookupParameternames(ALDOperator op,
                                                      String pre)
Lookup all parameter names of the operator with prefix pre. If one of the parameters exactly matches pre only this single parameter name is returned.

Returns:
All parameter names with prefix pre or the single parameter exactly matching pre


Copyright © 2010–2014 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.