org.globus.wsrf.utils
Class AnyHelper

java.lang.Object
  extended by org.globus.wsrf.utils.AnyHelper

public class AnyHelper
extends java.lang.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.


Field Summary
private static org.globus.util.I18n i18n
           
private static org.apache.commons.logging.Log logger
           
 
Constructor Summary
AnyHelper()
           
 
Method Summary
static javax.xml.soap.SOAPElement findFirstElement(org.apache.axis.encoding.AnyContentType any, javax.xml.namespace.QName name)
          Finds first element with a given name in a list of SOAPElements of AnyContentType object.
static javax.xml.soap.SOAPElement findFirstElement(org.apache.axis.message.MessageElement[] elements, javax.xml.namespace.QName name)
          Finds first element with a given name in a list of SOAPElements.
static org.w3c.dom.Element getFirstAsElement(org.apache.axis.encoding.AnyContentType any)
          Converts type containing any element to a single DOM Element.
static org.w3c.dom.Element getFirstParentAsElement(org.apache.axis.encoding.AnyContentType any)
          Converts type containing any element to a single DOM Element, representing the parent MessageElement.
static java.lang.String getFirstParentAsString(org.apache.axis.encoding.AnyContentType any)
          Converts type containing any element to a String, representing the parent MessageElement.
static org.apache.axis.message.MessageElement getParent(org.apache.axis.encoding.AnyContentType any)
           
static org.apache.axis.message.MessageElement getParent(org.apache.axis.message.MessageElement element)
           
static org.apache.axis.message.MessageElement getParent(org.apache.axis.message.MessageElement[] elements)
           
static void setAny(org.apache.axis.encoding.AnyContentType object, java.util.List values)
           
static void setAny(org.apache.axis.encoding.AnyContentType object, javax.xml.soap.SOAPElement value)
           
static void setAny(org.apache.axis.encoding.AnyContentType object, javax.xml.soap.SOAPElement[] values)
           
static org.apache.axis.message.MessageElement toAny(java.lang.Object obj)
          Populates a SOAP MessageElement with an arbitrary object.
static org.apache.axis.message.MessageElement[] toAnyArray(org.w3c.dom.Element element)
          Populates a SOAP MessageElement array with a single DOM element.
static org.apache.axis.message.MessageElement[] toAnyArray(java.lang.Object obj)
          Populates a SOAP MessageElement array with a single object.
static org.apache.axis.message.MessageElement[] toAnyArray(java.lang.Object[] obj)
          Populates a SOAP MessageElement array with an array of arbitrary objects.
static org.apache.axis.message.MessageElement toAnyTypeElement(java.lang.Object obj)
          Populates a SOAP MessageElement with an arbitrary object, and wraps it inside of a value element with an xsi:type attribute.
static org.w3c.dom.Element[] toElement(org.apache.axis.encoding.AnyContentType any)
          Converts type containing any element to an array of DOM Elements.
static org.w3c.dom.Element toElement(org.apache.axis.message.MessageElement element)
          Converts a SOAP MessageElement to a DOM Element representation
static org.w3c.dom.Element[] toElement(org.apache.axis.message.MessageElement[] elements)
          Array version of toElement
static java.lang.String toSingleString(org.apache.axis.encoding.AnyContentType any)
           
static java.lang.String toSingleString(org.apache.axis.encoding.AnyContentType any, boolean pretty)
           
static java.lang.String toSingleString(org.apache.axis.message.MessageElement[] elements)
           
static java.lang.String toSingleString(org.apache.axis.message.MessageElement[] elements, boolean pretty)
           
static java.lang.String toString(org.apache.axis.message.MessageElement element)
          Converts a SOAP MessageElement to an XML String representation
static java.lang.String[] toString(org.apache.axis.message.MessageElement[] elements)
          Array version of toString
static org.apache.axis.message.MessageElement[] toText(java.lang.Object obj)
          Populates a SOAP MessageElement array with a single object.
static void write(java.io.Writer writer, org.apache.axis.message.MessageElement element)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static org.apache.commons.logging.Log logger

i18n

private static org.globus.util.I18n i18n
Constructor Detail

AnyHelper

public AnyHelper()
Method Detail

toText

