|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.ispsoft.jaxme.jaxb.JAXBContext de.ispsoft.jaxme.JMManagerFactoryImpl
A default implementation for a JMManagerFactory. This
implementation is immediately instantiating all the managers
listed in configuration file. The obvious advantage is
that the accessor methods need not be synchronized at the
cost of a slower startup. If you don't like this, you might
prefer to use the JMManagerFactoryLIImpl
which implements lazy instantiation of managers.
Field Summary | |
static java.lang.String |
CONFIGURATION_NAME
The local name of the element with the list of configurations. |
protected java.util.Map |
configurations
|
protected org.w3c.dom.Element |
defaults
|
static java.lang.String |
DEFAULTS_NAME
The local name of the defaults element. |
static java.lang.String |
LOCAL_NAME
The local name of the JMManagerFactory configuration. |
static java.lang.String |
LOCALNAME_ATTRIBUTE
The local name of the attribute localName. |
static java.lang.String |
MANAGER_CLASS_NAME
The local name of the ManagerClass element. |
protected java.util.Map |
managers
|
static java.lang.String |
NAMESPACE_URI
The namespace for the JMManagerFactory configuration. |
static java.lang.String |
NAMESPACE_URI_ATTRIBUTE
The local name of the attribute namespaceURI. |
protected java.lang.String |
schemaPath
|
Fields inherited from class de.ispsoft.jaxme.jaxb.JAXBContext |
JAXB_CONTEXT_FACTORY |
Constructor Summary | |
JMManagerFactoryImpl()
Creates a new instance of JMManagerFactoryImpl. |
Method Summary | |
Marshaller |
createMarshaller()
Create a Marshaller object that can be used to convert a java content tree into XML data. |
Unmarshaller |
createUnmarshaller()
Create an Unmarshaller object that can be used to convert XML data into a java content tree. |
Validator |
createValidator()
Create a Validator object that can be used to validate a java content tree against its source schema. |
org.w3c.dom.Element |
getConfiguration(java.lang.String pNamespaceURI,
java.lang.String pLocalName)
Returns a Configuration element with the JMManager's configuration for a given namespace and local name or null, if there is no such element. |
org.w3c.dom.Element |
getDefaults()
Returns a Defaults element with the JMManagerFactory's default settings. |
protected boolean |
getLazyInstantiation()
Returns whether the factory has lazy instantiation. |
JMManager |
getManager(java.lang.String pNamespaceURI,
java.lang.String pLocalName)
Deprecated. Use getManager(UriName) instead. |
JMManager |
getManager(UriName pUriName)
Returns a JMManager responsible for handling the given document type. |
static java.lang.String |
getNodeText(org.w3c.dom.Node pNode)
Returns the text contained in a given node. |
java.lang.String |
getSchemaPath()
Returns the path previously set by JaxbContextFactoryImpl.createContext(schemaPath). |
void |
init(org.xml.sax.InputSource pSource)
Initializes the JMManagerFactoryImpl by parsing a configuration from the given InputSource. |
protected void |
parseConfiguration(org.w3c.dom.Element pConfigFile)
Parses a configuration. |
protected void |
setLazyInstantiation(boolean pLazyInstantiation)
Sets whether the factory has lazy instantiation. |
void |
setSchemaPath(java.lang.String pPath)
Called by JaxbContextFactoryImpl.createContext(schemaPath). |
void |
setURI(java.lang.String pURI)
Initializes the factory to read resources from the given URI. |
Methods inherited from class de.ispsoft.jaxme.jaxb.JAXBContext |
newInstance |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Map configurations
protected java.util.Map managers
protected org.w3c.dom.Element defaults
protected java.lang.String schemaPath
public static final java.lang.String NAMESPACE_URI
The namespace for the JMManagerFactory configuration.
public static final java.lang.String LOCAL_NAME
The local name of the JMManagerFactory configuration.
public static final java.lang.String DEFAULTS_NAME
The local name of the defaults element.
public static final java.lang.String CONFIGURATION_NAME
The local name of the element with the list of configurations.
public static final java.lang.String LOCALNAME_ATTRIBUTE
The local name of the attribute localName.
public static final java.lang.String NAMESPACE_URI_ATTRIBUTE
The local name of the attribute namespaceURI.
public static final java.lang.String MANAGER_CLASS_NAME
The local name of the ManagerClass element.
Constructor Detail |
public JMManagerFactoryImpl()
Creates a new instance of JMManagerFactoryImpl. The instance
cannot be used until one of the init()
methods or
setURI()
is called.
Method Detail |
protected void parseConfiguration(org.w3c.dom.Element pConfigFile) throws org.xml.sax.SAXException
Parses a configuration. Returns an element of defaults.
org.xml.sax.SAXException
protected void setLazyInstantiation(boolean pLazyInstantiation)
Sets whether the factory has lazy instantiation. Defaults to false.
protected boolean getLazyInstantiation()
Returns whether the factory has lazy instantiation. Defaults to false.
public void setURI(java.lang.String pURI) throws org.xml.sax.SAXException
Initializes the factory to read resources from the given URI. Possible values are:
http://... https://... ftp://... file:... |
The value is interpreted using
new java.net.URL(value) and an XML
file is read from the given URL. |
---|---|
resource:... | The String resource: is removed and the remainder is taken as a resource name. The resource is located through the context class loader and an XML file is read from the given URL. |
Any other value | The value is taken as a file name and the given XML file is loaded. |
setURI
in interface JMManagerFactory
org.xml.sax.SAXException
public void init(org.xml.sax.InputSource pSource) throws org.xml.sax.SAXException
Initializes the JMManagerFactoryImpl by parsing a configuration from the given InputSource.
org.xml.sax.SAXException
public JMManager getManager(java.lang.String pNamespaceURI, java.lang.String pLocalName) throws org.xml.sax.SAXException
Returns a JMManager responsible for handling the given document type.
getManager
in interface JMManagerFactory
org.xml.sax.SAXException
public JMManager getManager(UriName pUriName) throws org.xml.sax.SAXException
Returns a JMManager responsible for handling the given document type.
org.xml.sax.SAXException
public org.w3c.dom.Element getConfiguration(java.lang.String pNamespaceURI, java.lang.String pLocalName)
Returns a Configuration element with the JMManager's configuration for a given namespace and local name or null, if there is no such element.
getConfiguration
in interface JMManagerFactory
public org.w3c.dom.Element getDefaults()
Returns a Defaults element with the JMManagerFactory's default settings.
getDefaults
in interface JMManagerFactory
public static java.lang.String getNodeText(org.w3c.dom.Node pNode)
Returns the text contained in a given node.
public Marshaller createMarshaller()
JAXBContext
createMarshaller
in class JAXBContext
public Unmarshaller createUnmarshaller()
JAXBContext
createUnmarshaller
in class JAXBContext
public Validator createValidator()
JAXBContext
createValidator
in class JAXBContext
public void setSchemaPath(java.lang.String pPath)
Called by JaxbContextFactoryImpl.createContext(schemaPath).
public java.lang.String getSchemaPath()
Returns the path previously set by JaxbContextFactoryImpl.createContext(schemaPath).
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |