org.jomc.model
Class Instance

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

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public class Instance
extends ModelObject
implements Cloneable

Model of an instance. The 'Instance' type defines attributes 'identifier', 'name', 'class' and 'stateless'. Attribute 'identifier' holds an identifier uniquely identifying the instance in a set of instances. Attribute 'name' holds an identifier uniquely identifying the implementation of the specifications implemented by an instance. Attribute 'class' holds an identifier of the class of an instance. Attribute 'stateless' flags an instance stateless. An instance is build from implementations. An implementation declaring a location declares its instance located outside the scope of the model. An implementation not delcaring a class is only available during implementation inheritance processing. No instance is build from such implementations.

Java class for Instance complex type.

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

 <complexType name="Instance">
   <complexContent>
     <extension base="{http://jomc.org/model}ModelObject">
       <sequence>
         <element ref="{http://jomc.org/model}specifications" minOccurs="0"/>
         <element ref="{http://jomc.org/model}dependencies" minOccurs="0"/>
         <element ref="{http://jomc.org/model}properties" minOccurs="0"/>
         <element ref="{http://jomc.org/model}messages" minOccurs="0"/>
         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
       </sequence>
       <attribute name="identifier" use="required" type="{http://jomc.org/model}Identifier" />
       <attribute name="name" use="required" type="{http://jomc.org/model}Identifier" />
       <attribute name="class" use="required" type="{http://jomc.org/model}Identifier" />
       <attribute name="stateless" type="{http://jomc.org/model}Flag" default="false" />
     </extension>
   </complexContent>
 </complexType>
 


Field Summary
protected  List<Object> any
           
protected  String clazz
           
protected  Dependencies dependencies
           
protected  String identifier
           
protected  Messages messages
           
protected  String name
           
protected  Properties properties
           
protected  Specifications specifications
           
protected  Boolean stateless
           
 
Fields inherited from class org.jomc.model.ModelObject
authors, createDate, deprecated, documentation, MODEL_PUBLIC_ID, modelVersion
 
Constructor Summary
Instance()
          Creates a new Instance instance.
Instance(Instance o)
          Creates a new Instance instance by deeply copying a given Instance instance.
 
Method Summary
 Instance clone()
          Creates and returns a deep copy of this object.
 List<Object> getAny()
          Gets the value of the any property.
 javax.xml.bind.JAXBElement getAnyElement(String namespaceURI, String localPart)
          Deprecated. As of JOMC 1.1, please use method getAnyElement(java.lang.String, java.lang.String, java.lang.Class). This method will be removed in version 2.0.
<T> javax.xml.bind.JAXBElement<T>
getAnyElement(String namespaceURI, String localPart, Class<T> type)
          Gets a single JAXBElement matching a namespace URI and local part from the any property of the instance.
 List<javax.xml.bind.JAXBElement> getAnyElements(String namespaceURI, String localPart)
          Deprecated. As of JOMC 1.1, please use method getAnyElements(java.lang.String, java.lang.String, java.lang.Class). This method will be removed in version 2.0.
<T> List<javax.xml.bind.JAXBElement<T>>
getAnyElements(String namespaceURI, String localPart, Class<T> type)
          Gets a list containing all JAXBElements matching a namespace URI and local part from the any property of the instance.
<T> T
getAnyObject(Class<T> clazz)
          Gets a single object matching a given class from the any property of the instance.
