org.jomc.model
Class Modules

Package class diagram package Modules
java.lang.Object
  extended by org.jomc.model.ModelObject
      extended by org.jomc.model.Modules
All Implemented Interfaces:
Cloneable

@Generated(value="com.sun.tools.xjc.Driver",
           date="2009-12-07T03:06:36+00:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-833")
public class Modules
extends ModelObject
implements Cloneable

List of modules.

Java class for Modules complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="Modules">
   <complexContent>
     <extension base="{http://jomc.org/model}ModelObject">
       <sequence>
         <element ref="{http://jomc.org/model}module" maxOccurs="unbounded" minOccurs="0"/>
       </sequence>
     </extension>
   </complexContent>
 </complexType>
 


Field Summary
protected  List<Module> module
           
 
Fields inherited from class org.jomc.model.ModelObject
authors, createDate, deprecated, documentation, modelVersion
 
Constructor Summary
Modules()
          Creates a new Modules instance.
Modules(Map<Object,Instance> objects)
          Creates a new Modules instance taking a map backing the instance.
Modules(Modules o)
          Creates a new Modules instance by deeply copying a given Modules instance.
Modules(Modules o, Map<Object,Instance> objects)
          Creates a new Modules instance by deeply copying a given Modules instance taking a map backing the instance.
 
Method Summary
 Modules clone()
          Creates and returns a deep copy of this object.
 Object createObject(Instance instance, ClassLoader classLoader)
          Creates an object for a given instance from this list of modules.
 Module getClasspathModule(String moduleName, ClassLoader classLoader)
          Gets a module holding model objects resolved by inspecting a given class loader.
static String getDefaultClasspathModuleName()
          Gets the default classpath module name.
 Dependencies getDependencies(String implementation)
          Gets all dependencies of an implementation from this list of modules.
 Implementation getImplementation(Class implementation)
          Gets an implementation for a given class from this list of modules.
 Implementation getImplementation(Object object)
          Gets an implementation for a given object from this list of modules.
 Implementation getImplementation(String implementation)
          Gets an implementation for a given identifier from this list of modules.
 Implementation getImplementation(String specification, String name)
          Gets an implementation for a given name implementing a given specification from this list of modules.
 Implementations getImplementations()
          Gets all implementations declared in this list of modules.
 Implementations getImplementations(String specification)
          Gets all implementations implementing a given specification from this list of modules.
 Instance getInstance(Object object)
          Gets the instance of an object from this list of modules.
 Instance getInstance(String implementation)
          Gets an instance for an implementation from this list of modules.
 Instance getInstance(String implementation, Dependency dependency)
          Gets an instance for an implementation from this list of modules overridden with a given dependency.
 Module getMergedModule()
          Merges this list of modules to a single module.
 Messages getMessages(String implementation)
          Gets all messages of an implementation from this list of modules.
 List<Module> getModule()
          Gets the value of the module property.
 Module getModule(String name)
          Gets a module for a given name from this list of modules.
 Module getModuleOfImplementation(String implementation)
          Gets the module declaring a given implementation from this list of modules.
 Module getModuleOfSpecification(String specification)
          Gets the module declaring a given specification from this list of modules.
 Properties getProperties(String implementation)
          Gets all properties of an implementation from this list of modules.
 Specification getSpecification(Class specification)
          Gets a specification for a given class from this list of modules.
 Specification getSpecification(String specification)
          Gets a specification for a given identifier from this list of modules.
 Specifications getSpecifications()
          Gets all specifications declared in this list of modules.
 Specifications getSpecifications(String implementation)
          Gets all specifications an implementation implements from this list of modules.
 Properties getSpecifiedProperties(String implementation)
          Gets all properties specified for an implementation from this list of modules.
static void setDefaultClasspathModuleName(String value)
          Sets the default classpath module name.
 
Methods inherited from class org.jomc.model.ModelObject
getAuthors, getCreateDate, getDocumentation, getModelVersion, isDeprecated, setAuthors, setCreateDate, setDeprecated, setDocumentation, setModelVersion
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

module

@Generated(value="com.sun.tools.xjc.Driver",
           date="2009-12-07T03:06:36+00:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-833")
protected List<Module> module
Constructor Detail

Modules

public Modules()
Creates a new Modules instance.


Modules

public Modules(Modules o)
Creates a new Modules instance by deeply copying a given Modules instance.

Parameters:
o - The instance to copy.
Throws:
NullPointerException - if o is null.

Modules

public Modules(Map<Object,Instance> objects)
Creates a new Modules instance taking a map backing the instance.

Parameters:
objects - The map backing the instance.

Modules

