org.apache.ws.jaxme.impl
Class JAXBContextImpl

java.lang.Object
  extended byjavax.xml.bind.JAXBContext
      extended byorg.apache.ws.jaxme.impl.JAXBContextImpl

public class JAXBContextImpl
extends JAXBContext

JaxMe's implementation of a JAXBContext.

Version:
$Id: JAXBContextImpl.java,v 1.3 2003/11/03 13:55:50 jochen Exp $
Author:
Jochen Wiedmann

Field Summary
static java.lang.String CONFIGURATION_URI
           
 
Fields inherited from class javax.xml.bind.JAXBContext
JAXB_CONTEXT_FACTORY
 
Constructor Summary
protected JAXBContextImpl()
           
 
Method Summary
 void addManager(JMManager pManager)
           
 Configuration createConfiguration(org.xml.sax.Attributes pAttributes)
           
static JAXBContextImpl createContext()
           
static JAXBContextImpl createContext(java.lang.String pPackageNames, java.lang.ClassLoader pClassLoader)
           
 Marshaller createMarshaller()
          Creates a new instance of Marshaller.
 Unmarshaller createUnmarshaller()
          Creates a new instance of Unmarshaller.
 Validator createValidator()
          Creates a new instance of Validator.
 java.lang.ClassLoader getClassLoader()
          Returns the ClassLoader to use.
 java.lang.Object getElement(java.lang.Class pElementInterface)
          Returns a new instance of a class implementing the element interface pElementInterface.
 JMHandler getJMHandler(java.lang.Class pElementInterface)
          Returns a new handler instance for pQName.
 JMHandler getJMHandler(QName pQName)
          Returns a new handler instance for pQName.
 JMMarshaller getJMMarshaller()
          Returns a new JMMarshaller.
 java.lang.Class getJMMarshallerClass()
          Returns the JMMarshaller class to use.
 PM getJMPM(java.lang.Class pElementInterface)
          Returns a new instance of JMPM.
 PM getJMPM(QName pQName)
          Returns a new instance of JMPM.
 JMUnmarshaller getJMUnmarshaller()
          Returns a new JMUnmarshaller.
 java.lang.Class getJMUnmarshallerClass()
          Sets the JMUnmarshaller class to use.
 JMValidator getJMValidator()
          Returns a new JMValidator.
 java.lang.Class getJMValidatorClass()
          Returns the JMValidator class to use.
 JMXmlSerializer getJMXmlSerializer(java.lang.Class pElementInterface)
          Returns a new serializer instance for pElementInterface.
 JMXmlSerializer getJMXmlSerializer(QName pQName)
          Returns a new serializer instance for pQName.
 JMManager getManager(java.lang.Class pElementInterface)
          Returns a Manager for the given element interface.
 JMManager getManager(QName pQName)
          Returns a Manager for the given QName.
protected  JMManager getManagerByInterface(java.lang.Class pElementInterface)
           
protected  JMManager getManagerByQName(QName pQName)
           
 java.lang.String getPackageNames()
          Returns the package names managed by this context.
protected  void init()
          Initializes the context by loading the configuration or the configurations from the given classpath.
protected  void setClassLoader(java.lang.ClassLoader pClassLoader)
          Sets the ClassLoader to use.
protected  void setJMMarshallerClass(java.lang.Class pClass)
          Sets the JMMarshaller class to use.
protected  void setJMUnmarshallerClass(java.lang.Class pClass)
          Sets the JMUnmarshaller class to use.
protected  void setJMValidatorClass(java.lang.Class pClass)
          Sets the JMValidator class to use.
protected  void setPackageNames(java.lang.String pPackageNames)
          Sets the package names managed by this context.
 
Methods inherited from class javax.xml.bind.JAXBContext
newInstance, newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIGURATION_URI

public static final java.lang.String CONFIGURATION_URI
See Also:
Constant Field Values
Constructor Detail

JAXBContextImpl

protected JAXBContextImpl()
Method Detail

setClassLoader

protected void setClassLoader(java.lang.ClassLoader pClassLoader)

Sets the ClassLoader to use.


getClassLoader

public java.lang.ClassLoader getClassLoader()

Returns the ClassLoader to use.


setPackageNames

protected void setPackageNames(java.lang.String pPackageNames)

Sets the package names managed by this context.


getPackageNames

public java.lang.String getPackageNames()

Returns the package names managed by this context.


setJMMarshallerClass

protected void setJMMarshallerClass(java.lang.Class pClass)

Sets the JMMarshaller class to use.


getJMMarshallerClass

public java.lang.Class getJMMarshallerClass()

Returns the JMMarshaller class to use.


setJMUnmarshallerClass

protected void setJMUnmarshallerClass(java.lang.Class pClass)

Sets the JMUnmarshaller class to use.


