org.apache.ws.jaxme.impl
Class JAXBContextImpl

java.lang.Object
  extended by javax.xml.bind.JAXBContext
      extended by org.apache.ws.jaxme.impl.JAXBContextImpl

public class JAXBContextImpl
extends JAXBContext

JaxMe's implementation of a JAXBContext.

Version:
$Id$
Author:
Jochen Wiedmann

Field Summary
static java.lang.String CONFIGURATION_URI
          The namespace of JaxMe's configuration files.
 
Fields inherited from class javax.xml.bind.JAXBContext
JAXB_CONTEXT_FACTORY
 
Constructor Summary
protected JAXBContextImpl()
           
 
Method Summary
 void addManager(JMManager pManager)
          Invoked from the SAX handler when reading the config file for adding another instance of JMManager.
 Configuration createConfiguration(org.xml.sax.Attributes pAttributes)
          Invoked from the SAX handler when loading the config file.
static JAXBContextImpl createContext()
          Creates a new instance of JAXBContext.
static JAXBContextImpl createContext(java.lang.String pPackageNames, java.lang.ClassLoader pClassLoader)
          Creates a new instance of JAXBContext.
 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.
 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.
 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)
           
 JMManager getManagerS(java.lang.Class pElementInterface)
          Returns a Manager for the given element interface.
 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
The namespace of JaxMe's configuration files.

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:
JAXBException - No Manager is registered for the given QName.

getManager

public JMManager getManager(java.lang.Class pElementInterface)
                     throws JAXBException
Returns a Manager for the given element interface. Same method than getManager(Class), except that it throws a JAXBException.

Throws:
JAXBException - No Manager is registered for the given QName.
See Also:
getManagerS(Class)

getManagerS

public JMManager getManagerS(java.lang.Class pElementInterface)
                      throws org.xml.sax.SAXException
Returns a Manager for the given element interface. Same method than getManager(Class), except that it throws a SAXException.

Throws:
org.xml.sax.SAXException - No Manager is registered for the given QName.
See Also:
getManager(Class)

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
Creates a new instance of JAXBContext. Invoked implicitly by JAXBContext.newInstance(java.lang.String).

Throws:
JAXBException

createConfiguration

public Configuration createConfiguration(org.xml.sax.Attributes pAttributes)
                                  throws JAXBException
Invoked from the SAX handler when loading the config file.

Throws:
JAXBException

createContext

public static JAXBContextImpl createContext(java.lang.String pPackageNames,
                                            java.lang.ClassLoader pClassLoader)
                                     throws JAXBException
Creates a new instance of JAXBContext. Invoked implicitly by JAXBContext.newInstance(String, ClassLoader)

Throws:
JAXBException

addManager

public void addManager(JMManager pManager)
                throws JAXBException
Invoked from the SAX handler when reading the config file for adding another instance of JMManager.

Throws:
JAXBException