Oracle Fusion Middleware
Workflow Services Java API Reference for Oracle SOA Suite
11g Release 1 (11.1.1.7)
E10660-11

oracle.bpel.services.common.util
Class AbstractJaxbUtil

java.lang.Object
  extended by oracle.bpel.services.common.util.AbstractJaxbUtil
Direct Known Subclasses:
oracle.bpel.services.workflow.common.util.AbstractMLSJaxbUtil, RoutingSlipUtil, TaskAttributesUtil, TaskDisplayUtil

public abstract class AbstractJaxbUtil
extends java.lang.Object


Constructor Summary
AbstractJaxbUtil()
           
 
Method Summary
 java.lang.Object cloneObject(org.w3c.dom.Element element)
          Clone the jaxb object element
 java.lang.Object cloneObject(java.lang.Object t)
          Clone the jaxb object
static java.net.URL createURL(java.lang.String urlString)
          Creates an URL object from the specified urlString
 java.lang.String getAbsoluteSchemaLocation()
          Returns absolute file path of the schema file
 java.lang.ClassLoader getClassLoader()
          Gets the current thread context ClassLoader
abstract  java.lang.String getJaxbContextString()
          Get the Jaxb Context String
abstract  java.lang.String getSchemaLocation()
          Get the XSD location.
 javax.xml.bind.ValidationEvent[] getSchemaValidationErrors(java.lang.Object obj)
          Get the obj schema validation errors
 byte[] marshal(java.lang.Object obj)
          Write an object to a UTF-8 encoded byte array
 void marshal(java.lang.Object obj, java.io.OutputStream os)
          Write a object to an output stream
 void marshal(java.lang.Object obj, java.lang.String outputXMLLocation)
          Write a object to an XML file
 boolean schemaValidate(java.lang.Object obj)
          Validate obj against its schema
 org.w3c.dom.Element toElement(java.lang.Object t)
          Get the element from the JAXB object
 java.lang.String toString(java.lang.Object t)
          Get a string verion of the obj
 java.lang.Object unmarshal(byte[] data)
          Unmarshals a JAXB 1.0 object from a byte array.
 java.lang.Object unmarshal(java.io.InputStream inputStream)
          Unmarshal an input stream to a object
 java.lang.Object unmarshal(org.w3c.dom.Node node)
          Unmarshal xml node in specified file to a object
 java.lang.Object unmarshal(java.lang.String xmlURI)
          Unmarshal xml in specified file to a object
 java.lang.Object unmarshal(java.net.URL xmlURL)
          Unmarshal xml in specified file to a object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJaxbUtil

public AbstractJaxbUtil()
Method Detail

getJaxbContextString

public abstract java.lang.String getJaxbContextString()
Get the Jaxb Context String

Returns:
a String value

getSchemaLocation

public abstract java.lang.String getSchemaLocation()
Get the XSD location. This location is a resource location string like A.xsd, a/b/C.xsd The actual file location is determined from the classpath

Returns:
a String value

unmarshal

public java.lang.Object unmarshal(java.lang.String xmlURI)
                           throws javax.xml.bind.JAXBException,
                                  java.io.IOException
Unmarshal xml in specified file to a object

Parameters:
xmlURI - The URI of XML file
Returns:
a object
Throws:
javax.xml.bind.JAXBException - if an error occurs
java.io.IOException - if an error occurs

unmarshal

public java.lang.Object unmarshal(java.net.URL xmlURL)
                           throws javax.xml.bind.JAXBException,
                                  java.io.IOException
Unmarshal xml in specified file to a object

Parameters:
xmlURL - The URL of XML file
Returns:
a object
Throws:
javax.xml.bind.JAXBException - if an error occurs
java.io.IOException - if an error occurs

unmarshal

public java.lang.Object unmarshal(java.io.InputStream inputStream)
                           throws javax.xml.bind.JAXBException,
                                  java.io.IOException
Unmarshal an input stream to a object

Parameters:
inputStream - The input stream
Returns:
a object
Throws:
javax.xml.bind.JAXBException - if an error occurs
java.io.IOException - if an error occurs

unmarshal

public java.lang.Object unmarshal(byte[] data)
                           throws javax.xml.bind.JAXBException,
                                  java.io.IOException
Unmarshals a JAXB 1.0 object from a byte array.

Parameters:
data - byte[] containing the JAXB 1.0 object
Returns:
instance of the JAXB 1.0 object
Throws:
javax.xml.bind.JAXBException
java.io.IOException

unmarshal

public java.lang.Object unmarshal(org.w3c.dom.Node node)
                           throws javax.xml.bind.JAXBException,
                                  java.io.IOException
Unmarshal xml node in specified file to a object

Parameters:
node - The node
Returns:
a object
Throws:
javax.xml.bind.JAXBException - if an error occurs
java.io.IOException - if an error occurs

marshal

public void marshal(java.lang.Object obj,
                    java.lang.String outputXMLLocation)
             throws javax.xml.bind.JAXBException,
                    java.io.IOException
Write a object to an XML file

Parameters:
obj - The object
outputXMLLocation - The file location to write the XML
Throws:
javax.xml.bind.JAXBException - if an error occurs
java.io.IOException - if an error occurs

marshal

public void marshal(java.lang.Object obj,
                    java.io.OutputStream os)
             throws javax.xml.bind.JAXBException,
                    java.io.IOException
Write a object to an output stream

Parameters:
obj - The object
os - The output stream
Throws:
javax.xml.bind.JAXBException - if an error occurs
java.io.IOException - if an error occurs

marshal

public byte[] marshal(java.lang.Object obj)
               throws javax.xml.bind.JAXBException,
                      java.io.IOException
Write an object to a UTF-8 encoded byte array

Parameters:
obj - the JAXB 1.0 object to marshall
Returns:
a byte array containing the UTF-8 encoded representation of the JAXB object.
Throws:
javax.xml.bind.JAXBException
java.io.IOException

schemaValidate

public boolean schemaValidate(java.lang.Object obj)
                       throws javax.xml.bind.JAXBException
Validate obj against its schema

Parameters:
obj - The object
Returns:
boolean true if obj is valid against its schema, false otherwise
Throws:
javax.xml.bind.JAXBException - if an error occurs

getSchemaValidationErrors

public javax.xml.bind.ValidationEvent[] getSchemaValidationErrors(java.lang.Object obj)
                                                           throws javax.xml.bind.JAXBException
Get the obj schema validation errors

Parameters:
obj - The JAXB object
Returns:
boolean true if obj is valid against its schema, false otherwise
Throws:
javax.xml.bind.JAXBException - if an error occurs

toString

public java.lang.String toString(java.lang.Object t)
Get a string verion of the obj

Parameters:
t - a Object value of type oracle.xml.jaxb.JaxbNode
Returns:
a String value

toElement

public org.w3c.dom.Element toElement(java.lang.Object t)
Get the element from the JAXB object

Parameters:
t - a Object value of type oracle.xml.jaxb.JaxbNode
Returns:
an Element value

getAbsoluteSchemaLocation

public java.lang.String getAbsoluteSchemaLocation()
Returns absolute file path of the schema file

Returns:
the absolute file path

getClassLoader

public java.lang.ClassLoader getClassLoader()
Gets the current thread context ClassLoader

Returns:
a ClassLoader value

createURL

public static java.net.URL createURL(java.lang.String urlString)
                              throws java.io.IOException
Creates an URL object from the specified urlString

Parameters:
urlString - a String value
Returns:
an URL value
Throws:
java.io.IOException - if an error occurs

cloneObject

public java.lang.Object cloneObject(java.lang.Object t)
                             throws java.lang.Exception
Clone the jaxb object

Parameters:
t - an Object value of type oracle.xml.jaxb.JaxbNode
Returns:
an Object value
Throws:
java.lang.Exception - if an error occurs

cloneObject

public java.lang.Object cloneObject(org.w3c.dom.Element element)
                             throws java.lang.Exception
Clone the jaxb object element

Parameters:
element - an Element value
Returns:
an Object value
Throws:
java.lang.Exception - if an error occurs

Oracle Fusion Middleware
Workflow Services Java API Reference for Oracle SOA Suite
11g Release 1 (11.1.1.7)
E10660-11

Copyright © 2009, 2013, Oracle and/or its affiliates. All rights reserved.