|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.andromda.core.metafacade.MetafacadeFactory
public class MetafacadeFactory
The factory in charge of constructing Metafacade instances. In order for a metafacade (i.e. a facade around a meta model element) to be constructed, it must be constructed through this factory.
| Method Summary | |
|---|---|
void |
clearCaches()
Clears out the factory's internal caches (other than namespace properties, which can be cleared by calling Namespaces.clear(). |
MetafacadeBase |
createFacadeImpl(String interfaceName,
Object mappingObject,
String context)
Create a facade implementation object for a mappingObject. |
MetafacadeBase |
createMetafacade(Object mappingObject)
Returns a metafacade for a mappingObject, depending on its mappingClass. |
protected MetafacadeBase |
createMetafacade(Object mappingObject,
MetafacadeMapping mapping)
Creates a metafacade from the passed in mappingObject, and
mapping instance. |
MetafacadeBase |
createMetafacade(Object mappingObject,
String context)
Returns a metafacade for a mappingObject, depending on its mappingClass and (optionally) its stereotypes
and context. |
Collection<MetafacadeBase> |
createMetafacades(Collection mappingObjects)
Returns a metafacade for each mappingObject, contained within the mappingObjects collection depending on its
mappingClass. |
protected Collection<MetafacadeBase> |
createMetafacades(Collection mappingObjects,
String contextName)
Returns a metafacade for each mappingObject, contained within the mappingObjects collection depending on its
mappingClass and (optionally) its stereotypes,
and contextName. |
Collection<MetafacadeBase> |
getAllMetafacades()
Gets all metafacades for the entire model for the current namespace set within the factory. |
static MetafacadeFactory |
getInstance()
Returns the facade factory singleton. |
(package private) Logger |
getLogger()
Gets the correct logger based on whether or not an namespace logger should be used |
Collection<MetafacadeBase> |
getMetafacadesByStereotype(String stereotype)
Gets all metafacades for the entire model having the given stereotype. |
ModelAccessFacade |
getModel()
Gets the model which provides access to the underlying model and is used to construct metafacades. |
String |
getNamespace()
Returns the name of the active namespace. |
(package private) Object |
getRegisteredProperty(MetafacadeBase metafacade,
String name)
Gets the registered property registered under the namespace
with the name |
List<ModelValidationMessage> |
getValidationMessages()
Gets the list of all validation messages collection during model processing. |
void |
initialize()
Performs any initialization required by the factory (i.e. |
(package private) boolean |
isPropertyRegistered(MetafacadeBase metafacade,
String name)
Returns true if this property is registered under the given namespace, false otherwise. |
(package private) void |
registerProperty(String metafacadeName,
String name,
Object value)
Registers a property with the specified name in the namespace
that is currently set within the factory. |
(package private) void |
registerProperty(String namespace,
String metafacadeName,
String name,
Object value)
Registers a property with the specified name in the given
namespace. |
void |
reset()
Entirely resets all the internal resources within this factory instance (such as the caches, etc). |
void |
setModel(ModelAccessFacade model,
String metafacadeModelNamespace)
The model access facade instance (provides access to the meta model). |
void |
setNamespace(String namespace)
Sets the active namespace. |
void |
shutdown()
Performs shutdown procedures for the factory. |
void |
validateAllMetafacades()
Validates all metafacades for the current namespace and collects the messages in the internal validation messages collection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static MetafacadeFactory getInstance()
public void initialize()
metafacade mappings, etc).
public void setNamespace(String namespace)
namespace - the name of the active namespace.public String getNamespace()
public MetafacadeBase createMetafacade(Object mappingObject,
String context)
mappingClass and (optionally) its stereotypes
and context.
mappingObject - the object used to map the metafacade (a meta model
object or a metafacade itself).context - the name of the context the meta model element is
registered under.
public void validateAllMetafacades()
getValidationMessages()
protected MetafacadeBase createMetafacade(Object mappingObject,
MetafacadeMapping mapping)
mappingObject, and
mapping instance.
mappingObject - the mapping object for which to create the
metafacade.mapping - the mapping from which to create the metafacade
public MetafacadeBase createMetafacade(Object mappingObject)
mappingClass.
mappingObject - the object which is used to map to the metafacade
public MetafacadeBase createFacadeImpl(String interfaceName,
Object mappingObject,
String context)
interfaceName.
interfaceName - the name of the interface that the implementation
object has to implementmappingObject - the mappingObject for which a facade shall be
createdcontext - the context in which this metafacade will be created.
protected Collection<MetafacadeBase> createMetafacades(Collection mappingObjects,
String contextName)
mappingObjects collection depending on its
mappingClass and (optionally) its stereotypes,
and contextName.
mappingObjects - the meta model element.contextName - the name of the context the meta model element is
registered under.
public Collection<MetafacadeBase> createMetafacades(Collection mappingObjects)
mappingObjects collection depending on its
mappingClass.
mappingObjects - the objects used to map the metafacades (can be a
meta model element or an actual metafacade itself).
public ModelAccessFacade getModel()
public void setModel(ModelAccessFacade model,
String metafacadeModelNamespace)
model - the modelmetafacadeModelNamespace - the namespace that contains the metafacade facade implementation.final Logger getLogger()
final void registerProperty(String namespace,
String metafacadeName,
String name,
Object value)
name in the given
namespace.
namespace - the namespace in which the property is stored.metafacadeName - the name of the metafacade under which the property is registeredname - the name of the propertyvalue - to give the property
final void registerProperty(String metafacadeName,
String name,
Object value)
name in the namespace
that is currently set within the factory.
metafacadeName - the name of the metafacade under which the property is registeredname - the name of the propertyvalue - to give the property
final boolean isPropertyRegistered(MetafacadeBase metafacade,
String name)
namespace, false otherwise.
metafacade - the metafacade to search.name - the name of the property.
final Object getRegisteredProperty(MetafacadeBase metafacade,
String name)
namespace
with the name
metafacade - the metafacade to searchname - the name of the property to check.
public List<ModelValidationMessage> getValidationMessages()
validateAllMetafacades()public Collection<MetafacadeBase> getAllMetafacades()
Gets all metafacades for the entire model for the current namespace set within the factory.
NOTE: The model package filter is applied before returning the results (if defined within the factory).
public Collection<MetafacadeBase> getMetafacadesByStereotype(String stereotype)
Gets all metafacades for the entire model having the given stereotype.
NOTE: The model package filter is applied before returning the results (if defined within the factory).
stereotype - the stereotype by which to perform the search.
stereotype.public void shutdown()
public void reset()
public void clearCaches()
Namespaces.clear().
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||