fipaos.util
Class XMLDataBinding

java.lang.Object
  |
  +--fipaos.util.XMLDataBinding

public class XMLDataBinding
extends java.lang.Object


Field Summary
static java.lang.String ENHDRA_PACKAGE_HEADER_END
           
static java.lang.String ENHDRA_PACKAGE_HEADER_START
           
static java.lang.String XML_HEADER_END
           
static java.lang.String XML_HEADER_START
           
 
Constructor Summary
XMLDataBinding()
           
 
Method Summary
static java.lang.Object cloneDataboundObject(java.lang.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 java.lang.String marshall(java.lang.Object obj)
          Marshalls a Data-Binding compatible object into an XML instance document
static java.lang.String marshall(java.lang.Object obj, boolean strip_enhydra_tags)
          Marshalls a Data-Binding compatible object into an XML instance document
static void marshallFile(java.lang.Object obj, java.io.File file)
          Marshalls a Data-Binding compatible object into an XML instance document and saves the document into a file
static void marshallFile(java.lang.Object obj, java.lang.String filename)
          Marshalls a Data-Binding compatible object into an XML instance document and saves the document into a file
static java.lang.Object unmarshall(java.lang.String xml)
          Unmarshalls a string back into a Data-Binding object
static java.lang.Object unmarshall(java.lang.String xml, java.lang.String default_package)
          Unmarshalls a string back into a Data-Binding object, and inserts Enhydra specific tags back into XML if necessary
static java.lang.Object unmarshallFile(java.io.File file)
          Unmarshalls a file back into a Data-Binding object
static java.lang.Object unmarshallFile(java.lang.String filename)
          Unmarshalls an XML document in a file back into a Data-Binding object
static java.lang.String zeusMarshall(java.lang.Object obj)
          Marshall the given Object using the Zeus marshaller
static java.lang.Object zeusUnmarshall(java.lang.String xml, java.lang.String def_package)
          Unmarshall the given XML using the Zeus marshaller
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENHDRA_PACKAGE_HEADER_START

public static final java.lang.String ENHDRA_PACKAGE_HEADER_START

ENHDRA_PACKAGE_HEADER_END

public static final java.lang.String ENHDRA_PACKAGE_HEADER_END

XML_HEADER_START

public static final java.lang.String XML_HEADER_START

XML_HEADER_END

public static final java.lang.String XML_HEADER_END
Constructor Detail

XMLDataBinding

public XMLDataBinding()
Method Detail

marshall

public static java.lang.String marshall(java.lang.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 java.lang.String marshall(java.lang.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(java.lang.Object obj,
                                java.lang.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(java.lang.Object obj,
                                java.io.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 java.lang.Object unmarshall(java.lang.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 java.lang.Object unmarshall(java.lang.String xml,
                                          java.lang.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

cloneDataboundObject

public static java.lang.Object cloneDataboundObject(java.lang.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.

unmarshallFile

public static java.lang.Object unmarshallFile(java.lang.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 java.lang.Object unmarshallFile(java.io.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

zeusUnmarshall

public static java.lang.Object zeusUnmarshall(java.lang.String xml,
                                              java.lang.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

zeusMarshall

public static java.lang.String zeusMarshall(java.lang.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