org.jomc.model
Interface ModelManager

Package class diagram package ModelManager
All Known Implementing Classes:
DefaultModelManager

public interface ModelManager

Manages the object management and configuration model.

Entity resolution

JAXB

Validation

Transformation

Queries

Version:
$Id: ModelManager.java 509 2009-09-21 13:54:49Z schulte2005 $
Author:
Christian Schulte

Method Summary
 JAXBContext getContext()
          Gets the object management and configuration JAXBContext.
 EntityResolver getEntityResolver()
          Gets the object management and configuration entity resolver.
 Instance getInstance(Modules modules, Implementation implementation, ClassLoader classLoader)
          Gets an instance of an implementation.
 Instance getInstance(Modules modules, Implementation implementation, Dependency dependency, ClassLoader classLoader)
          Gets an instance of an implementation for a dependency.
 Instance getInstance(Modules modules, Object object)
          Gets the instance of an object.
 LSResourceResolver getLSResourceResolver()
          Gets the object management and configuration L/S resolver.
 Marshaller getMarshaller(boolean validating, boolean formattedOutput)
          Gets an object management and configuration Marshaller.
 Object getObject(Modules modules, Specification specification, Instance instance)
          Gets the object of an instance.
 ObjectFactory getObjectFactory()
          Gets the object management and configuration ObjectFactory.
 Schema getSchema()
          Gets the object management and configuration schema.
 Unmarshaller getUnmarshaller(boolean validating)
          Gets an object management and configuration Unmarshaller.
<T extends ModelObject>
T
transformModelObject(JAXBElement<T> modelObject, Transformer transformer)
          Transforms a given ModelObject with a given Transformer.
 void validateModelObject(JAXBElement<? extends ModelObject> modelObject)
          Validates a given model object.
 void validateModules(Modules modules)
          Validates modules.
 

Method Detail

getEntityResolver

EntityResolver getEntityResolver()
Gets the object management and configuration entity resolver.

Returns:
The object management and configuration entity resolver.

getLSResourceResolver

LSResourceResolver getLSResourceResolver()
Gets the object management and configuration L/S resolver.

Returns:
The object management and configuration L/S resolver.

getObjectFactory

ObjectFactory getObjectFactory()
Gets the object management and configuration ObjectFactory.

Returns:
The object management and configuration ObjectFactory.

getSchema

Schema getSchema()
                 throws IOException,
                        SAXException,
                        JAXBException
Gets the object management and configuration schema.

Returns:
The object management and configuration schema.
Throws:
IOException - if reading schema resources fails.
SAXException - if parsing schema resources fails.
JAXBException - if unmarshalling schema resources fails.

getContext

JAXBContext getContext()
                       throws IOException,
                              SAXException,
                              JAXBException
Gets the object management and configuration JAXBContext.

Returns:
The object management and configuration JAXBContext.
Throws:
IOException - if reading schema resources fails.
SAXException - if parsing schema resources fails.
JAXBException - if unmarshalling schema resources fails.

getMarshaller

Marshaller getMarshaller(boolean validating,
                         boolean formattedOutput)
                         throws IOException,
                                SAXException,
                                JAXBException
Gets an object management and configuration Marshaller.

Parameters:
validating - true for a marshaller with additional schema validation support enabled; false for a marshaller without additional schema validation support enabled.
formattedOutput - true for the marshaller to produce formatted output; false for the marshaller to not apply any formatting when marshalling.
Returns:
An object management and configuration Marshaller.
Throws:
IOException - if reading schema resources fails.
SAXException - if parsing schema resources fails.
JAXBException - if unmarshalling schema resources fails.

getUnmarshaller

Unmarshaller getUnmarshaller(boolean validating)
                             throws IOException,
                                    SAXException,
                                    JAXBException
Gets an object management and configuration Unmarshaller.

Parameters:
validating - true for an unmarshaller with additional schema validation support enabled; false for an unmarshaller without additional schema validation support enabled.
Returns:
An object management and configuration Unmarshaller.
Throws:
IOException - if reading schema resources fails.
SAXException - if parsing schema resources fails.
JAXBException - if unmarshalling schema resources fails.

validateModelObject

void validateModelObject(JAXBElement<? extends ModelObject> modelObject)
                         throws NullPointerException,
                                ModelException,
                                IOException,
                                SAXException,
                                JAXBException
Validates a given model object.

Parameters:
modelObject - The object to validate.
Throws:
NullPointerException - if modelObject is null.
ModelException - if modelObject is invalid.
IOException - if reading schema resources fails.
SAXException - if parsing schema resources fails.
JAXBException - if unmarshalling schema resources fails.

validateModules

void validateModules(Modules modules)
                     throws NullPointerException,
                            ModelException,
                            IOException,
                            SAXException,
                            JAXBException
Validates modules.

Parameters:
modules - The modules to validate.
Throws:
NullPointerException - if modules is null.
ModelException - if modules is invalid.
IOException - if reading schema resources fails.
SAXException - if parsing schema resources fails.
JAXBException - if unmarshalling schema resources fails.

transformModelObject

<T extends ModelObject> T transformModelObject(JAXBElement<T> modelObject,
                                               Transformer transformer)
                                           throws NullPointerException,
                                                  IOException,
                                                  SAXException,
                                                  JAXBException,
                                                  TransformerException
Transforms a given ModelObject with a given Transformer.

Type Parameters:
T - The type of modelObject.
Parameters:
modelObject - The ModelObject to transform.
transformer - The Transformer to transform modelObject with.
Returns:
modelObject transformed with transformer.
Throws:
NullPointerException - if modelObject or transformer is null.
IOException - if reading schema resources fails.
SAXException - if parsing schema resources fails.
JAXBException - if binding fails.
TransformerException - if the transformation fails.

getInstance

Instance getInstance(Modules modules,
                     Implementation implementation,
                     ClassLoader classLoader)
                     throws NullPointerException
Gets an instance of an implementation.

Parameters:
modules - The modules declaring the instance to get.
implementation - The implementation to get an instance of.
classLoader - The class loader of the instance to get.
Returns:
An instance of implementation or null if no instance is available.
Throws:
NullPointerException - if modules, implementation or classLoader is null.

getInstance

Instance getInstance(Modules modules,
                     Implementation implementation,
                     Dependency dependency,
                     ClassLoader classLoader)
                     throws NullPointerException
Gets an instance of an implementation for a dependency.

Parameters:
modules - The modules declaring the instance to get.
implementation - The implementation to get an instance of.
dependency - The dependency declaring the instance to get.
classLoader - The class loader of the instance to get.
Returns:
An instance of implementation or null if no instance is available.
Throws:
NullPointerException - if modules, implementation, dependency or classLoader is null.

getInstance

Instance getInstance(Modules modules,
                     Object object)
                     throws NullPointerException
Gets the instance of an object.

Parameters:
modules - The modules declaring the instance to get.
object - The object to get the instance of.
Returns:
The instance of object or null of nothing is known about object.
Throws:
NullPointerException - if modules or object is null,

getObject

Object getObject(Modules modules,
                 Specification specification,
                 Instance instance)
                 throws NullPointerException,
                        InstantiationException
Gets the object of an instance.

Parameters:
modules - The modules declaring the object to get.
specification - The specification specifying the object to get.
instance - The instance of the object to get.
Returns:
The object of instance or null if nothing is known about instance.
Throws:
NullPointerException - if modules, specification or instance is null.
InstantiationException - if instantiating the object fails.


Copyright © 2005-2009 The JOMC Project. All Rights Reserved.