|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.dataio.ALDDataIOManager
de.unihalle.informatik.Alida.dataio.ALDDataIOManagerXmlbeans
public class ALDDataIOManagerXmlbeans
This class implements a DataIO manager for reading/writing from xml using xmlbeans. For reading and writing, it essentially looks up the correct provider for xml using the method of its super class and invokes its method.
It does its work in collaboration with ALDDataIOXmlbeans
.
Field Summary | |
---|---|
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 |
Fields inherited from class de.unihalle.informatik.Alida.dataio.ALDDataIOManager |
---|
debug, mapTable |
Constructor Summary | |
---|---|
private |
ALDDataIOManagerXmlbeans()
private constructor |
Method Summary | |
---|---|
static ALDDataIOManagerXmlbeans |
getInstance()
Return the single instance of this class |
boolean |
isAllowAdditionalFields()
|
boolean |
isDoHistory()
|
java.lang.Object |
readData(java.lang.reflect.Field field,
java.lang.Class<?> cl,
de.unihalle.informatik.Alida_xml.ALDXMLObjectType xmlObject)
Reads data of given class from a specified source. |
static java.lang.Object |
readXml(java.io.File file,
java.lang.Class<?> clazz)
Read Object from a file using xmlbeans providers |
static java.lang.Object |
readXml(java.lang.String filename,
java.lang.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(java.lang.Object obj)
Writes data to the specified location. |
static void |
writeXml(java.io.File file,
java.lang.Object obj)
Write to object to a file using xmlbeans providers |
static void |
writeXml(java.lang.String filename,
java.lang.Object obj)
Write to object to a file using xmlbeans providers |
Methods inherited from class de.unihalle.informatik.Alida.dataio.ALDDataIOManager |
---|
getProvider, getProviderMap, initMapTable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean allowAdditionalFields
private boolean doHistory
static final ALDDataIOManagerXmlbeans instance
Constructor Detail |
---|
private ALDDataIOManagerXmlbeans()
Method Detail |
---|
public static ALDDataIOManagerXmlbeans getInstance()
public boolean isAllowAdditionalFields()
public boolean isDoHistory()
public java.lang.Object readData(java.lang.reflect.Field field, java.lang.Class<?> cl, de.unihalle.informatik.Alida_xml.ALDXMLObjectType xmlObject) 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 xmlObject
is used to actually read the data. The interpretation is
specific to the class to be read and defined by the corresponding provider class.
field
- field of object to be returned.cl
- Class of data to be read.xmlObject
- xml object to read data from.
ALDDataIOManagerException
ALDDataIOProviderException
public static java.lang.Object readXml(java.io.File file, java.lang.Class<?> clazz) throws org.apache.xmlbeans.XmlException, ALDDataIOManagerException, ALDDataIOProviderException
filename
- clazz
-
org.apache.xmlbeans.XmlException
java.io.IOException
ALDDataIOManagerException
ALDDataIOProviderException
public static java.lang.Object readXml(java.lang.String filename, java.lang.Class<?> clazz) throws org.apache.xmlbeans.XmlException, ALDDataIOManagerException, ALDDataIOProviderException
filename
- clazz
-
org.apache.xmlbeans.XmlException
java.io.IOException
ALDDataIOManagerException
ALDDataIOProviderException
public void setAllowAdditionalFields(boolean allowAdditionalFields)
allowAdditionalFields
- the allowAdditionalFields to setpublic void setDoHistory(boolean doHistory)
writeHistory
- the writeHistory to setpublic de.unihalle.informatik.Alida_xml.ALDXMLObjectType writeData(java.lang.Object obj) throws ALDDataIOManagerException, ALDDataIOProviderException
obj
- Object to write.
ALDDataIOManagerException
ALDDataIOProviderException
public static void writeXml(java.io.File file, java.lang.Object obj) throws ALDDataIOProviderException, ALDDataIOManagerException
file
- obj
-
ALDDataIOProviderException
ALDDataIOManagerException
public static void writeXml(java.lang.String filename, java.lang.Object obj) throws ALDDataIOProviderException, ALDDataIOManagerException
filename
- obj
-
ALDDataIOProviderException
ALDDataIOManagerException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |