Package org.apache.openejb.jee
Class JaxbJavaee
- java.lang.Object
-
- org.apache.openejb.jee.JaxbJavaee
-
public class JaxbJavaee extends Object
- Version:
- $Rev$ $Date$
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJaxbJavaee.HandlerChainsNamespaceFilterstatic classJaxbJavaee.Javaee6SchemaFilterstatic classJaxbJavaee.JavaeeNamespaceFilterstatic classJaxbJavaee.NoSourceFilterstatic classJaxbJavaee.TaglibNamespaceFilter
-
Field Summary
Fields Modifier and Type Field Description static ThreadLocal<Set<String>>currentPublicId
-
Constructor Summary
Constructors Constructor Description JaxbJavaee()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> jakarta.xml.bind.JAXBContextgetContext(Class<T> type)static <T> Stringmarshal(Class<T> type, Object object)static <T> voidmarshal(Class<T> type, Object object, OutputStream out)static <T> Objectunmarshal(Class<T> type, InputStream in)It unmarshals, but not using theJaxbJavaee.JavaeeNamespaceFilterstatic <T> Objectunmarshal(Class<T> type, InputStream in, boolean validate)Read in a T from the input stream.static <T> ObjectunmarshalHandlerChains(Class<T> type, InputStream in)static <T> ObjectunmarshalJavaee(Class<T> type, InputStream in)Convert the namespaceURI in the input to the javaee URI, do not validate the xml, and read in a T.static <T> ObjectunmarshalTaglib(Class<T> type, InputStream in)Convert the namespaceURI in the input to the taglib URI, do not validate the xml, and read in a T.static voidvalidateJavaee(JavaeeSchema type, InputStream in)validate the inputStream, which should be a Java EE standard deployment descriptor against its schema type Note, this method will use the new Java EE 6 schema to validate the old descriptors after changing their namespace and version.
-
-
-
Field Detail
-
currentPublicId
public static final ThreadLocal<Set<String>> currentPublicId
-
-
Method Detail
-
marshal
public static <T> String marshal(Class<T> type, Object object) throws jakarta.xml.bind.JAXBException
- Throws:
jakarta.xml.bind.JAXBException
-
marshal
public static <T> void marshal(Class<T> type, Object object, OutputStream out) throws jakarta.xml.bind.JAXBException
- Throws:
jakarta.xml.bind.JAXBException
-
getContext
public static <T> jakarta.xml.bind.JAXBContext getContext(Class<T> type) throws jakarta.xml.bind.JAXBException
- Throws:
jakarta.xml.bind.JAXBException
-
unmarshal
public static <T> Object unmarshal(Class<T> type, InputStream in) throws ParserConfigurationException, SAXException, jakarta.xml.bind.JAXBException
It unmarshals, but not using theJaxbJavaee.JavaeeNamespaceFilter- Type Parameters:
T- class of object to be returned- Parameters:
type- Class of object to be read inin- input stream to read- Returns:
- a T read from the input stream
- Throws:
ParserConfigurationException- is the SAX parser can not be configuredSAXException- if there is an xml problemjakarta.xml.bind.JAXBException- if the xml cannot be marshalled into a T.
-
unmarshalJavaee
public static <T> Object unmarshalJavaee(Class<T> type, InputStream in) throws ParserConfigurationException, SAXException, jakarta.xml.bind.JAXBException
Convert the namespaceURI in the input to the javaee URI, do not validate the xml, and read in a T.- Type Parameters:
T- class of object to be returned- Parameters:
type- Class of object to be read inin- input stream to read- Returns:
- a T read from the input stream
- Throws:
ParserConfigurationException- is the SAX parser can not be configuredSAXException- if there is an xml problemjakarta.xml.bind.JAXBException- if the xml cannot be marshalled into a T.
-
unmarshal
public static <T> Object unmarshal(Class<T> type, InputStream in, boolean validate) throws ParserConfigurationException, SAXException, jakarta.xml.bind.JAXBException
Read in a T from the input stream.- Type Parameters:
T- class of object to be returned- Parameters:
type- Class of object to be read inin- input stream to readvalidate- whether to validate the input.- Returns:
- a T read from the input stream
- Throws:
ParserConfigurationException- is the SAX parser can not be configuredSAXException- if there is an xml problemjakarta.xml.bind.JAXBException- if the xml cannot be marshalled into a T.
-
unmarshalTaglib
public static <T> Object unmarshalTaglib(Class<T> type, InputStream in) throws ParserConfigurationException, SAXException, jakarta.xml.bind.JAXBException
Convert the namespaceURI in the input to the taglib URI, do not validate the xml, and read in a T.- Type Parameters:
T- class of object to be returned- Parameters:
type- Class of object to be read inin- input stream to read- Returns:
- a T read from the input stream
- Throws:
ParserConfigurationException- is the SAX parser can not be configuredSAXException- if there is an xml problemjakarta.xml.bind.JAXBException- if the xml cannot be marshalled into a T.
-
unmarshalHandlerChains
public static <T> Object unmarshalHandlerChains(Class<T> type, InputStream in) throws ParserConfigurationException, SAXException, jakarta.xml.bind.JAXBException
- Type Parameters:
T- class of object to be returned- Parameters:
type- Class of object to be read inin- input stream to read- Returns:
- a T read from the input stream
- Throws:
ParserConfigurationException- is the SAX parser can not be configuredSAXException- if there is an xml problemjakarta.xml.bind.JAXBException- if the xml cannot be marshalled into a T.
-
validateJavaee
public static void validateJavaee(JavaeeSchema type, InputStream in) throws ParserConfigurationException, SAXException, IOException
validate the inputStream, which should be a Java EE standard deployment descriptor against its schema type Note, this method will use the new Java EE 6 schema to validate the old descriptors after changing their namespace and version.- Parameters:
type-in-- Throws:
ParserConfigurationExceptionSAXExceptionIOException
-
-