|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jomc.modlet.ModelContext
org.jomc.modlet.DefaultModelContext
public class DefaultModelContext
Default ModelContext
implementation.
ModelContextFactory
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jomc.modlet.ModelContext |
---|
ModelContext.Listener |
Field Summary | |
---|---|
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 Summary | |
---|---|
DefaultModelContext()
Creates a new DefaultModelContext instance. |
|
DefaultModelContext(ClassLoader classLoader)
Creates a new DefaultModelContext instance taking a class loader. |
Method Summary | ||
---|---|---|
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. |
|
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public 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 ValuesConstructor Detail |
---|
public DefaultModelContext()
DefaultModelContext
instance.
public DefaultModelContext(ClassLoader classLoader)
DefaultModelContext
instance taking a class loader.
classLoader
- The class loader of the context.Method Detail |
---|
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_NAME
public 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_NAME
public 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 ModelContext
Modlets
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 ModelContext
model
- 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 ModelContext
model
- 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 ModelContext
T
- 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
,
ModelValidator
public EntityResolver createEntityResolver(String model) throws ModelException
ModelContext
createEntityResolver
in class ModelContext
model
- 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_ID
public EntityResolver createEntityResolver(URI publicId) throws ModelException
ModelContext
createEntityResolver
in class ModelContext
publicId
- 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_ID
public LSResourceResolver createResourceResolver(String model) throws ModelException
ModelContext
createResourceResolver
in class ModelContext
model
- 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_ID
public LSResourceResolver createResourceResolver(URI publicId) throws ModelException
ModelContext
createResourceResolver
in class ModelContext
publicId
- 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_ID
public Schema createSchema(String model) throws ModelException
ModelContext
createSchema
in class ModelContext
model
- 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_ID
public Schema createSchema(URI publicId) throws ModelException
ModelContext
createSchema
in class ModelContext
publicId
- The public identifier URI to create a new JAXP schema instance for.
publicId
.
ModelException
- if creating a new JAXP schema instance fails.ModletObject.PUBLIC_ID
public javax.xml.bind.JAXBContext createContext(String model) throws ModelException
ModelContext
createContext
in class ModelContext
model
- 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_ID
public javax.xml.bind.JAXBContext createContext(URI publicId) throws ModelException
ModelContext
createContext
in class ModelContext
publicId
- The public identifier URI to create a new JAXB context instance for.
publicId
.
ModelException
- if creating a new JAXB context instance fails.ModletObject.PUBLIC_ID
public javax.xml.bind.Marshaller createMarshaller(String model) throws ModelException
ModelContext
createMarshaller
in class ModelContext
model
- 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_ID
public javax.xml.bind.Marshaller createMarshaller(URI publicId) throws ModelException
ModelContext
createMarshaller
in class ModelContext
publicId
- The public identifier URI to create a new JAXB marshaller instance for.
publicId
.
ModelException
- if creating a new JAXB marshaller instance fails.ModletObject.PUBLIC_ID
public javax.xml.bind.Unmarshaller createUnmarshaller(String model) throws ModelException
ModelContext
createUnmarshaller
in class ModelContext
model
- 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_ID
public javax.xml.bind.Unmarshaller createUnmarshaller(URI publicId) throws ModelException
ModelContext
createUnmarshaller
in class ModelContext
publicId
- The public identifier URI to create a new JAXB unmarshaller instance for.
publicId
.
ModelException
- if creating a new JAXB unmarshaller instance fails.ModletObject.PUBLIC_ID
public Model processModel(Model model) throws ModelException
Model
.
This method loads all ModelProcessor
service classes of model
to process the given
Model
.
processModel
in class ModelContext
model
- 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 ModelContext
model
- 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 ModelContext
model
- 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2005-2012 The JOMC Project. All Rights Reserved. |