|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jomc.model.DefaultModelManager
public class DefaultModelManager
Default ModelManager
implementation.
Schema management
Resource management
getClasspathModules(java.lang.ClassLoader, java.lang.String)
getClasspathSchemas(java.lang.ClassLoader, java.lang.String)
getClasspathTransformers(java.lang.ClassLoader, java.lang.String)
Log management
Nested Class Summary | |
---|---|
static interface |
DefaultModelManager.Listener
Listener interface. |
Constructor Summary | |
---|---|
DefaultModelManager()
Creates a new DefaultModelManager instance. |
Method Summary | |
---|---|
javax.xml.bind.JAXBContext |
getBootstrapContext()
Gets a new bootstrap JAXB context instance. |
javax.xml.bind.Marshaller |
getBootstrapMarshaller()
Gets a new bootstrap JAXB marshaller instance. |
Schema |
getBootstrapSchema()
Gets a new bootstrap JAXP schema instance. |
javax.xml.bind.Unmarshaller |
getBootstrapUnmarshaller()
Gets a new bootstrap JAXB unmarshaller instance. |
Modules |
getClasspathModules(ClassLoader classLoader,
String location)
Gets modules by searching a given class loader for resources. |
Schemas |
getClasspathSchemas(ClassLoader classLoader,
String location)
Gets schemas by searching a given class loader for resources. |
List<Transformer> |
getClasspathTransformers(ClassLoader classLoader,
String location)
Gets transformers by searching a given class loader for resources. |
javax.xml.bind.JAXBContext |
getContext(ClassLoader classLoader)
Gets a new object management and configuration JAXB context instance. |
static Level |
getDefaultLogLevel()
Gets the default log level events are logged at. |
static String |
getDefaultModuleLocation()
Gets the default location searched for module resources. |
static String |
getDefaultSchemaLocation()
Gets the default location searched for schema resources. |
static String |
getDefaultTransformerLocation()
Gets the default location searched for transformer resources. |
EntityResolver |
getEntityResolver(ClassLoader classLoader)
Gets a new object management and configuration entity resolver instance. |
List<DefaultModelManager.Listener> |
getListeners()
Gets the list of registered listeners. |
Level |
getLogLevel()
Gets the log level of the instance. |
javax.xml.bind.Marshaller |
getMarshaller(ClassLoader classLoader)
Gets a new object management and configuration JAXB marshaller instance. |
LSResourceResolver |
getResourceResolver(ClassLoader classLoader)
Gets a new object management and configuration L/S resource resolver instance. |
Schema |
getSchema(ClassLoader classLoader)
Gets a new object management and configuration JAXP schema instance. |
javax.xml.bind.Unmarshaller |
getUnmarshaller(ClassLoader classLoader)
Gets a new object management and configuration JAXB unmarshaller instance. |
boolean |
isLoggable(Level level)
Checks if a message at a given level is provided to the listeners of the instance. |
protected void |
log(Level level,
String message,
Throwable throwable)
Notifies registered listeners. |
static void |
setDefaultLogLevel(Level value)
Sets the default log level events are logged at. |
static void |
setDefaultModuleLocation(String value)
Sets the default location searched for module resources. |
static void |
setDefaultSchemaLocation(String value)
Sets the default location searched for schema resources. |
static void |
setDefaultTransformerLocation(String value)
Sets the default location searched for transformer resources. |
void |
setLogLevel(Level value)
Sets the log level of the instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultModelManager()
DefaultModelManager
instance.
Method Detail |
---|
public EntityResolver getEntityResolver(ClassLoader classLoader)
ModelManager
getEntityResolver
in interface ModelManager
classLoader
- The class loader to use for resolving entities.
public LSResourceResolver getResourceResolver(ClassLoader classLoader)
ModelManager
getResourceResolver
in interface ModelManager
classLoader
- The class loader to use for resolving entities.
public Schema getSchema(ClassLoader classLoader) throws IOException, SAXException, javax.xml.bind.JAXBException
ModelManager
getSchema
in interface ModelManager
classLoader
- The class loader to use for loading schema resources.
IOException
- if reading schema resources fails.
SAXException
- if parsing schema resources fails.
javax.xml.bind.JAXBException
- if unmarshalling schema resources or creating a context fails.public javax.xml.bind.JAXBContext getContext(ClassLoader classLoader) throws IOException, SAXException, javax.xml.bind.JAXBException
ModelManager
getContext
in interface ModelManager
classLoader
- The class loader to create the context with.
IOException
- if reading schema resources fails.
SAXException
- if parsing schema resources fails.
javax.xml.bind.JAXBException
- if unmarshalling schema resources or creating a context fails.public javax.xml.bind.Marshaller getMarshaller(ClassLoader classLoader) throws IOException, SAXException, javax.xml.bind.JAXBException
ModelManager
getMarshaller
in interface ModelManager
classLoader
- The class loader to create the marshaller with.
IOException
- if reading schema resources fails.
SAXException
- if parsing schema resources fails.
javax.xml.bind.JAXBException
- if unmarshalling schema resources or creating a marshaller fails.public javax.xml.bind.Unmarshaller getUnmarshaller(ClassLoader classLoader) throws IOException, SAXException, javax.xml.bind.JAXBException
ModelManager
getUnmarshaller
in interface ModelManager
classLoader
- The class loader to create the unmarshaller with.
IOException
- if reading schema resources fails.
SAXException
- if parsing schema resources fails.
javax.xml.bind.JAXBException
- if unmarshalling schema resources or creating an unmarshaller fails.public List<DefaultModelManager.Listener> getListeners()
This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make
to the returned list will be present inside the object. This is why there is no set
method for the
listeners property.
log(java.util.logging.Level, java.lang.String, java.lang.Throwable)
public static Level getDefaultLogLevel()
The default log level is controlled by system property
org.jomc.model.DefaultModelManager.defaultLogLevel
holding the log level to log events at by default.
If that property is not set, the WARNING
default is returned.
getLogLevel()
,
Level.parse(java.lang.String)
public static void setDefaultLogLevel(Level value)
value
- The new default level events are logged at or null
.getDefaultLogLevel()
public Level getLogLevel()
getDefaultLogLevel()
,
setLogLevel(java.util.logging.Level)
,
isLoggable(java.util.logging.Level)
public void setLogLevel(Level value)
value
- The new log level of the instance or null
.getLogLevel()
,
isLoggable(java.util.logging.Level)
public boolean isLoggable(Level level)
level
- The level to test.
true
if messages at level
are provided to the listeners of the instance;
false
if messages at level
are not provided to the listeners of the instance.
NullPointerException
- if level
is null
.getLogLevel()
,
setLogLevel(java.util.logging.Level)
protected void log(Level level, String message, Throwable throwable)
level
- The level of the event.message
- The message of the event or null
.throwable
- The throwable of the event null
.
NullPointerException
- if level
is null
.getListeners()
,
isLoggable(java.util.logging.Level)
public javax.xml.bind.JAXBContext getBootstrapContext() throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
- if creating a new bootstrap JAXB context instance fails.public javax.xml.bind.Marshaller getBootstrapMarshaller() throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
- if creating a new bootstrap JAXB marshaller instance fails.public javax.xml.bind.Unmarshaller getBootstrapUnmarshaller() throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
- if creating a new bootstrap JAXB unmarshaller instance fails.public Schema getBootstrapSchema() throws SAXException
SAXException
- if parsing the bootstrap schema fails.public static String getDefaultSchemaLocation()
The default schema location is controlled by system property
org.jomc.model.DefaultModelManager.defaultSchemaLocation
holding the location to search for schema
resources by default. If that property is not set, the META-INF/jomc-bootstrap.xml
default is returned.
getClasspathSchemas(java.lang.ClassLoader, java.lang.String)
public static void setDefaultSchemaLocation(String value)
value
- The new default location to search for schema resources or null
.getDefaultSchemaLocation()
public Schemas getClasspathSchemas(ClassLoader classLoader, String location) throws IOException, javax.xml.bind.JAXBException, SAXException
classLoader
- The class loader to search for resources.location
- The location to search at.
location
by querying classLoader
.
NullPointerException
- if classLoader
or location
is null
.
IOException
- if reading resources fails.
SAXException
- if parsing schema resources fails.
javax.xml.bind.JAXBException
- if unmarshalling schema resources fails.getDefaultSchemaLocation()
public static String getDefaultModuleLocation()
The default module location is controlled by system property
org.jomc.model.DefaultModelManager.defaultModuleLocation
holding the location to search for module
resources by default. If that property is not set, the META-INF/jomc.xml
default is returned.
getClasspathModules(java.lang.ClassLoader, java.lang.String)
public static void setDefaultModuleLocation(String value)
value
- The new default location to search for module resources or null
.getDefaultModuleLocation()
public Modules getClasspathModules(ClassLoader classLoader, String location) throws IOException, SAXException, javax.xml.bind.JAXBException
Note:
This method does not validate the modules.
classLoader
- The class loader to search for resources.location
- The location to search at.
location
by querying classLoader
.
NullPointerException
- if classLoader
or location
is null
.
IOException
- if reading resources fails.
SAXException
- if parsing schema resources fails.
javax.xml.bind.JAXBException
- if unmarshalling schema resources fails.getDefaultModuleLocation()
,
ModelObjectValidator
public static String getDefaultTransformerLocation()
The default transformer location is controlled by system property
org.jomc.model.DefaultModelManager.defaultTransformerLocation
holding the location to search for
transformer resources by default. If that property is not set, the META-INF/jomc.xslt
default is
returned.
getClasspathTransformers(java.lang.ClassLoader, java.lang.String)
public static void setDefaultTransformerLocation(String value)
value
- The new default location to search for transformer resources or null
.getDefaultTransformerLocation()
public List<Transformer> getClasspathTransformers(ClassLoader classLoader, String location) throws IOException, TransformerConfigurationException
classLoader
- The class loader to search for resources.location
- The location to search at.
location
by querying classLoader
.
NullPointerException
- if classLoader
or location
is null
.
IOException
- if reading resources fails.
TransformerConfigurationException
- if getting the transformers fails.getDefaultTransformerLocation()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |