|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.andromda.core.namespace.BaseNamespaceComponent
org.andromda.core.metafacade.MetafacadeMappings
The Metafacade mapping class. Used to map metafacade objects
to metamodel objects.
MetafacadeMapping,
XmlObjectFactory| Field Summary | |
protected Collection |
inProcessMappings
Stores the mappings which are currently "in process" (within the getMapping(Object, String, Collection). |
protected Collection |
inProcessMetafacades
Stores the metafacades which are currently "in process" (within the getMapping(Object, String, Collection). |
| Constructor Summary | |
MetafacadeMappings()
|
|
| Method Summary | |
void |
addMapping(MetafacadeMapping mapping)
Adds a MetafacadeMapping instance to the set of current mappings. |
void |
addPropertyReference(String reference)
Adds a language mapping reference. |
protected List |
getContextHierarchy(String context)
Retrieves all inherited contexts (including the root context)
from the given context and returns a list containing all
of them. |
protected MetafacadeMapping |
getMapping(Object mappingObject,
String context,
Collection stereotypes)
Retrieves the MetafacadeMapping belonging to the unique key created from the mappingObject's
class, context and given stereotypes. |
protected List |
getMappingObjectHierarchy(Object mappingObject)
Retrieves the hiearchy of class names of the given mappingObject. |
protected Collection |
getMappings()
Retrieves all child MetafacadeMapping instances belonging to this
metafacade mappings instance. |
Class |
getMetafacadeInterface(Class metafacadeClass)
Gets the class of the metafacade interface that belongs to the given metafacadeClass. |
MetafacadeMapping |
getMetafacadeMapping(Object mappingObject,
String namespace,
String context,
Collection stereotypes)
Attempts to get the MetafacadeMapping identified by the given mappingClass,context and
stereotypes |
MetafacadeMappings |
getModelMetafacadeMappings(String metafacadeModelNamespace)
Should be used used instead of "this", retrieves the appropriate metafacade mappings instance based on the current model type. |
Collection |
getPropertyReferences()
Gets all property references defined in this mappings instance. |
void |
initialize()
Initializes this mappings instance, which includes discovery of all metafacade mappings instances on the classpath. |
static MetafacadeMappings |
newInstance()
Constructs a new instance of this class. |
void |
setDefaultMetafacadeClass(String defaultMetafacadeClass)
Sets the default metafacade class to use if no other is found for the mapping class. |
void |
setMetaclassPattern(String metaclassPattern)
Sets the pattern of the metaclass implementations based on a metaclass interface name. |
String |
toString()
|
| Methods inherited from class org.andromda.core.namespace.BaseNamespaceComponent |
getNamespace, getResource, setNamespace, setResource |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected final Collection inProcessMappings
Stores the mappings which are currently "in process" (within the
getMapping(Object, String, Collection). This means the mapping
is being processed by the getMapping(Object, String, Collection)
operation. We store these "in process" mappings in order to keep track of
the mappings currently being evaluated so we avoid stack over flow errors
getMapping(Object, String, Collection)when finding mappings
that are mapped to super metafacade properties.
Note: visibility is defined as protected in order to
improve inner class access performance.
protected final Collection inProcessMetafacades
Stores the metafacades which are currently "in process" (within the
getMapping(Object, String, Collection). This means the
metafacade being processed by the getMapping(Object, String,
Collection)operation. We store these "in process" metafacades in order
to keep track of the metafacades currently being evaluated so we avoid
stack over flow errors getMapping(Object, String, Collection)when
finding metafacades that are mapped to super metafacade properties.
Note: visibility is defined as protected in order to
improve inner class access performance.
| Constructor Detail |
public MetafacadeMappings()
| Method Detail |
public static MetafacadeMappings newInstance()
public void addMapping(MetafacadeMapping mapping)
mapping - the MetafacadeMapping instance.public Class getMetafacadeInterface(Class metafacadeClass)
metafacadeClass.
public Collection getPropertyReferences()
protected MetafacadeMapping getMapping(Object mappingObject,
String context,
Collection stereotypes)
key created from the mappingObject's
class, context and given stereotypes. It's
IMPORTANT to note that contexts have a higher priority
than stereotypes. This allows us to retrieve mappings based on the
following combinations:
mappingObject - an instance of the class to which the mapping
applies.stereotypes - the stereotypes to check.context - the context within the namespace for which the mapping
applies (has 'root' in the name because of the fact that we also
search the context inheritance hiearchy started with this 'root'
context).
protected List getMappingObjectHierarchy(Object mappingObject)
mappingObject.
mappingObject - the object from which to retrieve the hierarchy.
protected final List getContextHierarchy(String context)
context)
from the given context and returns a list containing all
of them. Note that the visibilty of this operation is protected to
improve inner class access performance.
context - the root contexts
public void addPropertyReference(String reference)
reference - the name of the reference.
public MetafacadeMapping getMetafacadeMapping(Object mappingObject,
String namespace,
String context,
Collection stereotypes)
mappingClass,context and
stereotypes, from the mappings for the given namespace. If it can not
be found, it will search the default mappings and return that instead.
IMPORTANT: The context will take precedence over any stereotypes with
the mapping.
- Parameters:
mappingObject - the meta object for the mapping we are trying to find.namespace - the namespace (i.e. a cartridge, name, etc.)context - to which the mapping applies (note this takes precendence over stereotypes).stereotypes - collection of sterotype names. We'll check to see if the mapping for the given
mappingClass is defined for it.
public void initialize()
public void setMetaclassPattern(String metaclassPattern)
metaclassPattern - the pattern for the meta classes.public MetafacadeMappings getModelMetafacadeMappings(String metafacadeModelNamespace)
metafacadeModelNamespace - the namespace that contains a metafacade model facade implementation.
MetafacadeMappings instance.public void setDefaultMetafacadeClass(String defaultMetafacadeClass)
defaultMetafacadeClass - the default metafacade class.protected Collection getMappings()
MetafacadeMapping instances belonging to this
metafacade mappings instance.
MetafacadeMapping instancespublic String toString()
Object.toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||