<T> List<T>
getAnyObjects(Class<T> clazz)
          Gets a list containing all objects matching a given class from the any property of the instance.
 String getClazz()
          The identifier of the class of this instance.
 Dependencies getDependencies()
          Dependencies of this instance or null.
 Map<String,Object> getDependencyObjects()
          Gets a mapping of dependency names to objects bound to the instance.
 String getIdentifier()
          The identifier of this instance.
 Class<?> getJavaClass(ClassLoader classLoader)
          Gets the Java class of the instance for a given class loader.
 Class<?>[] getJavaClasses(ClassLoader classLoader)
          Gets the Java classes of all specifications of the instance for a given class loader.
 Constructor<?> getJavaConstructor(ClassLoader classLoader)
          Gets the Java constructor to use for creating objects of the instance.
 Method getJavaFactoryMethod(ClassLoader classLoader)
          Gets the Java method to use for creating objects of the instance.
 String getJavaFactoryMethodName()
          Gets the name of the Java method to use for creating objects of the instance.
 Class<?> getJavaProxyClass(ClassLoader classLoader)
          Gets the Java proxy class for a given class loader.
 Map<String,Map<Locale,MessageFormat>> getMessageObjects()
          Gets a mapping of message names to a mapping of locales to message format objects bound to the instance.
 Messages getMessages()
          Messages of this instance or null.
 String getName()
          The name of the implementation of the specifications implemented by this instance.
 Properties getProperties()
          Properties of this instance or null.
 Map<String,Object> getPropertyObjects()
          Gets a mapping of property names to objects bound to the instance.
 Specifications getSpecifications()
          Specifications implemented by this instance or null.
 boolean isJavaClassAssignable(ClassLoader classLoader)
          Gets a flag indicating the Java class of the instance is assignable to all Java classes of all specifications of the instance.
 boolean isStateless()
          true, if this instance does not retain state across operations.
 void setClazz(String value)
          Sets the value of the clazz property.
 void setDependencies(Dependencies value)
          Sets the value of the dependencies property.
 void setIdentifier(String value)
          Sets the value of the identifier property.
 void setMessages(Messages value)
          Sets the value of the messages property.
 void setName(String value)
          Sets the value of the name property.
 void setProperties(Properties value)
          Sets the value of the properties property.
 void setSpecifications(Specifications value)
          Sets the value of the specifications property.
 void setStateless(Boolean value)
          Sets the value of the stateless property.
 
Methods inherited from class org.jomc.model.ModelObject
getAnyElement, getAnyElement, getAnyElements, getAnyElements, getAnyObject, getAnyObjects, 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

specifications

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
protected Specifications specifications

dependencies

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
protected Dependencies dependencies

properties

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
protected Properties properties

messages

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
protected Messages messages

any

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
protected List<Object> any

identifier

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
protected String identifier

name

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
protected String name

clazz

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
protected String clazz

stateless

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
protected Boolean stateless
Constructor Detail

Instance

public Instance()
Creates a new Instance instance.


Instance

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

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

getSpecifications

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public Specifications getSpecifications()
Specifications implemented by this instance or null.

Returns:
possible object is Specifications

setSpecifications

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public void setSpecifications(Specifications value)
Sets the value of the specifications property.

Parameters:
value - allowed object is Specifications

getDependencies

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public Dependencies getDependencies()
Dependencies of this instance or null.

Returns:
possible object is Dependencies

setDependencies

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public void setDependencies(Dependencies value)
Sets the value of the dependencies property.

Parameters:
value - allowed object is Dependencies

getProperties

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public Properties getProperties()
Properties of this instance or null.

Returns:
possible object is Properties

setProperties

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public void setProperties(Properties value)
Sets the value of the properties property.

Parameters:
value - allowed object is Properties

getMessages

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public Messages getMessages()
Messages of this instance or null.

Returns:
possible object is Messages

setMessages

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public void setMessages(Messages value)
Sets the value of the messages property.

Parameters:
value - allowed object is Messages

getAny

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public List<Object> getAny()
Gets the value of the any 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 any property.

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

    getAny().add(newItem);
 

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


getIdentifier

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public String getIdentifier()
The identifier of this instance.

Returns:
possible object is String

setIdentifier

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public void setIdentifier(String value)
Sets the value of the identifier property.

Parameters:
value - allowed object is String

getName

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public String getName()
The name of the implementation of the specifications implemented by this instance.

Returns:
possible object is String

setName

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public void setName(String value)
Sets the value of the name property.

Parameters:
value - allowed object is String

getClazz

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public String getClazz()
The identifier of the class of this instance.

Returns:
possible object is String

setClazz

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public void setClazz(String value)
Sets the value of the clazz property.

Parameters:
value - allowed object is String

isStateless

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public boolean isStateless()
true, if this instance does not retain state across operations.

Returns:
possible object is Boolean

setStateless

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public void setStateless(Boolean value)
Sets the value of the stateless property.

Parameters:
value - allowed object is Boolean

clone

@Generated(value="com.sun.tools.xjc.Driver",
           date="2012-03-28T01:26:51+02:00",
           comments="JAXB RI vhudson-jaxb-ri-2.1-2")
public Instance clone()
Creates and returns a deep copy of this object.

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

getDependencyObjects

public Map<String,Object> getDependencyObjects()
Gets a mapping of dependency names to objects bound to the instance.

This method returns a reference to the live map, not a snapshot. Any modification you make to the returned map will be present inside the object.

Returns:
A mapping of dependency names to objects bound to the instance.

getMessageObjects

public Map<String,Map<Locale,MessageFormat>> getMessageObjects()
Gets a mapping of message names to a mapping of locales to message format objects bound to the instance.

