org.apache.ws.resource.handler.axis
Class ObjectDeserializer

java.lang.Object
  extended byorg.apache.ws.resource.handler.axis.ObjectDeserializer

public class ObjectDeserializer
extends java.lang.Object

Converts Java DOM Elements and SOAP Elements to Java objects. The objects must be compliant with the Axis Bean model, i.e. generated using the WSDL2Java tool from an XML Schema definition or must be of simple type.


Constructor Summary
ObjectDeserializer()
           
 
Method Summary
static boolean contains(javax.xml.soap.SOAPElement element, java.lang.Class javaClass)
          Checks to see whether the any element is of type javaClass.
static java.lang.Object deserialize(org.xml.sax.InputSource input, java.lang.Class javaClass)
          Deserializes input with XML into a Java object of the given type.
static java.lang.Object getFirstAsObject(org.apache.axis.encoding.AnyContentType any)
          Converts the first element of AnyContentType object into a Java object.
static java.lang.Object getFirstAsObject(org.apache.axis.encoding.AnyContentType any, java.lang.Class javaClass)
          Converts the first element of AnyContentType object into a Java object.
static java.lang.Object[] toObject(org.apache.axis.encoding.AnyContentType any)
          Converts a AnyContentType object into a set of Java objects.
static java.lang.Object[] toObject(org.apache.axis.encoding.AnyContentType any, java.lang.Class javaClass)
          Converts a AnyContentType object into a set of Java objects.
static java.lang.Object toObject(org.w3c.dom.Element element)
          Converts a DOM Element object into a Java object.
static java.lang.Object toObject(org.w3c.dom.Element element, java.lang.Class javaClass)
          Converts a DOM Element object into a Java object.
static java.lang.Object toObject(javax.xml.soap.SOAPElement element)
          Converts a SOAPElement object into a Java object.
static java.lang.Object[] toObject(javax.xml.soap.SOAPElement[] elements)
          Converts an array of SOAPElement objects into a set of Java objects.
static java.lang.Object[] toObject(javax.xml.soap.SOAPElement[] elements, java.lang.Class javaClass)
          Converts an array of SOAPElement objects into a set of Java objects.
static java.lang.Object toObject(javax.xml.soap.SOAPElement element, java.lang.Class javaClass)
          Converts a SOAPElement object into a Java object of specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectDeserializer

public ObjectDeserializer()
Method Detail

getFirstAsObject

public static java.lang.Object getFirstAsObject(org.apache.axis.encoding.AnyContentType any)
                                         throws org.apache.commons.lang.SerializationException
Converts the first element of AnyContentType object into a Java object. The type of the Java object will be determined from the xsi:type attribute of the specified element.

Throws:
org.apache.commons.lang.SerializationException
See Also:
toObject(SOAPElement, Class)

getFirstAsObject

public static java.lang.Object getFirstAsObject(org.apache.axis.encoding.AnyContentType any,
                                                java.lang.Class javaClass)
                                         throws org.apache.commons.lang.SerializationException
Converts the first element of AnyContentType object into a Java object.

Throws:
org.apache.commons.lang.SerializationException
See Also:
toObject(SOAPElement, Class)

contains

public static boolean contains(javax.xml.soap.SOAPElement element,
                               java.lang.Class javaClass)
Checks to see whether the any element is of type javaClass. The javaClass must be generated from an XML Schema representation. This operation could be seen as the instanceof equivalent for xsd:any types


deserialize

public static java.lang.Object deserialize(org.xml.sax.InputSource input,
                                           java.lang.Class javaClass)
                                    throws org.apache.commons.lang.SerializationException
Deserializes input with XML into a Java object of the given type.

Throws:
org.apache.commons.lang.SerializationException

toObject

public static java.lang.Object toObject(org.w3c.dom.Element element)
                                 throws org.apache.commons.lang.SerializationException
Converts a DOM Element object into a Java object. The type of the Java object will be determined from the xsi:type attribute of the specified element.
Note: This operation is slow as it converts the DOM Element into a string which then is deserialized into a Java object.

Throws:
org.apache.commons.lang.SerializationException

toObject

public static java.lang.Object toObject(org.w3c.dom.Element element,
                                        java.lang.Class javaClass)
                                 throws org.apache.commons.lang.SerializationException
Converts a DOM Element object into a Java object.
Note: This operation is slow as it converts the DOM Element into a string which then is deserialized into a Java object.

Throws:
org.apache.commons.lang.SerializationException

toObject

public static java.lang.Object toObject(javax.xml.soap.SOAPElement element)
                                 throws org.apache.commons.lang.SerializationException
Converts a SOAPElement object into a Java object. The type of the Java object will be determined from the xsi:type attribute of the specified element.

Throws:
org.apache.commons.lang.SerializationException
See Also:
toObject(SOAPElement, Class)

toObject

public static java.lang.Object toObject(javax.xml.soap.SOAPElement element,
                                        java.lang.Class javaClass)
                                 throws org.apache.commons.lang.SerializationException
Converts a SOAPElement object into a Java object of specified type. The class of the object must have been generated from an XML Schema, and thus contain the appropriate meta data to make deserialization possible.

Parameters:
element - SOAPElement to be converted
javaClass - Class containing meta data about how to deserialize the object or can be of a simple type such as Integer.
Returns:
Java object that maps to the XML representation of the input
Throws:
org.apache.commons.lang.SerializationException - if the input could not be deserialized into a Java type.

toObject

public static java.lang.Object[] toObject(javax.xml.soap.SOAPElement[] elements)
                                   throws org.apache.commons.lang.SerializationException
Converts an array of SOAPElement objects into a set of Java objects. The type of the Java object will be determined from the xsi:type attribute of the specified element.

Throws:
org.apache.commons.lang.SerializationException
See Also:
toObject(SOAPElement, Class)

toObject

public static java.lang.Object[] toObject(javax.xml.soap.SOAPElement[] elements,
                                          java.lang.Class javaClass)
                                   throws org.apache.commons.lang.SerializationException
Converts an array of SOAPElement objects into a set of Java objects.

Throws:
org.apache.commons.lang.SerializationException
See Also:
toObject(SOAPElement, Class)

toObject

public static java.lang.Object[] toObject(org.apache.axis.encoding.AnyContentType any)
                                   throws org.apache.commons.lang.SerializationException
Converts a AnyContentType object into a set of Java objects. The type of the Java object will be determined from the xsi:type attribute of the specified element.

Throws:
org.apache.commons.lang.SerializationException
See Also:
toObject(SOAPElement, Class)

toObject

public static java.lang.Object[] toObject(org.apache.axis.encoding.AnyContentType any,
                                          java.lang.Class javaClass)
                                   throws org.apache.commons.lang.SerializationException
Converts a AnyContentType object into a set of Java objects.

Throws:
org.apache.commons.lang.SerializationException
See Also:
toObject(SOAPElement, Class)


Copyright © 2004-2005 Apache Software Foundation. All Rights Reserved.