| java.lang.Object org.andromda.core.namespace.BaseNamespaceComponent org.andromda.core.metafacade.MetafacadeMappings
Inner Class :static interface Condition | |
Method Summary | |
public void | addMapping(MetafacadeMapping mapping) Adds a MetafacadeMapping instance to the set of current mappings. | public void | addPropertyReference(String reference) Adds a language mapping reference. | static Map | getAllMetafacadeMappingInstances() Stores every metafacade mapping instance, this is used from
MetafacadeUtils.getInheritedMappingClassName(MetafacadeMapping) . | final 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. | final Class | getDefaultMetafacadeClass(String namespace) Gets the defaultMetafacadeClass, first looks for it in the namespace
mapping, if it can't find it it then takes the default mappings, setting. | 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 .
Parameters: mappingObject - the object from which to retrieve the hierarchy. | protected Collection | getMappings() Retrieves all child
MetafacadeMapping instances belonging to this
metafacade mappings instance. | public Class | getMetafacadeInterface(Class metafacadeClass) Gets the class of the metafacade interface that belongs to the given
metafacadeClass . | public MetafacadeMapping | getMetafacadeMapping(Object mappingObject, String namespace, String context, Collection stereotypes) Attempts to get the MetafacadeMapping identified by the given
mappingClass ,context and
stereotypes, from the mappings for the given namespace . | public MetafacadeMappings | getModelMetafacadeMappings(String metafacadeModelNamespace) Should be used used instead of "this", retrieves the appropriate
metafacade mappings instance based on the current model type.
Parameters: metafacadeModelNamespace - the namespace that contains a metafacade model facade implementation. | public Collection | getPropertyReferences() Gets all property references defined in this mappings instance. | public void | initialize() Initializes this mappings instance, which includes discovery of all
metafacade mappings instances on the classpath. | public static MetafacadeMappings | newInstance() Constructs a new instance of this class. | final void | registerAllProperties() Registers all namespace properties in the shared
MetafacadeFactory instance. | final void | registerProperties(String namespace, Collection propertyReferences, String metafacadeName) Registers the defined property references properties in the metafacade
factory. | public void | setDefaultMetafacadeClass(String defaultMetafacadeClass) Sets the default metafacade class to use if no other is found for the
mapping class. | public void | setMetaclassPattern(String metaclassPattern) Sets the pattern of the metaclass implementations based on a metaclass
interface name. | final void | shutdown() Performs shutdown procedures for the factory. | public String | toString() |
addMapping | public void addMapping(MetafacadeMapping mapping)(Code) | | Adds a MetafacadeMapping instance to the set of current mappings.
Parameters: mapping - the MetafacadeMapping instance. |
addPropertyReference | public void addPropertyReference(String reference)(Code) | | Adds a language mapping reference. This are used to populate metafacade
impl classes with mapping files (such as those that map from model types
to Java, JDBC, SQL types, etc). If its added here as opposed to each
child MetafacadeMapping, then the reference will apply to all mappings.
Parameters: reference - the name of the reference. |
getContextHierarchy | final protected List getContextHierarchy(String context)(Code) | | Retrieves all inherited contexts (including the root 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.
Parameters: context - the root contexts a list containing all inherited contexts |
getDefaultMetafacadeClass | final Class getDefaultMetafacadeClass(String namespace)(Code) | | Gets the defaultMetafacadeClass, first looks for it in the namespace
mapping, if it can't find it it then takes the default mappings, setting.
Returns the defaultMetafacadeClass. |
getMapping | protected MetafacadeMapping getMapping(Object mappingObject, String context, Collection stereotypes)(Code) | | Retrieves the MetafacadeMapping belonging to the unique
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:
- A single stereotype no context
- A single stereotype with a context
- metafacade properties no context
- metafacade properties with a context
- multiple stereotypes no context
- multiple stereotypes with a context
NOTE: mapping properties are inherited from super metafacades.
Parameters: mappingObject - an instance of the class to which the mappingapplies. Parameters: stereotypes - the stereotypes to check. Parameters: context - the context within the namespace for which the mappingapplies (has 'root' in the name because of the fact that we alsosearch the context inheritance hiearchy started with this 'root'context). MetafacadeMapping (or null if none was found matching thecriteria). |
getMappingObjectHierarchy | protected List getMappingObjectHierarchy(Object mappingObject)(Code) | | Retrieves the hiearchy of class names of the given
mappingObject .
Parameters: mappingObject - the object from which to retrieve the hierarchy. a list containing all inherited class names. |
getMetafacadeInterface | public Class getMetafacadeInterface(Class metafacadeClass)(Code) | | Gets the class of the metafacade interface that belongs to the given
metafacadeClass .
the metafacade interface Class. |
getMetafacadeMapping | public MetafacadeMapping getMetafacadeMapping(Object mappingObject, String namespace, String context, Collection stereotypes)(Code) | | Attempts to get the MetafacadeMapping identified by the given
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. Parameters: namespace - the namespace (i.e. a cartridge, name, etc.) Parameters: context - to which the mapping applies (note this takes precendence over stereotypes). Parameters: stereotypes - collection of sterotype names. We'll check to see if the mapping for the givenmappingClass is defined for it. |
getModelMetafacadeMappings | public MetafacadeMappings getModelMetafacadeMappings(String metafacadeModelNamespace)(Code) | | Should be used used instead of "this", retrieves the appropriate
metafacade mappings instance based on the current model type.
Parameters: metafacadeModelNamespace - the namespace that contains a metafacade model facade implementation. the MetafacadeMappings instance. |
getPropertyReferences | public Collection getPropertyReferences()(Code) | | Gets all property references defined in this mappings instance.
the map of property references (names and values). |
initialize | public void initialize()(Code) | | Initializes this mappings instance, which includes discovery of all
metafacade mappings instances on the classpath.
|
newInstance | public static MetafacadeMappings newInstance()(Code) | | Constructs a new instance of this class.
MetafacadeMappings |
registerAllProperties | final void registerAllProperties()(Code) | | Registers all namespace properties in the shared
MetafacadeFactory instance.
|
registerProperties | final void registerProperties(String namespace, Collection propertyReferences, String metafacadeName)(Code) | | Registers the defined property references properties in the metafacade
factory.
Parameters: propertyReferences - the property references to register. Parameters: metafacadeName - the name of the metafacade under which to registerthe properties. Parameters: namespace - the namespace of the property reference. |
setDefaultMetafacadeClass | public void setDefaultMetafacadeClass(String defaultMetafacadeClass)(Code) | | Sets the default metafacade class to use if no other is found for the
mapping class.
Parameters: defaultMetafacadeClass - the default metafacade class. |
setMetaclassPattern | public void setMetaclassPattern(String metaclassPattern)(Code) | | Sets the pattern of the metaclass implementations based on a metaclass
interface name. This should only be set on a metafacade mappings
instances that is marked as shared.
Parameters: metaclassPattern - the pattern for the meta classes. |
|
|