This method returns a reference to the live map, not a snapshot. Any modification you make to the returned map will be present inside the object.

Returns:
A mapping of message names to a mapping of locales to message format objects bound to the instance.
Since:
1.2

getPropertyObjects

public Map<String,Object> getPropertyObjects()
Gets a mapping of property names to objects bound to the instance.

This method returns a reference to the live map, not a snapshot. Any modification you make to the returned map will be present inside the object.

Returns:
A mapping of property names to objects bound to the instance.

getJavaClass

public Class<?> getJavaClass(ClassLoader classLoader)
                      throws ClassNotFoundException
Gets the Java class of the instance for a given class loader.

Parameters:
classLoader - The class loader to get the Java class from or null, to get the Java class from the platform's bootstrap class loader.
Returns:
The Java class of the instance.
Throws:
ClassNotFoundException - if the Java class is not found.
Since:
1.2
See Also:
getClazz()

getJavaClasses

public Class<?>[] getJavaClasses(ClassLoader classLoader)
                          throws ClassNotFoundException
Gets the Java classes of all specifications of the instance for a given class loader.

Parameters:
classLoader - The class loader to get the Java classes from or null, to get the Java classes from the platform's bootstrap class loader.
Returns:
The Java classes of all specifications of the instance.
Throws:
ClassNotFoundException - if a Java class is not found.
Since:
1.2
See Also:
getSpecifications(), Specification.getClazz()

getJavaConstructor

public Constructor<?> getJavaConstructor(ClassLoader classLoader)
                                  throws ClassNotFoundException
Gets the Java constructor to use for creating objects of the instance.

Parameters:
classLoader - The class loader to get the Java class from or null, to get the Java class from the platform's bootstrap class loader.
Returns:
The public default Java constructor of the Java class of the instance or null, if that class does not declare such a constructor, is abstract or is not public.
Throws:
ClassNotFoundException - if the Java class is not found.
Since:
1.2
See Also:
getJavaClass(java.lang.ClassLoader)

getJavaFactoryMethodName

public String getJavaFactoryMethodName()
Gets the name of the Java method to use for creating objects of the instance.

Returns:
The name of the Java method to use for creating objects of the instance or null, if no such method name is supported.
Since:
1.2
See Also:
getName()

getJavaFactoryMethod

public Method getJavaFactoryMethod(ClassLoader classLoader)
                            throws ClassNotFoundException
Gets the Java method to use for creating objects of the instance.

Parameters:
classLoader - The class loader to get the Java class from or null, to get the Java class from the platform's bootstrap class loader.
Returns:
The public Java method of the Java class of the instance to use for creating objects of the instance or null, if that class does not declare such a method.
Throws:
ClassNotFoundException - if the Java class is not found.
Since:
1.2
See Also:
getJavaClass(java.lang.ClassLoader), getJavaFactoryMethodName()

isJavaClassAssignable

public boolean isJavaClassAssignable(ClassLoader classLoader)
                              throws ClassNotFoundException
Gets a flag indicating the Java class of the instance is assignable to all Java classes of all specifications of the instance.

Parameters:
classLoader - The class loader to get the Java classes from or null, to get the Java classes from the platform's bootstrap class loader.
Returns:
true, if the Java class of the instance is assignable to all Java classes of all specifications of the instance; false, if the Java class of the instance is not assignable to all Java classes of all specifications of the instance.
Throws:
ClassNotFoundException - if a Java class is not found.
Since:
1.2
See Also:
getJavaClass(java.lang.ClassLoader), getJavaClasses(java.lang.ClassLoader)

getJavaProxyClass

public Class<?> getJavaProxyClass(ClassLoader classLoader)
                           throws ClassNotFoundException
Gets the Java proxy class for a given class loader.

Parameters:
classLoader - The class loader to get the Java proxy class from or null, to get the Java proxy class from the platform's bootstrap class loader.
Returns:
The Java proxy class for classLoader or null, if the instance does not support a Java proxy class.
Throws:
ClassNotFoundException - if a Java class is not found.
Since:
1.2
See Also:
getJavaClasses(java.lang.ClassLoader)

getAnyElement

@Deprecated
public javax.xml.bind.JAXBElement getAnyElement(String namespaceURI,
                                                           String localPart)
Deprecated. As of JOMC 1.1, please use method getAnyElement(java.lang.String, java.lang.String, java.lang.Class). This method will be removed in version 2.0.

Gets a single JAXBElement matching a namespace URI and local part from the any property of the instance.