getJMUnmarshallerClass

public java.lang.Class getJMUnmarshallerClass()

Sets the JMUnmarshaller class to use.


setJMValidatorClass

protected void setJMValidatorClass(java.lang.Class pClass)

Sets the JMValidator class to use.


getJMValidatorClass

public java.lang.Class getJMValidatorClass()

Returns the JMValidator class to use.


createMarshaller

public Marshaller createMarshaller()
                            throws JAXBException
Description copied from class: JAXBContext

Creates a new instance of Marshaller. The Marshaller can be used to convert JAXB objects into XML data.

Note: Marshallers are reusable, but not reentrant (thread safe).

Specified by:
createMarshaller in class JAXBContext
Throws:
JAXBException

createUnmarshaller

public Unmarshaller createUnmarshaller()
                                throws JAXBException
Description copied from class: JAXBContext

Creates a new instance of Unmarshaller. The Unmarshaller can be used to convert XML data into JAXB objects.

Note: Unmarshallers are reusable, but not reentrant (thread safe).

Specified by:
createUnmarshaller in class JAXBContext
Throws:
JAXBException

createValidator

public Validator createValidator()
                          throws JAXBException
Description copied from class: JAXBContext

Creates a new instance of Validator. The Validator can be used to validate JAXB objects.

Specified by:
createValidator in class JAXBContext
Throws:
JAXBException

getManagerByQName

protected JMManager getManagerByQName(QName pQName)

getManagerByInterface

protected JMManager getManagerByInterface(java.lang.Class pElementInterface)

getManager

public JMManager getManager(QName pQName)
                     throws JAXBException

Returns a Manager for the given QName.

Throws:
ConfiguratorException - No Manager is registered for the given QName.
JAXBException

getManager

public JMManager getManager(java.lang.Class pElementInterface)
                     throws JAXBException

Returns a Manager for the given element interface.

Throws:
ConfiguratorException - No Manager is registered for the given QName.
JAXBException

getElement

public java.lang.Object getElement(java.lang.Class pElementInterface)
                            throws JAXBException

Returns a new instance of a class implementing the element interface pElementInterface.

Throws:
ConfiguratorException - A Manager for pQName was not declared or creating the instance caused an exception.
JAXBException

getJMHandler

public JMHandler getJMHandler(QName pQName)
                       throws UnmarshalException

Returns a new handler instance for pQName.

Throws:
ConfiguratorException - A Manager for pQName was not declared or creating the instance caused an exception.
UnmarshalException

getJMHandler

public JMHandler getJMHandler(java.lang.Class pElementInterface)
                       throws UnmarshalException

Returns a new handler instance for pQName.

Throws:
ConfiguratorException - A Manager for pQName was not declared or creating the instance caused an exception.
UnmarshalException

getJMXmlSerializer

public JMXmlSerializer getJMXmlSerializer(java.lang.Class pElementInterface)
                                   throws MarshalException

Returns a new serializer instance for pElementInterface.

Throws:
ConfiguratorException - A Manager for pElementInterface was not declared or creating the instance caused an exception.
MarshalException

getJMXmlSerializer

public JMXmlSerializer getJMXmlSerializer(QName pQName)
                                   throws MarshalException

Returns a new serializer instance for pQName.

Throws:
ConfiguratorException - A Manager for pQName was not declared or creating the instance caused an exception.
MarshalException

getJMMarshaller

public JMMarshaller getJMMarshaller()
                             throws MarshalException

Returns a new JMMarshaller.

Throws:
MarshalException

getJMUnmarshaller

public JMUnmarshaller getJMUnmarshaller()
                                 throws UnmarshalException

Returns a new JMUnmarshaller.

Throws:
UnmarshalException

getJMValidator

public JMValidator getJMValidator()
                           throws ValidationException

Returns a new JMValidator.

Throws:
ValidationException

getJMPM

public PM getJMPM(java.lang.Class pElementInterface)
           throws PMException

Returns a new instance of JMPM.

Throws:
PMException

getJMPM

public PM getJMPM(QName pQName)
           throws PMException

Returns a new instance of JMPM.

Throws:
PMException

init

protected void init()
             throws JAXBException

Initializes the context by loading the configuration or the configurations from the given classpath.

Throws:
JAXBException

createContext

public static JAXBContextImpl createContext()
                                     throws JAXBException
Throws:
JAXBException

createConfiguration

public Configuration createConfiguration(org.xml.sax.Attributes pAttributes)
                                  throws JAXBException
Throws:
JAXBException

createContext

public static JAXBContextImpl createContext(java.lang.String pPackageNames,
                                            java.lang.ClassLoader pClassLoader)
                                     throws JAXBException
Throws:
JAXBException

addManager

public void addManager(JMManager pManager)
                throws JAXBException
Throws:
JAXBException