org.ow2.petals.binding.soap.util
Class AxiomUtils

java.lang.Object
  extended by org.ow2.petals.binding.soap.util.AxiomUtils

public class AxiomUtils
extends java.lang.Object

An utility class to manipulate AXIOM Elements.


Method Summary
static void copy(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.om.OMContainer targetParent, org.apache.axiom.om.OMNode sourceNode)
          Create a copy of the sourceNode and attach it to the targetParent
static void copyFaultData(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.soap.SOAPFault targetFault, org.apache.axiom.om.OMNode sourceNode)
          Copy the source Node, which is a child fo a SOAPFault, to the target SOAPFault
static void copyOMComment(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.om.OMContainer targetParent, org.apache.axiom.om.OMComment sourceComment)
          Create a copy of the source OMComment
static void copyOMElement(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.om.OMContainer targetParent, org.apache.axiom.om.OMElement sourceElement)
          Create a copy of an ordinary OMElement
static void copyOMSourcedElement(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.om.OMContainer targetParent, org.apache.axiom.om.OMSourcedElement sourceOMSE)
          Create a copy of the OMSourcedElement
static void copyOMText(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.om.OMContainer targetParent, org.apache.axiom.om.OMText sourceText)
          Create a copy of the OM Text
static void copySOAPFault(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.om.OMContainer targetParent, org.apache.axiom.soap.SOAPFault sourceSOAPFault)
          Create a copy of a SOAPFault
static void copySOAPFaultCode(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.soap.SOAPFault targetFault, org.apache.axiom.soap.SOAPFaultCode sourceCode)
          Copy the SOAPFaultCode tree
static void copySOAPFaultDetail(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.soap.SOAPFault targetFault, org.apache.axiom.soap.SOAPFaultDetail sourceDetail)
          Create a copy of a SOAPFaultDetail
static void copySOAPFaultNode(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.soap.SOAPFault targetFault, org.apache.axiom.soap.SOAPFaultNode sourceNode)
          Create a copy of a SOAPFaultNode
static void copySOAPFaultReason(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.soap.SOAPFault targetFault, org.apache.axiom.soap.SOAPFaultReason sourceReason)
          Create a copy of the SOAPFaultReason
static void copySOAPFaultRole(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.soap.SOAPFault targetFault, org.apache.axiom.soap.SOAPFaultRole sourceRole)
          Create a copy of a SOAPFaultRole
static void copySOAPFaultSubCode(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.om.OMElement targetParent, org.apache.axiom.soap.SOAPFaultSubCode sourceSubCode)
          Copy the SOAPFaultSubCode tree
static void copySOAPHeaderBlock_NoDataSource(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.om.OMContainer targetParent, org.apache.axiom.soap.SOAPHeaderBlock sourceSHB)
          Create a copy of the SOAPHeaderBlock
static void copySOAPHeaderBlock(org.apache.axiom.soap.SOAPFactory factory, org.apache.axiom.om.OMContainer targetParent, org.apache.axiom.soap.SOAPHeaderBlock sourceSHB)
          Create a copy of the SOAPHeaderBlock
static void copySOAPHeaderBlockData(org.apache.axiom.soap.SOAPHeaderBlock sourceSHB, org.apache.axiom.soap.SOAPHeaderBlock targetSHB)
          Copy Header data (currently only the processed flag) from the source SOAPHeaderBlock to the target SOAPHeaderBlock
static void copyTagData(org.apache.axiom.om.OMElement sourceElement, org.apache.axiom.om.OMElement targetElement)
          Copy the tag data (attributes and namespaces) from the source element to the target element.
static javax.xml.transform.Source createSource(org.apache.axiom.om.OMElement element)
          Create a Source from an OMElement.
static java.util.Map<java.lang.String,org.apache.axiom.om.OMElement> getHrefElements(org.apache.axiom.om.OMElement element)
          Get all the HREF elements which are children of the input root element
static java.lang.String getHrefId(org.apache.axiom.om.OMElement element)
          Get the HREF ID from the givem element if exists.
static org.apache.axiom.soap.SOAPFactory getSOAPFactory(org.apache.axis2.context.MessageContext msgContext)
          Create the SOAP factory
static org.apache.axiom.soap.SOAPFactory getSOAPFactory(org.apache.axiom.soap.SOAPEnvelope envelope)
          Get the SOAP factory from the SOAP envelope version
