org.apache.openejb.jee
Class JaxbJavaee

java.lang.Object
  extended by org.apache.openejb.jee.JaxbJavaee

public class JaxbJavaee
extends Object

Version:
$Rev: 1160123 $ $Date: 2011-08-22 06:40:16 +0000 (Mon, 22 Aug 2011) $

Nested Class Summary
static class JaxbJavaee.HandlerChainsNamespaceFilter
           
static class JaxbJavaee.Javaee6SchemaFilter
           
static class JaxbJavaee.JavaeeNamespaceFilter
           
static class JaxbJavaee.NoSourceFilter
           
static class JaxbJavaee.TaglibNamespaceFilter
           
 
Field Summary
static ThreadLocal<Set<String>> currentPublicId
           
 
Constructor Summary
JaxbJavaee()
           
 
Method Summary
static
<T> String
marshal(Class<T> type, Object object)
           
static
<T> void
marshal(Class<T> type, Object object, OutputStream out)
           
static
<T> Object
unmarshal(Class<T> type, InputStream in, boolean validate)
          Read in a T from the input stream.
static
<T> Object
unmarshalHandlerChains(Class<T> type, InputStream in)
           
static
<T> Object
unmarshalJavaee(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> Object
unmarshalTaglib(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 void validateJavaee(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentPublicId

public static final ThreadLocal<Set<String>> currentPublicId
Constructor Detail

JaxbJavaee

public JaxbJavaee()
Method Detail

marshal

public static <T> String marshal(Class<T> type,
                                 Object object)
                      throws JAXBException
Throws:
JAXBException

marshal

public static <T> void marshal(Class<T> type,
                               Object object,
                               OutputStream out)
                    throws JAXBException
Throws:
JAXBException

unmarshalJavaee

public static <T> Object unmarshalJavaee(Class<T> type,
                                         InputStream in)
                              throws ParserConfigurationException,
                                     SAXException,
                                     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 in
in - input stream to read
Returns:
a T read from the input stream
Throws:
ParserConfigurationException - is the SAX parser can not be configured
SAXException - if there is an xml problem
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,
                               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 in
in - input stream to read
validate - whether to validate the input.
Returns:
a T read from the input stream
Throws:
ParserConfigurationException - is the SAX parser can not be configured
SAXException - if there is an xml problem
JAXBException - if the xml cannot be marshalled into a T.

unmarshalTaglib

public static <T> Object unmarshalTaglib(Class<T> type,
                                         InputStream in)
                              throws ParserConfigurationException,
                                     SAXException,
                                     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 in
in - input stream to read
Returns:
a T read from the input stream
Throws:
ParserConfigurationException - is the SAX parser can not be configured
SAXException - if there is an xml problem
JAXBException - if the xml cannot be marshalled into a T.

unmarshalHandlerChains

public static <T> Object unmarshalHandlerChains(Class<T> type,
                                                InputStream in)
                                     throws ParserConfigurationException,
                                            SAXException,
                                            JAXBException
Type Parameters:
T - class of object to be returned
Parameters:
type - Class of object to be read in
in - input stream to read
Returns:
a T read from the input stream
Throws:
ParserConfigurationException - is the SAX parser can not be configured
SAXException - if there is an xml problem
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:
ParserConfigurationException
SAXException
IOException


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.