public Modules(Modules o,
               Map<Object,Instance> objects)
Creates a new Modules instance by deeply copying a given Modules instance taking a map backing the instance.

Parameters:
o - The instance to copy.
objects - The map backing the instance.
Throws:
NullPointerException - if o or objects is null.
Method Detail

getModule

@Generated(value="com.sun.tools.xjc.Driver",
           date="2009-12-07T03:06:36+00:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-833")
public List<Module> getModule()
Gets the value of the module property.

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 JAXB object. This is why there is not a set method for the module property.

For example, to add a new item, do as follows:

    getModule().add(newItem);
 

Objects of the following type(s) are allowed in the list Module


clone

@Generated(value="com.sun.tools.xjc.Driver",
           date="2009-12-07T03:06:36+00:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-833")
public Modules clone()
Creates and returns a deep copy of this object.

Overrides:
clone in class ModelObject
Returns:
A deep copy of this object.

getDefaultClasspathModuleName

public static String getDefaultClasspathModuleName()
Gets the default classpath module name.

The default classpath module name is controlled by system property org.jomc.model.Modules.defaultClasspathModuleName holding the default classpath module name. If that property is not set, the Java Classpath default is returned.

Returns:
The default classpath module name.
See Also:
getClasspathModule(java.lang.String, java.lang.ClassLoader)

setDefaultClasspathModuleName

public static void setDefaultClasspathModuleName(String value)
Sets the default classpath module name.

Parameters:
value - The new default classpath module name or null,

getClasspathModule

public Module getClasspathModule(String moduleName,
                                 ClassLoader classLoader)
Gets a module holding model objects resolved by inspecting a given class loader.

This method searches this list of modules for unresolved references and tries to resolve each unresolved reference by inspecting the given class loader.

Parameters:
moduleName - The name of the module to return.
classLoader - The class loader to use for resolving entities or null to resolve entities using the bootstrap class loader.
Returns:
A module holding model objects resolved by inspecting the given class loader or null if nothing is resolved.
Throws:
NullPointerException - if moduleName is null.
See Also:
getDefaultClasspathModuleName(), getModule()

getModule

public Module getModule(String name)
Gets a module for a given name from this list of modules.

Parameters:
name - The name of the module to return.
Returns:
The module with name name from the list or null, if no module matching name is found.
Throws:
NullPointerException - if name is null.
See Also:
getModule()

getSpecifications

public Specifications getSpecifications()
Gets all specifications declared in this list of modules.

Returns:
All specifications declared in the list or null, if no specifications are declared.
See Also:
getModule()

getImplementations

public Implementations getImplementations()
Gets all implementations declared in this list of modules.

Returns:
All implementations declared in the list or null, if no implementations are declared.
See Also:
getModule()

getModuleOfSpecification

public Module getModuleOfSpecification(String specification)
Gets the module declaring a given specification from this list of modules.

Parameters:
specification - The identifier of the specification whose declaring module to return.
Returns:
The module declaring specification from the list or null, if no module is found declaring specification.
Throws:
NullPointerException - if specification is null.
See Also:
getModule()

getModuleOfImplementation

public Module getModuleOfImplementation(String implementation)
Gets the module declaring a given implementation from this list of modules.

Parameters:
implementation - The identifier of the implementation whose declaring module to return.
Returns:
The module declaring implementation from the list or null, if no module is found declaring implementation.
Throws:
NullPointerException - if implementation is null.
See Also:
getModule()

getSpecification

public Specification getSpecification(String specification)
Gets a specification for a given identifier from this list of modules.

Parameters:
specification - The identifier of the specification to return.
Returns:
The specification identified by specification from the list or null, if no specification matching specification is found.
Throws:
NullPointerException - if specification is null.
See Also:
getModule()

getSpecification

public Specification getSpecification(Class specification)
Gets a specification for a given class from this list of modules.

Parameters:
specification - The class of the specification to return.
Returns:
The specification identified by specification from the list or null, if no specification matching specification is found.
Throws:
NullPointerException - if specification is null.
See Also:
getModule()

getSpecifications

public Specifications getSpecifications(String implementation)
Gets all specifications an implementation implements from this list of modules.

Parameters:
implementation - The identifier of the implementation to get all implemented specifications of.
Returns:
List of all specifications implemented by implementation from the list or null, if no implementation matching implementation is found or if that implementation does not implement any specification.
Throws:
NullPointerException - if implementation is null.
See Also:
getModule()

getImplementation

public Implementation getImplementation(String implementation)
Gets an implementation for a given identifier from this list of modules.