static boolean isHrefRedirect(org.apache.axiom.om.OMElement element)
          Let's look if the given element contains a HFRE attribute
static boolean isMultirefElement(org.apache.axiom.om.OMElement element)
          Let's look if the element is a multiref one ie
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createSource

public static javax.xml.transform.Source createSource(org.apache.axiom.om.OMElement element)
                                               throws java.io.IOException,
                                                      javax.xml.stream.XMLStreamException
Create a Source from an OMElement. No optimization is made about namespace writing. The service provider must be in charge of this optimization.

Parameters:
element - The OMElement to convert.
Returns:
The OMElement converted in Source.
Throws:
java.io.IOException
javax.xml.stream.XMLStreamException

getSOAPFactory

public static org.apache.axiom.soap.SOAPFactory getSOAPFactory(org.apache.axis2.context.MessageContext msgContext)
                                                        throws javax.jbi.messaging.MessagingException
Create the SOAP factory

Parameters:
msgContext - the message context
Returns:
the SOAP factory
Throws:
javax.jbi.messaging.MessagingException - if it is not possible to determine the SOAP version

getSOAPFactory

public static org.apache.axiom.soap.SOAPFactory getSOAPFactory(org.apache.axiom.soap.SOAPEnvelope envelope)
                                                        throws javax.jbi.messaging.MessagingException
Get the SOAP factory from the SOAP envelope version

Parameters:
envelope - the SOAP envelope
Returns:
the SOAP factory
Throws:
javax.jbi.messaging.MessagingException - if it is not possible to determine the SOAP version

getHrefElements

public static java.util.Map<java.lang.String,org.apache.axiom.om.OMElement> getHrefElements(org.apache.axiom.om.OMElement element)
Get all the HREF elements which are children of the input root element

Parameters:
rootElement -
Returns:
a map of OMElement>

getHrefId

public static java.lang.String getHrefId(org.apache.axiom.om.OMElement element)
Get the HREF ID from the givem element if exists.

Parameters:
element - to get HREF id from
Returns:
id or empty string if not found

isMultirefElement

public static boolean isMultirefElement(org.apache.axiom.om.OMElement element)
Let's look if the element is a multiref one ie
 
 

Parameters:
element -
Returns:

isHrefRedirect

public static boolean isHrefRedirect(org.apache.axiom.om.OMElement element)
Let's look if the given element contains a HFRE attribute

Parameters:
element -
Returns:

copy

public static void copy(org.apache.axiom.soap.SOAPFactory factory,
                        org.apache.axiom.om.OMContainer targetParent,
                        org.apache.axiom.om.OMNode sourceNode)
Create a copy of the sourceNode and attach it to the targetParent

Parameters:
factory - OMFactory
targetParent -
sourceNode -

copyOMComment

public static void copyOMComment(org.apache.axiom.soap.SOAPFactory factory,
                                 org.apache.axiom.om.OMContainer targetParent,
                                 org.apache.axiom.om.OMComment sourceComment)
Create a copy of the source OMComment

Parameters:
factory -
targetParent -
sourceComment -

copyOMText

public static void copyOMText(org.apache.axiom.soap.SOAPFactory factory,
                              org.apache.axiom.om.OMContainer targetParent,
                              org.apache.axiom.om.OMText sourceText)
Create a copy of the OM Text

Parameters:
factory -
targetParent -
sourceText -

copyOMElement

public static void copyOMElement(org.apache.axiom.soap.SOAPFactory factory,
                                 org.apache.axiom.om.OMContainer targetParent,
                                 org.apache.axiom.om.OMElement sourceElement)
Create a copy of an ordinary OMElement

Parameters:
factory -
targetParent -
sourceElement -

copyOMSourcedElement

public static void copyOMSourcedElement(org.apache.axiom.soap.SOAPFactory factory,
                                        org.apache.axiom.om.OMContainer targetParent,
                                        org.apache.axiom.om.OMSourcedElement sourceOMSE)
Create a copy of the OMSourcedElement

Parameters:
factory -
targetParent -
sourceOMSE -

copySOAPHeaderBlock

public static void copySOAPHeaderBlock(org.apache.axiom.soap.SOAPFactory factory,
                                       org.apache.axiom.om.OMContainer targetParent,
                                       org.apache.axiom.soap.SOAPHeaderBlock sourceSHB)
