org.apache.ws.jaxme.impl

Class JAXBContextImpl


public class JAXBContextImpl
extends JAXBContext

JaxMe's implementation of a JAXBContext.
Version:
$Id: JAXBContextImpl.java 232067 2005-03-10 11:14:08 +0100 (Do, 10 Mrz 2005) jochen $
Author:
Jochen Wiedmann

Field Summary

static String
CONFIGURATION_URI
The namespace of JaxMe's configuration files.

Fields inherited from class javax.xml.bind.JAXBContext

JAXB_CONTEXT_FACTORY

Constructor Summary

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(Attributes pAttributes)
Invoked from the SAX handler when loading the config file.
static JAXBContextImpl
createContext()
Creates a new instance of JAXBContext.
static JAXBContextImpl
createContext(String pPackageNames, ClassLoader pClassLoader)
Creates a new instance of JAXBContext.
Marshaller
createMarshaller()
Unmarshaller
createUnmarshaller()
Validator
createValidator()
ClassLoader
getClassLoader()
Returns the ClassLoader to use.
JMMarshaller
getJMMarshaller()
Returns a new JMMarshaller.
Class
getJMMarshallerClass()
Returns the JMMarshaller class to use.
PM
getJMPM(Class pElementInterface)
Returns a new instance of JMPM.
PM
getJMPM(QName pQName)
Returns a new instance of JMPM.
JMUnmarshaller
getJMUnmarshaller()
Returns a new JMUnmarshaller.
Class
getJMUnmarshallerClass()
Sets the JMUnmarshaller class to use.
JMValidator
getJMValidator()
Returns a new JMValidator.
Class
getJMValidatorClass()
Returns the JMValidator class to use.
JMManager
getManager(Class pElementInterface)
Returns a Manager for the given element interface.
JMManager
getManager(QName pQName)
Returns a Manager for the given QName.
protected JMManager
getManagerByInterface(Class pElementInterface)
protected JMManager
getManagerByQName(QName pQName)
JMManager
getManagerS(Class pElementInterface)
Returns a Manager for the given element interface.
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(ClassLoader pClassLoader)
Sets the ClassLoader to use.
protected void
setJMMarshallerClass(Class pClass)
Sets the JMMarshaller class to use.
protected void
setJMUnmarshallerClass(Class pClass)
Sets the JMUnmarshaller class to use.
protected void
setJMValidatorClass(Class pClass)
Sets the JMValidator class to use.
protected void
setPackageNames(String pPackageNames)
Sets the package names managed by this context.

Methods inherited from class javax.xml.bind.JAXBContext

createMarshaller, createUnmarshaller, createValidator, newInstance, newInstance

Field Details

CONFIGURATION_URI

public static final String CONFIGURATION_URI
The namespace of JaxMe's configuration files.

Constructor Details

JAXBContextImpl

protected JAXBContextImpl()

Method Details

addManager

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

createConfiguration

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

createContext

public static JAXBContextImpl createContext()
            throws JAXBException
Creates a new instance of JAXBContext. Invoked implicitly by JAXBContext.newInstance(String).

createContext

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

createMarshaller

public Marshaller createMarshaller()
            throws JAXBException
Overrides:
createMarshaller in interface JAXBContext

createUnmarshaller

public Unmarshaller createUnmarshaller()
            throws JAXBException
Overrides:
createUnmarshaller in interface JAXBContext

createValidator

public Validator createValidator()
            throws JAXBException
Overrides:
createValidator in interface JAXBContext

getClassLoader

public ClassLoader getClassLoader()
Returns the ClassLoader to use.

getJMMarshaller

public JMMarshaller getJMMarshaller()
            throws MarshalException
Returns a new JMMarshaller.

getJMMarshallerClass

public Class getJMMarshallerClass()
Returns the JMMarshaller class to use.

getJMPM

public PM getJMPM(Class pElementInterface)
            throws PMException
Returns a new instance of JMPM.

getJMPM

public PM getJMPM(QName pQName)
            throws PMException
Returns a new instance of JMPM.

getJMUnmarshaller

public JMUnmarshaller getJMUnmarshaller()
            throws UnmarshalException
Returns a new JMUnmarshaller.

getJMUnmarshallerClass

public Class getJMUnmarshallerClass()
Sets the JMUnmarshaller class to use.

getJMValidator

public JMValidator getJMValidator()
            throws ValidationException
Returns a new JMValidator.

getJMValidatorClass

public Class getJMValidatorClass()
Returns the JMValidator class to use.

getManager

public JMManager getManager(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.

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.

getManagerByInterface

protected JMManager getManagerByInterface(Class pElementInterface)

getManagerByQName

protected JMManager getManagerByQName(QName pQName)

getManagerS

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

getPackageNames

public String getPackageNames()
Returns the package names managed by this context.

init

protected void init()
            throws JAXBException
Initializes the context by loading the configuration or the configurations from the given classpath.

setClassLoader

protected void setClassLoader(ClassLoader pClassLoader)
Sets the ClassLoader to use.

setJMMarshallerClass

protected void setJMMarshallerClass(Class pClass)
Sets the JMMarshaller class to use.

setJMUnmarshallerClass

protected void setJMUnmarshallerClass(Class pClass)
Sets the JMUnmarshaller class to use.

setJMValidatorClass

protected void setJMValidatorClass(Class pClass)
Sets the JMValidator class to use.

setPackageNames

protected void setPackageNames(String pPackageNames)
Sets the package names managed by this context.