public class JAXBContextImpl extends JAXBContext
JaxMe's implementation of a JAXBContext.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONFIGURATION_URI
The namespace of JaxMe's configuration files.
|
JAXB_CONTEXT_FACTORY| Modifier | Constructor and Description |
|---|---|
protected |
JAXBContextImpl() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
newInstance, newInstancepublic static final java.lang.String CONFIGURATION_URI
protected void setClassLoader(java.lang.ClassLoader pClassLoader)
Sets the ClassLoader to use.
public java.lang.ClassLoader getClassLoader()
Returns the ClassLoader to use.
protected void setPackageNames(java.lang.String pPackageNames)
Sets the package names managed by this context.
public java.lang.String getPackageNames()
Returns the package names managed by this context.
protected void setJMMarshallerClass(java.lang.Class pClass)
Sets the JMMarshaller class to use.
public java.lang.Class getJMMarshallerClass()
Returns the JMMarshaller class to use.
protected void setJMUnmarshallerClass(java.lang.Class pClass)
Sets the JMUnmarshaller class to use.
public java.lang.Class getJMUnmarshallerClass()
Sets the JMUnmarshaller class to use.
protected void setJMValidatorClass(java.lang.Class pClass)
Sets the JMValidator class to use.
public java.lang.Class getJMValidatorClass()
Returns the JMValidator class to use.
public Marshaller createMarshaller() throws JAXBException
JAXBContextCreates 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).
createMarshaller in class JAXBContextJAXBExceptionpublic Unmarshaller createUnmarshaller() throws JAXBException
JAXBContextCreates 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).
createUnmarshaller in class JAXBContextJAXBExceptionpublic Validator createValidator() throws JAXBException
JAXBContextcreateValidator in class JAXBContextJAXBExceptionprotected JMManager getManagerByInterface(java.lang.Class pElementInterface)
public JMManager getManager(QName pQName) throws JAXBException
JAXBException - No Manager is registered for the
given QName.public JMManager getManager(java.lang.Class pElementInterface) throws JAXBException
getManager(Class), except that it
throws a JAXBException.JAXBException - No Manager is registered for the
given QName.getManagerS(Class)public JMManager getManagerS(java.lang.Class pElementInterface) throws org.xml.sax.SAXException
getManager(Class), except that it
throws a SAXException.org.xml.sax.SAXException - No Manager is registered for the
given QName.getManager(Class)public JMMarshaller getJMMarshaller() throws MarshalException
Returns a new JMMarshaller.
MarshalExceptionpublic JMUnmarshaller getJMUnmarshaller() throws UnmarshalException
Returns a new JMUnmarshaller.
UnmarshalExceptionpublic JMValidator getJMValidator() throws ValidationException
Returns a new JMValidator.
ValidationExceptionpublic PM getJMPM(java.lang.Class pElementInterface) throws PMException
Returns a new instance of JMPM.
PMExceptionpublic PM getJMPM(QName pQName) throws PMException
Returns a new instance of JMPM.
PMExceptionprotected void init()
throws JAXBException
Initializes the context by loading the configuration or the configurations from the given classpath.
JAXBExceptionpublic static JAXBContextImpl createContext() throws JAXBException
JAXBContext.
Invoked implicitly by
JAXBContext.newInstance(java.lang.String).JAXBExceptionpublic Configuration createConfiguration(org.xml.sax.Attributes pAttributes) throws JAXBException
JAXBExceptionpublic static JAXBContextImpl createContext(java.lang.String pPackageNames, java.lang.ClassLoader pClassLoader) throws JAXBException
JAXBContext.
Invoked implicitly by
JAXBContext.newInstance(String, ClassLoader)JAXBExceptionpublic void addManager(JMManager pManager) throws JAXBException
JAXBException