Create a copy of the SOAPHeaderBlock

Parameters:
factory -
targetParent -
sourceSHB -

copySOAPHeaderBlock_NoDataSource

public static void copySOAPHeaderBlock_NoDataSource(org.apache.axiom.soap.SOAPFactory factory,
                                                    org.apache.axiom.om.OMContainer targetParent,
                                                    org.apache.axiom.soap.SOAPHeaderBlock sourceSHB)
Create a copy of the SOAPHeaderBlock

Parameters:
factory -
targetParent -
sourceSHB -

copySOAPFault

public static void copySOAPFault(org.apache.axiom.soap.SOAPFactory factory,
                                 org.apache.axiom.om.OMContainer targetParent,
                                 org.apache.axiom.soap.SOAPFault sourceSOAPFault)
Create a copy of a SOAPFault

Parameters:
factory -
targetParent -
sourceSOAPFault -

copyFaultData

public static void copyFaultData(org.apache.axiom.soap.SOAPFactory factory,
                                 org.apache.axiom.soap.SOAPFault targetFault,
                                 org.apache.axiom.om.OMNode sourceNode)
Copy the source Node, which is a child fo a SOAPFault, to the target SOAPFault

Parameters:
factory -
targetFault -
sourceNode -

copySOAPFaultRole

public static void copySOAPFaultRole(org.apache.axiom.soap.SOAPFactory factory,
                                     org.apache.axiom.soap.SOAPFault targetFault,
                                     org.apache.axiom.soap.SOAPFaultRole sourceRole)
Create a copy of a SOAPFaultRole

Parameters:
factory -
targetFault -
sourceRole -

copySOAPFaultNode

public static void copySOAPFaultNode(org.apache.axiom.soap.SOAPFactory factory,
                                     org.apache.axiom.soap.SOAPFault targetFault,
                                     org.apache.axiom.soap.SOAPFaultNode sourceNode)
Create a copy of a SOAPFaultNode

Parameters:
factory -
targetFault -
sourceNode -

copySOAPFaultDetail

public static void copySOAPFaultDetail(org.apache.axiom.soap.SOAPFactory factory,
                                       org.apache.axiom.soap.SOAPFault targetFault,
                                       org.apache.axiom.soap.SOAPFaultDetail sourceDetail)
Create a copy of a SOAPFaultDetail

Parameters:
factory -
targetFault -
sourceDetail -

copySOAPFaultReason

public static void copySOAPFaultReason(org.apache.axiom.soap.SOAPFactory factory,
                                       org.apache.axiom.soap.SOAPFault targetFault,
                                       org.apache.axiom.soap.SOAPFaultReason sourceReason)
Create a copy of the SOAPFaultReason

Parameters:
factory -
targetFault -
sourceReason -

copySOAPFaultCode

public static void copySOAPFaultCode(org.apache.axiom.soap.SOAPFactory factory,
                                     org.apache.axiom.soap.SOAPFault targetFault,
                                     org.apache.axiom.soap.SOAPFaultCode sourceCode)
Copy the SOAPFaultCode tree

Parameters:
factory -
targetFault -
sourceCode -

copySOAPFaultSubCode

public static void copySOAPFaultSubCode(org.apache.axiom.soap.SOAPFactory factory,
                                        org.apache.axiom.om.OMElement targetParent,
                                        org.apache.axiom.soap.SOAPFaultSubCode sourceSubCode)
Copy the SOAPFaultSubCode tree

Parameters:
factory -
targetParent - (SOAPFaultCode or SOAPFaultSubCode)
sourceSubCode -

copyTagData

public static void copyTagData(org.apache.axiom.om.OMElement sourceElement,
                               org.apache.axiom.om.OMElement targetElement)
Copy the tag data (attributes and namespaces) from the source element to the target element.

Parameters:
sourceElement -
targetElement -

copySOAPHeaderBlockData

public static void copySOAPHeaderBlockData(org.apache.axiom.soap.SOAPHeaderBlock sourceSHB,
                                           org.apache.axiom.soap.SOAPHeaderBlock targetSHB)
Copy Header data (currently only the processed flag) from the source SOAPHeaderBlock to the target SOAPHeaderBlock

Parameters:
sourceSHB -
targetSHB -


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.