org.globus.wsrf.utils
Class AnyHelper

java.lang.Object
  |
  +--org.globus.wsrf.utils.AnyHelper

public class AnyHelper
extends Object

The AnyHelper is a utility that provides common functions for working with MessageElement and beans with AnyContentType class. Do not used this class for serialization or deserialization of objects. Use ObjectSerializer and ObjectDeserializer for that purposes instead.


Constructor Summary
AnyHelper()
           
 
Method Summary
static Element getFirstAsElement(AnyContentType any)
          Converts type containing any element to a single DOM Element.
static Element getFirstParentAsElement(AnyContentType any)
          Converts type containing any element to a single DOM Element, representing the parent MessageElement.
static String getFirstParentAsString(AnyContentType any)
          Converts type containing any element to a String, representing the parent MessageElement.
static MessageElement getParent(AnyContentType any)
           
static MessageElement getParent(MessageElement element)
           
static MessageElement getParent(MessageElement[] elements)
           
static void setAny(AnyContentType object, List values)
           
static void setAny(AnyContentType object, SOAPElement value)
           
static void setAny(AnyContentType object, SOAPElement[] values)
           
static MessageElement toAny(Object obj)
          Populates a SOAP MessageElement with an arbitrary object.
static MessageElement[] toAnyArray(Element element)
          Populates a SOAP MessageElement array with a single DOM element.
static MessageElement[] toAnyArray(Object obj)
          Populates a SOAP MessageElement array with a single object.
static MessageElement[] toAnyArray(Object[] obj)
          Populates a SOAP MessageElement array with an array of arbitrary objects.
static MessageElement toAnyTypeElement(Object obj)
          Populates a SOAP MessageElement with an arbitrary object, and wraps it inside of a value element with an xsi:type attribute.
static Element[] toElement(AnyContentType any)
          Converts type containing any element to an array of DOM Elements.
static Element toElement(MessageElement element)
          Converts a SOAP MessageElement to a DOM Element representation
static Element[] toElement(MessageElement[] elements)
          Array version of toElement
static String toSingleString(AnyContentType any)
           
static String toSingleString(MessageElement[] elements)
           
static String toString(MessageElement element)
          Converts a SOAP MessageElement to an XML String representation
static String[] toString(MessageElement[] elements)
          Array version of toString
static MessageElement[] toText(Object obj)
          Populates a SOAP MessageElement array with a single object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnyHelper

public AnyHelper()
Method Detail

toText

public static MessageElement[] toText(Object obj)
Populates a SOAP MessageElement array with a single object.
Parameters:
obj - object to be serialized as a text node
Returns:
content of any element as a SOAP MessageElement array

toAnyArray

public static MessageElement[] toAnyArray(Object[] obj)
Populates a SOAP MessageElement array with an array of arbitrary objects.
Parameters:
obj - array of objects to be serialized in the any element
Returns:
content of any element as a SOAP MessageElement array

toAnyArray

public static MessageElement[] toAnyArray(Object obj)
Populates a SOAP MessageElement array with a single object.
Parameters:
obj - object to be serialized in the any element
Returns:
content of any element as a SOAP MessageElement array

toAnyArray

public static MessageElement[] toAnyArray(Element element)
Populates a SOAP MessageElement array with a single DOM element.
Parameters:
element - element to be inserted in the any element
Returns:
content of any element as a SOAP MessageElement array

toAnyTypeElement

public static MessageElement toAnyTypeElement(Object obj)
Populates a SOAP MessageElement with an arbitrary object, and wraps it inside of a value element with an xsi:type attribute. This is similar to using the xsd:any in the same way you would use xsd:anyType objects.
Parameters:
obj - object to be serialized in the any element
Returns:
content of any element as a SOAP MessageElement

toAny

public static MessageElement toAny(Object obj)
Populates a SOAP MessageElement with an arbitrary object.
Parameters:
obj - object to be serialized in the any element.
Returns:
content of any element as a SOAP MessageElement
See Also:
toAnyTypeElement(Object)

getParent

public static MessageElement getParent(MessageElement element)

getParent

public static MessageElement getParent(MessageElement[] elements)

getParent

public static MessageElement getParent(AnyContentType any)

setAny

public static void setAny(AnyContentType object,
                          SOAPElement value)

setAny

public static void setAny(AnyContentType object,
                          SOAPElement[] values)

setAny

public static void setAny(AnyContentType object,
                          List values)

toString

public static String toString(MessageElement element)
                       throws Exception
Converts a SOAP MessageElement to an XML String representation
Parameters:
element - SOAP MessageElement to be converted
Returns:
String in XML format representing the input

toString

public static String[] toString(MessageElement[] elements)
                         throws Exception
Array version of toString

toSingleString

public static String toSingleString(MessageElement[] elements)
                             throws Exception

toSingleString

public static String toSingleString(AnyContentType any)
                             throws Exception

getFirstParentAsString

public static String getFirstParentAsString(AnyContentType any)
                                     throws Exception
Converts type containing any element to a String, representing the parent MessageElement.
See Also:
toString(MessageElement element)

toElement

public static Element toElement(MessageElement element)
                         throws Exception
Converts a SOAP MessageElement to a DOM Element representation
Parameters:
element - SOAP MessageElement to be converted
Returns:
DOM Element representing the input
Throws:
Exception - if the DOM Element could not be created

toElement

public static Element[] toElement(MessageElement[] elements)
                           throws Exception
Array version of toElement

toElement

public static Element[] toElement(AnyContentType any)
                           throws Exception
Converts type containing any element to an array of DOM Elements.
See Also:
toElement(MessageElement element)

getFirstParentAsElement

public static Element getFirstParentAsElement(AnyContentType any)
                                       throws Exception
Converts type containing any element to a single DOM Element, representing the parent MessageElement.
See Also:
toElement(MessageElement element)

getFirstAsElement

public static Element getFirstAsElement(AnyContentType any)
                                 throws Exception
Converts type containing any element to a single DOM Element.
See Also:
toElement(MessageElement element)


Copyright © 1999-2003 University of Chicago and The University of Southern California. All rights reserved.