public class ALDDataIOManagerXmlbeans extends ALDDataIOManager
It does its work in collaboration with ALDDataIOXmlbeans
.
Modifier and Type | Field and Description |
---|---|
private boolean |
allowAdditionalFields
If true additional fields/variables and so on should be tolerated by providers
|
private boolean |
doHistory
If true writeData should try to write the history to file
if the object itself is written to a file
|
(package private) static ALDDataIOManagerXmlbeans |
instance
The singleton instance of this class
|
debug, mapTable
Modifier | Constructor and Description |
---|---|
private |
ALDDataIOManagerXmlbeans()
private constructor
|
Modifier and Type | Method and Description |
---|---|
static ALDDataIOManagerXmlbeans |
getInstance()
Return the single instance of this class
|
boolean |
isAllowAdditionalFields() |
boolean |
isDoHistory() |
static de.unihalle.informatik.Alida_xml.ALDXMLObjectType |
parseXml(File file,
Class<?> clazz)
Parse a
ALDXMLObjectType from a file using xmlbeans |
Object |
readData(Field field,
Class<?> cl,
de.unihalle.informatik.Alida_xml.ALDXMLObjectType aldXmlObject)
Reads data of given class from a specified source.
|
static Object |
readXml(File file,
Class<?> clazz)
Read Object from a file using xmlbeans providers
|
static Object |
readXml(String filename,
Class<?> clazz)
Read Object from a file using xmlbeans providers
|
void |
setAllowAdditionalFields(boolean allowAdditionalFields) |
void |
setDoHistory(boolean doHistory) |
de.unihalle.informatik.Alida_xml.ALDXMLObjectType |
writeData(Object obj)
Writes data to the specified location.
|
static void |
writeXml(File file,
Object obj)
Write the object to a file using xmlbeans providers
|
static void |
writeXml(String filename,
Object obj)
Write to object to a file using xmlbeans providers
|
getProvider, getProviderMap, initMapTable
private boolean doHistory
private boolean allowAdditionalFields
static final ALDDataIOManagerXmlbeans instance
public static ALDDataIOManagerXmlbeans getInstance()
public Object readData(Field field, Class<?> cl, de.unihalle.informatik.Alida_xml.ALDXMLObjectType aldXmlObject) throws ALDDataIOManagerException, ALDDataIOProviderException
field
and cl
are non-null, the class defined in field
is used
and cl
ignored.
If one of field or
cl
is null, the other non null argument will be used.
Some objects can only be read if field
is supplied, e.g. Collections.
The aldXmlObject
is used to actually read the data. The interpretation is
specific to the class to be read and defined by the corresponding provider class.
As a minimum this xml object contains the class name of the object represented.
field
- field of object to be returned.cl
- Class of data to be read.aldXmlObject
- xml object to read data from.ALDDataIOManagerException
ALDDataIOProviderException
public de.unihalle.informatik.Alida_xml.ALDXMLObjectType writeData(Object obj) throws ALDDataIOManagerException, ALDDataIOProviderException
obj
- Object to write.obj
ALDDataIOManagerException
ALDDataIOProviderException
public boolean isDoHistory()
public void setDoHistory(boolean doHistory)
doHistory
- the writeHistory to setpublic boolean isAllowAdditionalFields()
public void setAllowAdditionalFields(boolean allowAdditionalFields)
allowAdditionalFields
- the allowAdditionalFields to setpublic static void writeXml(String filename, Object obj) throws ALDDataIOProviderException, ALDDataIOManagerException
filename
- obj
- ALDDataIOProviderException
ALDDataIOManagerException
public static void writeXml(File file, Object obj) throws ALDDataIOProviderException, ALDDataIOManagerException
file
- obj
- ALDDataIOProviderException
ALDDataIOManagerException
public static Object readXml(String filename, Class<?> clazz) throws org.apache.xmlbeans.XmlException, ALDDataIOManagerException, ALDDataIOProviderException
filename
- clazz
- org.apache.xmlbeans.XmlException
IOException
ALDDataIOManagerException
ALDDataIOProviderException
public static Object readXml(File file, Class<?> clazz) throws org.apache.xmlbeans.XmlException, ALDDataIOManagerException, ALDDataIOProviderException
file
- clazz
- org.apache.xmlbeans.XmlException
IOException
ALDDataIOManagerException
ALDDataIOProviderException
public static de.unihalle.informatik.Alida_xml.ALDXMLObjectType parseXml(File file, Class<?> clazz) throws org.apache.xmlbeans.XmlException, ALDDataIOProviderException
ALDXMLObjectType
from a file using xmlbeansfile
- clazz
- ALDXMLObjectType
read from XML file.org.apache.xmlbeans.XmlException
IOException
ALDDataIOManagerException
ALDDataIOProviderException
Copyright © 2010–2021 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.