Parameters:
namespaceURI - The namespace URI of the JAXBElement to return.
localPart - The local part of the JAXBElement to return.
Returns:
The JAXBElement matching namespaceURI and localPart from the any property of the instance or null, if no such element is found.
Throws:
NullPointerException - if namespaceURI or localPart is null.
IllegalStateException - if the any property contains more than one matching element.
See Also:
ModelObject.getAnyElement(java.util.List, java.lang.String, java.lang.String)

getAnyElements

@Deprecated
public List<javax.xml.bind.JAXBElement> getAnyElements(String namespaceURI,
                                                                  String localPart)
Deprecated. As of JOMC 1.1, please use method getAnyElements(java.lang.String, java.lang.String, java.lang.Class). This method will be removed in version 2.0.

Gets a list containing all JAXBElements matching a namespace URI and local part from the any property of the instance.

Parameters:
namespaceURI - The namespace URI of the JAXBElements to return.
localPart - The local part of the JAXBElements to return.
Returns:
An unmodifiable list of all JAXBElements matching namespaceURI and localPart from the any property of the instance - an empty list if no such elements are found.
Throws:
NullPointerException - if namespaceURI or localPart is null.
See Also:
ModelObject.getAnyElements(java.util.List, java.lang.String, java.lang.String)

getAnyElement

public <T> javax.xml.bind.JAXBElement<T> getAnyElement(String namespaceURI,
                                                       String localPart,
                                                       Class<T> type)
Gets a single JAXBElement matching a namespace URI and local part from the any property of the instance.

Type Parameters:
T - The type the element is bound to.
Parameters:
namespaceURI - The namespace URI of the JAXBElement to return.
localPart - The local part of the JAXBElement to return.
type - The class of the type the element is bound to.
Returns:
The JAXBElement matching namespaceURI and localPart from the any property of the instance or null, if no such element is found.
Throws:
NullPointerException - if namespaceURI, localPart or type is null.
IllegalStateException - if the any property contains more than one matching element.
Since:
1.1
See Also:
ModelObject.getAnyElement(java.util.List, java.lang.String, java.lang.String, java.lang.Class)

getAnyElements

public <T> List<javax.xml.bind.JAXBElement<T>> getAnyElements(String namespaceURI,
                                                              String localPart,
                                                              Class<T> type)
Gets a list containing all JAXBElements matching a namespace URI and local part from the any property of the instance.

Type Parameters:
T - The type the elements are bound to.
Parameters:
namespaceURI - The namespace URI of the JAXBElements to return.
localPart - The local part of the JAXBElements to return.
type - The class of the type the elements are bound to.
Returns:
An unmodifiable list of all JAXBElements matching namespaceURI and localPart from the any property of the instance - an empty list if no such elements are found.
Throws:
NullPointerException - if namespaceURI, localPart or type is null.
Since:
1.1
See Also:
ModelObject.getAnyElements(java.util.List, java.lang.String, java.lang.String, java.lang.Class)

getAnyObject

public <T> T getAnyObject(Class<T> clazz)
Gets a single object matching a given class from the any property of the instance.

Type Parameters:
T - The type of the object to return.
Parameters:
clazz - The class to return an instance of.
Returns:
The instance of clazz from the any property of the instance or null if no such instance is found.
Throws:
NullPointerException - if clazz is null.
IllegalStateException - if the any property contains more than one matching object.
See Also:
ModelObject.getAnyObject(java.util.List, java.lang.Class)

getAnyObjects

public <T> List<T> getAnyObjects(Class<T> clazz)
Gets a list containing all objects matching a given class from the any property of the instance.

Type Parameters:
T - The type of the objects to return.
Parameters:
clazz - The class to return all instances of.
Returns:
An unmodifiable list of all instances of clazz from the any property of the instance - an empty list if no such objects are found.
Throws:
NullPointerException - if clazz is null.
See Also:
ModelObject.getAnyObjects(java.util.List, java.lang.Class)


Copyright © 2005-2012 The JOMC Project. All Rights Reserved.Get JOMC at SourceForge.net. Fast, secure and Free Open Source software downloads
Please note that this documentation is maintained by non-native english speaking authors. As such, you may encounter phrases or wordings which seem imprecise or may even have a totally different meaning to native english speaking readers than what the individual author was trying to express. If you are a native english speaking reader and find any such phrases or wordings we kindly ask you to send an email to the corresponding author and help us improve this documentation in order to avoid misunderstandings. You will find the authors' email addresses at the top of each class. Please accept our apologies for any inconvenience caused.