fipaos.util
Class XMLDataBinding


public class XMLDataBinding


Field Summary
 final static StringENHDRA_PACKAGE_HEADER_END
           
 final static StringENHDRA_PACKAGE_HEADER_START
           
 final static StringXML_HEADER_END
           
 final static StringXML_HEADER_START
           

Method Summary
 static ObjectcloneDataboundObject(Object obj)
          Create a completely distinct clone of a data bound object by marshalling it to a String and then unmarshalling it back into a new databound object.
 static Stringmarshall(Object obj, boolean strip_enhydra_tags)
          Marshalls a Data-Binding compatible object into an XML instance document
 static Stringmarshall(Object obj)
          Marshalls a Data-Binding compatible object into an XML instance document
 static voidmarshallFile(Object obj, String filename)
          Marshalls a Data-Binding compatible object into an XML instance document and saves the document into a file
 static voidmarshallFile(Object obj, File file)
          Marshalls a Data-Binding compatible object into an XML instance document and saves the document into a file
 static Objectunmarshall(String xml)
          Unmarshalls a string back into a Data-Binding object
 static Objectunmarshall(String xml, String default_package)
          Unmarshalls a string back into a Data-Binding object, and inserts Enhydra specific tags back into XML if necessary
 static ObjectunmarshallFile(String filename)
          Unmarshalls an XML document in a file back into a Data-Binding object
 static ObjectunmarshallFile(File file)
          Unmarshalls a file back into a Data-Binding object
 static StringzeusMarshall(Object obj)
          Marshall the given Object using the Zeus marshaller
 static ObjectzeusUnmarshall(String xml, String def_package)
          Unmarshall the given XML using the Zeus marshaller

Field Detail

ENHDRA_PACKAGE_HEADER_END

public final static String ENHDRA_PACKAGE_HEADER_END

ENHDRA_PACKAGE_HEADER_START

public final static String ENHDRA_PACKAGE_HEADER_START

XML_HEADER_END

public final static String XML_HEADER_END

XML_HEADER_START

public final static String XML_HEADER_START
Method Detail

cloneDataboundObject

public static Object cloneDataboundObject(Object obj)
throws java.io.IOException,
org.jdom.JDOMException
Create a completely distinct clone of a data bound object by marshalling it to a String and then unmarshalling it back into a new databound object.
Parameters:
obj. - The object to clone.
Returns: Object. An exact copy of obj.

marshall

public static String marshall(Object obj, boolean strip_enhydra_tags)
throws java.io.IOException
Marshalls a Data-Binding compatible object into an XML instance document
Parameters:
obj - The Object to be marshalled
strip_enhydra_tags - Indicates if Enhydra specific tags should be removed
Returns: A String containing the XML instance document

marshall

public static String marshall(Object obj)
throws java.io.IOException
Marshalls a Data-Binding compatible object into an XML instance document
Parameters:
obj - The Object to be marshalled
Returns: A String containing the XMLhjkhjkhjkhjk instance document

marshallFile

public static void marshallFile(Object obj, String filename)
throws java.io.IOException
Marshalls a Data-Binding compatible object into an XML instance document and saves the document into a file
Parameters:
obj - The Object to be marshalled
filename - The file to save into

marshallFile

public static void marshallFile(Object obj, File file)
throws java.io.IOException
Marshalls a Data-Binding compatible object into an XML instance document and saves the document into a file
Parameters:
obj - The Object to be marshalled
file - The file to save into

unmarshall

public static Object unmarshall(String xml)
throws java.io.IOException,
org.jdom.JDOMException
Unmarshalls a string back into a Data-Binding object
Parameters:
xml - The String to be unmarshalled
Returns: The reconstructed object

unmarshall

public static Object unmarshall(String xml, String default_package)
throws java.io.IOException,
org.jdom.JDOMException
Unmarshalls a string back into a Data-Binding object, and inserts Enhydra specific tags back into XML if necessary
Parameters:
xml - The String to be unmarshalled
default_package - Default package to find objects to create to represent the XML content
Returns: The reconstructed object

unmarshallFile

public static Object unmarshallFile(String filename)
throws java.io.IOException,
org.jdom.JDOMException
Unmarshalls an XML document in a file back into a Data-Binding object
Parameters:
filename - The File to be unmarshalled
Returns: The reconstructed object

unmarshallFile

public static Object unmarshallFile(File file)
throws java.io.IOException,
org.jdom.JDOMException
Unmarshalls a file back into a Data-Binding object
Parameters:
file - The String to be unmarshalled
Returns: The reconstructed object

zeusMarshall

public static String zeusMarshall(Object obj)
throws java.io.IOException
Marshall the given Object using the Zeus marshaller
Parameters:
obj - Object to marshall
Returns: The XML document representing the Object

zeusUnmarshall

public static Object zeusUnmarshall(String xml, String def_package)
throws java.io.IOException
Unmarshall the given XML using the Zeus marshaller
Parameters:
xml - XML document to unmarshall
def_package - Default package to look for classes to unmarshall the XML into
Returns: An object representing the XML

Association Links

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String