Parameters:
implementation - The identifier of the implementation to return.
Returns:
The implementation identified by implementation from the list or null, if no implementation matching implementation is found.
Throws:
NullPointerException - if implementation is null.
See Also:
getModule()

getImplementation

public Implementation getImplementation(Class implementation)
Gets an implementation for a given class from this list of modules.

Parameters:
implementation - The class of the implementation to return.
Returns:
The implementation identified by implementation from the list or null, if no implementation matching implementation is found.
Throws:
NullPointerException - if implementation is null.
See Also:
getModule()

getImplementation

public Implementation getImplementation(Object object)
Gets an implementation for a given object from this list of modules.

Parameters:
object - The object of the implementation to return.
Returns:
The implementation identified by object from the list or null, if no implementation matching object is found.
Throws:
NullPointerException - if object is null.
See Also:
getModule()

getImplementation

public Implementation getImplementation(String specification,
                                        String name)
Gets an implementation for a given name implementing a given specification from this list of modules.

Parameters:
specification - The identifier of the specification to return an implementation of.
name - The name of the implementation to return.
Returns:
The implementation with name name implementing the specification identified by specification from the list or null, if no such implementation is found.
Throws:
NullPointerException - if specification or name is null.
See Also:
getModule()

getDependencies

public Dependencies getDependencies(String implementation)
Gets all dependencies of an implementation from this list of modules.

Parameters:
implementation - The identifier of the implementation to get all dependencies of.
Returns:
List of all dependencies of implementation from the list or null, if no dependencies are found.
Throws:
NullPointerException - if implementation is null.
See Also:
getModule()

getProperties

public Properties getProperties(String implementation)
Gets all properties of an implementation from this list of modules.

Parameters:
implementation - The identifier of the implementation to get all properties of.
Returns:
List of all properties of implementation from the list or null, if no properties are found.
Throws:
NullPointerException - if implementation is null.
See Also:
getModule()

getSpecifiedProperties

public Properties getSpecifiedProperties(String implementation)
Gets all properties specified for an implementation from this list of modules.

Parameters:
implementation - The identifier of the implementation to return specified properties of.
Returns:
List of all properties specified for implementation from the list or null, if no properties are found.
Throws:
NullPointerException - if implementation is null.
See Also:
getModule()

getMessages

public Messages getMessages(String implementation)
Gets all messages of an implementation from this list of modules.

Parameters:
implementation - The identifier of the implementation to get all messages of.
Returns:
List of all messages of implementation from the list or null, if no messages are found.
Throws:
NullPointerException - if implementation is null.
See Also:
getModule()

getImplementations

public Implementations getImplementations(String specification)
Gets all implementations implementing a given specification from this list of modules.

Parameters:
specification - The identifier of the specification to return all implementations of.
Returns:
All implementations implementing the specification identified by specification from the list or null, if no implementation implementing specification is found.
Throws:
NullPointerException - if specification is null.
See Also:
getModule()

getMergedModule

public Module getMergedModule()
Merges this list of modules to a single module.

Returns:
A module holding all model objects from the list.

getInstance

public Instance getInstance(Object object)
Gets the instance of an object from this list of modules.

Parameters:
object - The object to get the instance of.
Returns:
The instance of object from the list or null if no such instance is found.
Throws:
NullPointerException - if object is null.
See Also:
getModule(), createObject(org.jomc.model.Instance instance, java.lang.ClassLoader classLoader)

getInstance

public Instance getInstance(String implementation)
Gets an instance for an implementation from this list of modules.

Parameters:
implementation - The identifier of the implementation to get an instance for.
Returns:
An instance for the implementation identified by implementation from the list or null, if no such instance is found.
Throws:
NullPointerException - if implementation is null.
See Also:
getModule()

getInstance

public Instance getInstance(String implementation,
                            Dependency dependency)
Gets an instance for an implementation from this list of modules overridden with a given dependency.

Parameters:
implementation - The identifier of the implementation to get an instance for.
dependency - The dependency to use for overriding model objects of the instance.
Returns:
An instance for the implementation identified by implementation from the list with any model objects overridden using dependency or null, if no such instance is found.
Throws:
NullPointerException - if implementation or dependency is null.
See Also:
getModule()

createObject

public Object createObject(Instance instance,
                           ClassLoader classLoader)
                    throws InstantiationException
Creates an object for a given instance from this list of modules.

Parameters:
instance - The instance to create an object of.
classLoader - The class loader to use for creating the object or null to use the bootstrap class loader.
Returns:
A new object of instance from the list or null if no such object is found.
Throws:
NullPointerException - if instance is null,
InstantiationException - if creating an object fails.
See Also:
getModule()


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