public class DefaultModelContext extends ModelContext
ModelContext implementation.ModelContextFactoryModelContext.Listener| Modifier and Type | Field and Description |
|---|---|
static String |
PLATFORM_PROVIDER_LOCATION_ATTRIBUTE_NAME
Constant for the name of the model context attribute backing property
platformProviderLocation. |
static String |
PROVIDER_LOCATION_ATTRIBUTE_NAME
Constant for the name of the model context attribute backing property
providerLocation. |
| Constructor and Description |
|---|
DefaultModelContext()
Creates a new
DefaultModelContext instance. |
DefaultModelContext(ClassLoader classLoader)
Creates a new
DefaultModelContext instance taking a class loader. |
| Modifier and Type | Method and Description |
|---|---|
javax.xml.bind.JAXBContext |
createContext(String model)
Creates a new JAXB context instance of a given model.
|
javax.xml.bind.JAXBContext |
createContext(URI publicId)
Creates a new JAXB context instance for a given public identifier URI.
|
EntityResolver |
createEntityResolver(String model)
Creates a new SAX entity resolver instance of a given model.
|
EntityResolver |
createEntityResolver(URI publicId)
Creates a new SAX entity resolver instance for a given public identifier URI.
|
javax.xml.bind.Marshaller |
createMarshaller(String model)
Creates a new JAXB marshaller instance of a given model.
|
javax.xml.bind.Marshaller |
createMarshaller(URI publicId)
Creates a new JAXB marshaller instance for a given public identifier URI.
|
LSResourceResolver |
createResourceResolver(String model)
Creates a new L/S resource resolver instance of a given model.
|
LSResourceResolver |
createResourceResolver(URI publicId)
Creates a new L/S resource resolver instance for a given public identifier URI.
|
Schema |
createSchema(String model)
Creates a new JAXP schema instance of a given model.
|
Schema |
createSchema(URI publicId)
Creates a new JAXP schema instance for a given public identifier URI.
|
<T> T |
createServiceObject(Service service,
Class<T> type)
Creates a new service object.
|
javax.xml.bind.Unmarshaller |
createUnmarshaller(String model)
Creates a new JAXB unmarshaller instance of a given model.
|
javax.xml.bind.Unmarshaller |
createUnmarshaller(URI publicId)
Creates a new JAXB unmarshaller instance for a given given public identifier URI.
|
Model |
findModel(Model model)
Populates a given
Model instance. |
Model |
findModel(String model)
Creates a new
Model instance. |
Modlets |
findModlets()
Searches the context for
Modlets. |
static String |
getDefaultPlatformProviderLocation()
Gets the default location searched for platform provider resources.
|
static String |
getDefaultProviderLocation()
Gets the default location searched for provider resources.
|
String |
getPlatformProviderLocation()
Gets the location searched for platform provider resources.
|
String |
getProviderLocation()
Gets the location searched for provider resources.
|
Model |
processModel(Model model)
Processes a
Model. |
static void |
setDefaultPlatformProviderLocation(String value)
Sets the default location searched for platform provider resources.
|
static void |
setDefaultProviderLocation(String value)
Sets the default location searched for provider resources.
|
void |
setPlatformProviderLocation(String value)
Sets the location searched for platform provider resources.
|
void |
setProviderLocation(String value)
Sets the location searched for provider resources.
|
ModelValidationReport |
validateModel(Model model)
Validates a given
Model. |
ModelValidationReport |
validateModel(String model,
Source source)
Validates a given model.
|
clearAttribute, createModelContext, findClass, findResource, findResources, getAttribute, getAttribute, getAttributeNames, getClassLoader, getDefaultLogLevel, getDefaultModletSchemaSystemId, getListeners, getLogLevel, getModelContextClassName, getModlets, getModletSchemaSystemId, isLoggable, log, setAttribute, setDefaultLogLevel, setDefaultModletSchemaSystemId, setLogLevel, setModelContextClassName, setModlets, setModletSchemaSystemIdpublic static final String PROVIDER_LOCATION_ATTRIBUTE_NAME
providerLocation.getProviderLocation(),
ModelContext.getAttribute(java.lang.String),
Constant Field Valuespublic static final String PLATFORM_PROVIDER_LOCATION_ATTRIBUTE_NAME
platformProviderLocation.getPlatformProviderLocation(),
ModelContext.getAttribute(java.lang.String),
Constant Field Valuespublic DefaultModelContext()
DefaultModelContext instance.public DefaultModelContext(ClassLoader classLoader)
DefaultModelContext instance taking a class loader.classLoader - The class loader of the context.public static String getDefaultProviderLocation()
The default provider location is controlled by system property
org.jomc.modlet.DefaultModelContext.defaultProviderLocation holding the location to search
for provider resources by default. If that property is not set, the META-INF/services default is
returned.
setDefaultProviderLocation(java.lang.String)public static void setDefaultProviderLocation(String value)
value - The new default location to search for provider resources or null.getDefaultProviderLocation()public final String getProviderLocation()
getDefaultProviderLocation(),
setProviderLocation(java.lang.String),
PROVIDER_LOCATION_ATTRIBUTE_NAMEpublic final void setProviderLocation(String value)
value - The new location to search for provider resources or null.getProviderLocation()public static String getDefaultPlatformProviderLocation()
The default platform provider location is controlled by system property
org.jomc.modlet.DefaultModelContext.defaultPlatformProviderLocation holding the location to
search for platform provider resources by default. If that property is not set, the
<java-home>/lib/jomc.properties default is returned.
setDefaultPlatformProviderLocation(java.lang.String)public static void setDefaultPlatformProviderLocation(String value)
value - The new default location to search for platform provider resources or null.getDefaultPlatformProviderLocation()public final String getPlatformProviderLocation()
getDefaultPlatformProviderLocation(),
setPlatformProviderLocation(java.lang.String),
PLATFORM_PROVIDER_LOCATION_ATTRIBUTE_NAMEpublic final void setPlatformProviderLocation(String value)
value - The new location to search for platform provider resources or null.getPlatformProviderLocation()public Modlets findModlets() throws ModelException
Modlets.
This method loads ModletProvider classes setup via the platform provider configuration file and
<provider-location>/org.jomc.modlet.ModletProvider resources to return a list of Modlets.
findModlets in class ModelContextModlets found in the context.ModelException - if searching Modlets fails.getProviderLocation(),
getPlatformProviderLocation(),
ModletProvider.findModlets(org.jomc.modlet.ModelContext)public Model findModel(String model) throws ModelException
Model instance.
This method loads all ModelProvider service classes of the model identified by model to create
a new Model instance.
findModel in class ModelContextmodel - The identifier of the Model to create.Model identified by model.ModelException - if creating a new Model instance fails.findModel(org.jomc.modlet.Model),
ModelProvider.findModel(org.jomc.modlet.ModelContext, org.jomc.modlet.Model)public Model findModel(Model model) throws ModelException
Model instance.
This method loads all ModelProvider service classes of the given model to populate the given model
instance.
findModel in class ModelContextmodel - The Model to populate.ModelException - if populating model fails.createServiceObject(org.jomc.modlet.Service, java.lang.Class),
ModelProvider.findModel(org.jomc.modlet.ModelContext, org.jomc.modlet.Model)public <T> T createServiceObject(Service service, Class<T> type) throws ModelException
createServiceObject in class ModelContextT - The type of the service.service - The service to create a new object of.type - The class of the type of the service.service.ModelException - if creating the service object fails.ModelProvider,
ModelProcessor,
ModelValidatorpublic EntityResolver createEntityResolver(String model) throws ModelException
ModelContextcreateEntityResolver in class ModelContextmodel - The identifier of the model to create a new SAX entity resolver of.model.ModelException - if creating a new SAX entity resolver instance fails.ModletObject.MODEL_PUBLIC_IDpublic EntityResolver createEntityResolver(URI publicId) throws ModelException
ModelContextcreateEntityResolver in class ModelContextpublicId - The public identifier URI to create a new SAX entity resolver for.publicId.ModelException - if creating a new SAX entity resolver instance fails.ModletObject.PUBLIC_IDpublic LSResourceResolver createResourceResolver(String model) throws ModelException
ModelContextcreateResourceResolver in class ModelContextmodel - The identifier of the model to create a new L/S resource resolver of.model.ModelException - if creating a new L/S resource resolver instance fails.ModletObject.MODEL_PUBLIC_IDpublic LSResourceResolver createResourceResolver(URI publicId) throws ModelException
ModelContextcreateResourceResolver in class ModelContextpublicId - The public identifier URI to create a new L/S resource resolver for.publicId.ModelException - if creating a new L/S resource resolver instance fails.ModletObject.PUBLIC_IDpublic Schema createSchema(String model) throws ModelException
ModelContextcreateSchema in class ModelContextmodel - The identifier of the model to create a new JAXP schema instance of.model.ModelException - if creating a new JAXP schema instance fails.ModletObject.MODEL_PUBLIC_IDpublic Schema createSchema(URI publicId) throws ModelException
ModelContextcreateSchema in class ModelContextpublicId - The public identifier URI to create a new JAXP schema instance for.publicId.ModelException - if creating a new JAXP schema instance fails.ModletObject.PUBLIC_IDpublic javax.xml.bind.JAXBContext createContext(String model) throws ModelException
ModelContextcreateContext in class ModelContextmodel - The identifier of the model to create a new JAXB context instance of.model.ModelException - if creating a new JAXB context instance fails.ModletObject.MODEL_PUBLIC_IDpublic javax.xml.bind.JAXBContext createContext(URI publicId) throws ModelException
ModelContextcreateContext in class ModelContextpublicId - The public identifier URI to create a new JAXB context instance for.publicId.ModelException - if creating a new JAXB context instance fails.ModletObject.PUBLIC_IDpublic javax.xml.bind.Marshaller createMarshaller(String model) throws ModelException
ModelContextcreateMarshaller in class ModelContextmodel - The identifier of the model to create a new JAXB marshaller instance of.model.ModelException - if creating a new JAXB marshaller instance fails.ModletObject.MODEL_PUBLIC_IDpublic javax.xml.bind.Marshaller createMarshaller(URI publicId) throws ModelException
ModelContextcreateMarshaller in class ModelContextpublicId - The public identifier URI to create a new JAXB marshaller instance for.publicId.ModelException - if creating a new JAXB marshaller instance fails.ModletObject.PUBLIC_IDpublic javax.xml.bind.Unmarshaller createUnmarshaller(String model) throws ModelException
ModelContextcreateUnmarshaller in class ModelContextmodel - The identifier of the model to create a new JAXB unmarshaller instance of.model.ModelException - if creating a new JAXB unmarshaller instance fails.ModletObject.MODEL_PUBLIC_IDpublic javax.xml.bind.Unmarshaller createUnmarshaller(URI publicId) throws ModelException
ModelContextcreateUnmarshaller in class ModelContextpublicId - The public identifier URI to create a new JAXB unmarshaller instance for.publicId.ModelException - if creating a new JAXB unmarshaller instance fails.ModletObject.PUBLIC_IDpublic Model processModel(Model model) throws ModelException
Model.
This method loads all ModelProcessor service classes of model to process the given
Model.
processModel in class ModelContextmodel - The Model to process.Model.ModelException - if processing model fails.createServiceObject(org.jomc.modlet.Service, java.lang.Class),
ModelProcessor.processModel(org.jomc.modlet.ModelContext, org.jomc.modlet.Model)public ModelValidationReport validateModel(Model model) throws ModelException
Model.
This method loads all ModelValidator service classes of model to validate the given
Model.
validateModel in class ModelContextmodel - The Model to validate.ModelException - if validating the modules fails.createServiceObject(org.jomc.modlet.Service, java.lang.Class),
ModelValidator.validateModel(org.jomc.modlet.ModelContext, org.jomc.modlet.Model)public ModelValidationReport validateModel(String model, Source source) throws ModelException
validateModel in class ModelContextmodel - The identifier of the Model to use for validating source.source - A source providing the model to validate.ModelException - if validating the model fails.createSchema(java.lang.String)Copyright © 2005-2012 The JOMC Project. All Rights Reserved.