Package oracle.bpel.services.common.util
Class AbstractJaxbUtil
java.lang.Object
oracle.bpel.services.common.util.AbstractJaxbUtil
- Direct Known Subclasses:
oracle.bpel.services.workflow.common.util.AbstractMLSJaxbUtil,RoutingSlipUtil,TaskAttributesUtil,TaskDisplayUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClone the jaxb objectcloneObject(Element element) Clone the jaxb object elementstatic URLCreates an URL object from the specified urlStringReturns absolute file path of the schema fileGets the current thread context ClassLoaderabstract StringGet the Jaxb Context Stringabstract StringGet the XSD location.javax.xml.bind.ValidationEvent[]Get the obj schema validation errorsbyte[]Write an object to a UTF-8 encoded byte arrayvoidmarshal(Object obj, OutputStream os) Write a object to an output streamvoidWrite a object to an XML filevoidWrites a JAXB object into a DOM NodebooleanschemaValidate(Object obj) Validate obj against its schemaGet the element from the JAXB objectGet a string verion of the objunmarshal(byte[] data) Unmarshals a JAXB 1.0 object from a byte array.unmarshal(InputStream inputStream) Unmarshal an input stream to a objectUnmarshal xml in specified file to a objectUnmarshal xml in specified file to a objectUnmarshal xml node in specified file to a object
-
Constructor Details
-
AbstractJaxbUtil
public AbstractJaxbUtil()
-
-
Method Details
-
getJaxbContextString
Get the Jaxb Context String- Returns:
- a
Stringvalue
-
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
Stringvalue
-
unmarshal
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 occursIOException- if an error occurs
-
unmarshal
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 occursIOException- if an error occurs
-
unmarshal
Unmarshal an input stream to a object- Parameters:
inputStream- The input stream- Returns:
- a object
- Throws:
javax.xml.bind.JAXBException- if an error occursIOException- if an error occurs
-
unmarshal
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.JAXBExceptionIOException
-
unmarshal
Unmarshal xml node in specified file to a object- Parameters:
node- The node- Returns:
- a object
- Throws:
javax.xml.bind.JAXBException- if an error occursIOException- if an error occurs
-
marshal
public void marshal(Object obj, String outputXMLLocation) throws javax.xml.bind.JAXBException, IOException Write a object to an XML file- Parameters:
obj- The objectoutputXMLLocation- The file location to write the XML- Throws:
javax.xml.bind.JAXBException- if an error occursIOException- if an error occurs
-
marshal
Write a object to an output stream- Parameters:
obj- The objectos- The output stream- Throws:
javax.xml.bind.JAXBException- if an error occursIOException- if an error occurs
-
marshal
Writes a JAXB object into a DOM Node- Parameters:
obj- a JAXB object associated with this JaxbUtil implementationnode- A DOM node to write to. The node must be one that can accept children(Document,DocumentFragment, orElement)- Throws:
javax.xml.bind.JAXBException
-
marshal
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.JAXBExceptionIOException
-
schemaValidate
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(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
Get a string verion of the obj- Parameters:
t- aObjectvalue of type oracle.xml.jaxb.JaxbNode- Returns:
- a
Stringvalue
-
toElement
Get the element from the JAXB object- Parameters:
t- aObjectvalue of type oracle.xml.jaxb.JaxbNode- Returns:
- an
Elementvalue
-
getAbsoluteSchemaLocation
Returns absolute file path of the schema file- Returns:
- the absolute file path
-
getClassLoader
Gets the current thread context ClassLoader- Returns:
- a
ClassLoadervalue
-
createURL
Creates an URL object from the specified urlString- Parameters:
urlString- aStringvalue- Returns:
- an
URLvalue - Throws:
IOException- if an error occurs
-
cloneObject
Clone the jaxb object- Parameters:
t- anObjectvalue of type oracle.xml.jaxb.JaxbNode- Returns:
- an
Objectvalue - Throws:
Exception- if an error occurs
-
cloneObject
Clone the jaxb object element- Parameters:
element- anElementvalue- Returns:
- an
Objectvalue - Throws:
Exception- if an error occurs
-