Class BeanUtil
java.lang.Object
org.apache.axis2.databinding.utils.BeanUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddInstanceTypeAttribute(org.apache.axiom.om.OMFactory fac, org.apache.axiom.om.OMElement element, Object resObject, org.apache.axis2.description.java2wsdl.TypeTable typeTable) Adds the instance type attribute to the passed OMElement.static org.apache.axiom.om.OMElementconvertDOMtoOM(org.apache.axiom.om.OMFactory fac, Object document) Convert DOM Document to a OMElement.static org.apache.axiom.om.OMDocumentconvertOMtoDOM(org.apache.axiom.om.OMContainer omElement) Gets the DOOM implementation of org.w3c.dom.Documentstatic Objectdeserialize(Class beanClass, org.apache.axiom.om.OMElement beanElement, MultirefHelper helper, org.apache.axis2.engine.ObjectSupplier objectSupplier) static Objectdeserialize(Class beanClass, org.apache.axiom.om.OMElement beanElement, org.apache.axis2.engine.ObjectSupplier objectSupplier, String arrayLocalName) static Object[]deserialize(org.apache.axiom.om.OMElement response, Object[] javaTypes, org.apache.axis2.engine.ObjectSupplier objectSupplier) To get JavaObjects from XML element , the element most of the time contains only one element in that case that element will be converted to the JavaType specified by the javaTypes array The algo is as follows, get the childerns of the response element , and if it conatian more than one element then check the retuen type of that element and conver that to corresponding JavaTypestatic Object[]deserialize(org.apache.axiom.om.OMElement response, Object[] javaTypes, org.apache.axis2.engine.ObjectSupplier objectSupplier, String[] parameterNames, Method method) static org.apache.axiom.om.OMElementgetCollectionElement(org.apache.axiom.om.OMFactory fac, Type type, Collection results, String name, String innerName, QName elementQName, org.apache.axis2.description.java2wsdl.TypeTable typeTable, boolean elementFormDefault) Gets the collection element.static List<org.apache.axiom.om.OMElement>getMapElement(org.apache.axiom.om.OMFactory fac, Type type, Map results, org.apache.axis2.description.java2wsdl.TypeTable typeTable, boolean elementFormDefault) This method convert a instance of java.util.Map into OM object model for serialization.static org.apache.axiom.om.OMElementgetOMElement(QName opName, Object[] args, QName partName, boolean qualifed, org.apache.axis2.description.java2wsdl.TypeTable typeTable) static XMLStreamReadergetPullParser(Object beanObject) to get the pull parser for a given bean object , generate the wrpper element using class namestatic XMLStreamReadergetPullParser(Object beanObject, QName beanName, org.apache.axis2.description.java2wsdl.TypeTable typeTable, boolean qualified, boolean processingDocLitBare) To Serilize Bean object this method is used, this will create an object array using given bean objectstatic Stringincrements the namespace counter and returns a new prefixstatic StringDeprecated.Please use getUniquePrefixstatic ObjectprocessEnumObject(Class classType, org.apache.axiom.om.OMElement omElement) static Collection<Object>processGenericCollection(org.apache.axiom.om.OMElement omElement, Type generictype, MultirefHelper helper, org.apache.axis2.engine.ObjectSupplier objectSupplier) Process generic collection.static Collection<Object>processGenericCollection(org.apache.axiom.om.OMElement omElement, org.apache.axiom.om.OMElement[] toReturn, Type generictype, MultirefHelper helper, org.apache.axis2.engine.ObjectSupplier objectSupplier, Iterator parts, boolean bare) Process collection.processGenericsMapElement(Type[] parameterArgTypes, org.apache.axiom.om.OMElement omElement, MultirefHelper helper, Iterator parts, org.apache.axis2.engine.ObjectSupplier objectSupplier, Type genericType) This method deserialize OM model in to a instance of java.util.Mapstatic ObjectprocessObject(org.apache.axiom.om.OMElement omElement, Class classType, MultirefHelper helper, boolean isArrayType, org.apache.axis2.engine.ObjectSupplier objectSupplier, Type generictype)
-
Constructor Details
-
BeanUtil
public BeanUtil()
-
-
Method Details
-
getPullParser
public static XMLStreamReader getPullParser(Object beanObject, QName beanName, org.apache.axis2.description.java2wsdl.TypeTable typeTable, boolean qualified, boolean processingDocLitBare) To Serilize Bean object this method is used, this will create an object array using given bean object -
getPullParser
to get the pull parser for a given bean object , generate the wrpper element using class name- Parameters:
beanObject-
-
deserialize
public static Object deserialize(Class beanClass, org.apache.axiom.om.OMElement beanElement, org.apache.axis2.engine.ObjectSupplier objectSupplier, String arrayLocalName) throws org.apache.axis2.AxisFault - Throws:
org.apache.axis2.AxisFault
-
deserialize
public static Object deserialize(Class beanClass, org.apache.axiom.om.OMElement beanElement, MultirefHelper helper, org.apache.axis2.engine.ObjectSupplier objectSupplier) throws org.apache.axis2.AxisFault - Throws:
org.apache.axis2.AxisFault
-
deserialize
public static Object[] deserialize(org.apache.axiom.om.OMElement response, Object[] javaTypes, org.apache.axis2.engine.ObjectSupplier objectSupplier) throws org.apache.axis2.AxisFault To get JavaObjects from XML element , the element most of the time contains only one element in that case that element will be converted to the JavaType specified by the javaTypes array The algo is as follows, get the childerns of the response element , and if it conatian more than one element then check the retuen type of that element and conver that to corresponding JavaType- Parameters:
response- OMElementjavaTypes- Array of JavaTypes- Returns:
- Array of objects
- Throws:
org.apache.axis2.AxisFault
-
deserialize
public static Object[] deserialize(org.apache.axiom.om.OMElement response, Object[] javaTypes, org.apache.axis2.engine.ObjectSupplier objectSupplier, String[] parameterNames, Method method) throws org.apache.axis2.AxisFault - Throws:
org.apache.axis2.AxisFault
-
processObject
public static Object processObject(org.apache.axiom.om.OMElement omElement, Class classType, MultirefHelper helper, boolean isArrayType, org.apache.axis2.engine.ObjectSupplier objectSupplier, Type generictype) throws org.apache.axis2.AxisFault - Throws:
org.apache.axis2.AxisFault
-
processEnumObject
public static Object processEnumObject(Class classType, org.apache.axiom.om.OMElement omElement) throws org.apache.axis2.AxisFault - Throws:
org.apache.axis2.AxisFault
-
getOMElement
-
getUniquePrifix
Deprecated.Please use getUniquePrefix -
getUniquePrefix
increments the namespace counter and returns a new prefix- Returns:
- unique prefix
-
addInstanceTypeAttribute
public static void addInstanceTypeAttribute(org.apache.axiom.om.OMFactory fac, org.apache.axiom.om.OMElement element, Object resObject, org.apache.axis2.description.java2wsdl.TypeTable typeTable) Adds the instance type attribute to the passed OMElement. e.g - <sam:obj xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string"> String Value </sam:obj>- Parameters:
fac- the SOAPFactory instance.element- the child OMElement to add attributes.resObject- the java reflection methodresObject- the res objecttypeTable- the type table of particular Axis2 service
-
convertOMtoDOM
public static org.apache.axiom.om.OMDocument convertOMtoDOM(org.apache.axiom.om.OMContainer omElement) Gets the DOOM implementation of org.w3c.dom.Document- Parameters:
omElement- the OMelement- Returns:
- the DOOM document
-
convertDOMtoOM
public static org.apache.axiom.om.OMElement convertDOMtoOM(org.apache.axiom.om.OMFactory fac, Object document) Convert DOM Document to a OMElement.- Parameters:
fac- the facdocument- the document- Returns:
- the OMElement
-
processGenericsMapElement
public static Map<Object,Object> processGenericsMapElement(Type[] parameterArgTypes, org.apache.axiom.om.OMElement omElement, MultirefHelper helper, Iterator parts, org.apache.axis2.engine.ObjectSupplier objectSupplier, Type genericType) throws org.apache.axis2.AxisFault This method deserialize OM model in to a instance of java.util.Map- Parameters:
parameterArgTypes- the parameter argument types of Map <k,V>omElement- the OMElementhelper- the helperparts- the partsobjectSupplier- the object suppliergenericType- the generic type- Returns:
- a instance of java.util.Map
- Throws:
org.apache.axis2.AxisFault- the axis fault
-
getMapElement
public static List<org.apache.axiom.om.OMElement> getMapElement(org.apache.axiom.om.OMFactory fac, Type type, Map results, org.apache.axis2.description.java2wsdl.TypeTable typeTable, boolean elementFormDefault) This method convert a instance of java.util.Map into OM object model for serialization.- Parameters:
fac- the OMFactorytype- of the java.util.Mapresults- the results valuestypeTable- the type tableelementFormDefault- the element form default- Returns:
- list of OMElement
-
processGenericCollection
public static Collection<Object> processGenericCollection(org.apache.axiom.om.OMElement omElement, Type generictype, MultirefHelper helper, org.apache.axis2.engine.ObjectSupplier objectSupplier) throws org.apache.axis2.AxisFault Process generic collection.- Parameters:
omElement- the om elementgenerictype- the generictypehelper- the helperobjectSupplier- the object supplier- Returns:
- the collection
- Throws:
org.apache.axis2.AxisFault- the axis fault
-
processGenericCollection
public static Collection<Object> processGenericCollection(org.apache.axiom.om.OMElement omElement, org.apache.axiom.om.OMElement[] toReturn, Type generictype, MultirefHelper helper, org.apache.axis2.engine.ObjectSupplier objectSupplier, Iterator parts, boolean bare) throws org.apache.axis2.AxisFault Process collection.- Parameters:
omElement- the om elementtoReturn- the to returngenerictype- the generictypehelper- the helperobjectSupplier- the object supplierparts- the partsbare- the bare- Returns:
- the collection
- Throws:
org.apache.axis2.AxisFault- the axis fault
-
getCollectionElement
public static org.apache.axiom.om.OMElement getCollectionElement(org.apache.axiom.om.OMFactory fac, Type type, Collection results, String name, String innerName, QName elementQName, org.apache.axis2.description.java2wsdl.TypeTable typeTable, boolean elementFormDefault) Gets the collection element.- Parameters:
fac- the factype- the typeresults- the resultsname- the nameinnerName- the inner nameelementQName- the element q nametypeTable- the type tableelementFormDefault- the element form default- Returns:
- the collection element
-