public static org.apache.axis.message.MessageElement[] toText(java.lang.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 org.apache.axis.message.MessageElement[] toAnyArray(java.lang.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 org.apache.axis.message.MessageElement[] toAnyArray(java.lang.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 org.apache.axis.message.MessageElement[] toAnyArray(org.w3c.dom.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 org.apache.axis.message.MessageElement toAnyTypeElement(java.lang.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 org.apache.axis.message.MessageElement toAny(java.lang.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 org.apache.axis.message.MessageElement getParent(org.apache.axis.message.MessageElement element)

getParent

public static org.apache.axis.message.MessageElement getParent(org.apache.axis.message.MessageElement[] elements)

getParent

public static org.apache.axis.message.MessageElement getParent(org.apache.axis.encoding.AnyContentType any)

setAny

public static void setAny(org.apache.axis.encoding.AnyContentType object,
                          javax.xml.soap.SOAPElement value)

setAny

public static void setAny(org.apache.axis.encoding.AnyContentType object,
                          javax.xml.soap.SOAPElement[] values)

setAny

public static void setAny(org.apache.axis.encoding.AnyContentType object,
                          java.util.List values)

write

public static void write(java.io.Writer writer,
                         org.apache.axis.message.MessageElement element)
                  throws java.lang.Exception
Throws:
java.lang.Exception

toString

public static java.lang.String toString(org.apache.axis.message.MessageElement element)
                                 throws java.lang.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
Throws:
java.lang.Exception

toString

public static java.lang.String[] toString(org.apache.axis.message.MessageElement[] elements)
                                   throws java.lang.Exception
Array version of toString

Throws:
java.lang.Exception

toSingleString

public static java.lang.String toSingleString(org.apache.axis.message.MessageElement[] elements)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

toSingleString

public static java.lang.String toSingleString(org.apache.axis.message.MessageElement[] elements,
                                              boolean pretty)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

toSingleString

public static java.lang.String toSingleString(org.apache.axis.encoding.AnyContentType any)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

toSingleString

public static java.lang.String toSingleString(org.apache.axis.encoding.AnyContentType any,
                                              boolean pretty)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

getFirstParentAsString

public static java.lang.String getFirstParentAsString(org.apache.axis.encoding.AnyContentType any)
                                               throws java.lang.Exception
Converts type containing any element to a String, representing the parent MessageElement.

Throws:
java.lang.Exception
See Also:
toString(MessageElement element)

toElement

public static org.w3c.dom.Element toElement(org.apache.axis.message.MessageElement element)
                                     throws java.lang.Exception
Converts a SOAP MessageElement to a DOM Element representation

Parameters:
element - SOAP MessageElement to be converted
Returns:
DOM Element representing the input
Throws:
java.lang.Exception - if the DOM Element could not be created

toElement

public static org.w3c.dom.Element[] toElement(org.apache.axis.message.MessageElement[] elements)
                                       throws java.lang.Exception
Array version of toElement

Throws:
java.lang.Exception

toElement

public static org.w3c.dom.Element[] toElement(org.apache.axis.encoding.AnyContentType any)
                                       throws java.lang.Exception
Converts type containing any element to an array of DOM Elements.

Throws:
java.lang.Exception
See Also:
toElement(MessageElement element)

getFirstParentAsElement

public static org.w3c.dom.Element getFirstParentAsElement(org.apache.axis.encoding.AnyContentType any)
                                                   throws java.lang.Exception
Converts type containing any element to a single DOM Element, representing the parent MessageElement.

Throws:
java.lang.Exception
See Also:
toElement(MessageElement element)

getFirstAsElement

public static org.w3c.dom.Element getFirstAsElement(org.apache.axis.encoding.AnyContentType any)
                                             throws java.lang.Exception
Converts type containing any element to a single DOM Element.

Throws:
java.lang.Exception
See Also:
toElement(MessageElement element)

findFirstElement

public static javax.xml.soap.SOAPElement findFirstElement(org.apache.axis.message.MessageElement[] elements,
                                                          javax.xml.namespace.QName name)
Finds first element with a given name in a list of SOAPElements.

Parameters:
elements - the array of SOAPElements
name - name of the element to find
Returns:
non-null if the element is found, null otherwise.

findFirstElement

public static javax.xml.soap.SOAPElement findFirstElement(org.apache.axis.encoding.AnyContentType any,
                                                          javax.xml.namespace.QName name)
Finds first element with a given name in a list of SOAPElements of AnyContentType object.

Parameters:
any - xsd:any object
name - name of the element to find
Returns:
non-null if the element is found, null otherwise.