|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.andromda.core.metafacade.MetafacadeBase
public class MetafacadeBase
Base class for all metafacades.
| Field Summary | |
|---|---|
protected boolean |
contextRoot
The flag indicating whether or not this metafacade is a context root. |
protected org.apache.log4j.Logger |
logger
The metafacade logger instance. |
| Constructor Summary | |
|---|---|
MetafacadeBase(java.lang.Object metaObject,
java.lang.String context)
Constructs a new instance of this class with the given metaObject
and context. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object object)
|
protected java.lang.Object |
getConfiguredProperty(java.lang.String property)
Gets a configured property from the container. |
java.lang.String |
getMetafacadeContext()
Gets the context for this metafacade. |
java.lang.Object |
getMetaObject()
Gets the current meta model object for this metafacade. |
java.lang.String |
getValidationName()
Retrieves the name of this metafacade used within the validation messages. |
java.lang.Object |
getValidationOwner()
Retrieves the owner of this metafacade (for example: an operation owns its parameters, a class owns
its attributes). |
int |
hashCode()
|
void |
initialize()
A lifecycle method, providing the ability for sub classes to take any action after the factory has completely initialized a metafacade, but before it has been validated for completeness. |
protected boolean |
isConfiguredProperty(java.lang.String property)
Returns true or false depending on whether the property is registered or not. |
boolean |
isMetafacadePropertyCachingEnabled()
A check to verify whether or not to make use of metafacade property caching. |
void |
resetMetafacadeContext(java.lang.String context)
Resets the metafacade context after the metafacade was retrieved from the metafacade cache. |
void |
setMetafacadeContext(java.lang.String context)
Sets the context for this metafacade. |
protected void |
setProperty(java.lang.String name,
java.lang.Object value)
Attempts to set the property with name having the specified value on this metafacade. |
protected MetafacadeBase |
shieldedElement(java.lang.Object metaObject)
Returns one facade for a particular metaObject. |
protected java.util.Collection |
shieldedElements(java.util.Collection metaobjects)
Returns a collection of facades for a collection of metaobjects. |
protected MetafacadeBase |
THIS()
The metafacade instance of this. |
void |
validate(java.util.Collection validationMessages)
Validates that this facade's meta object is in a valid state. |
void |
validateInvariants(java.util.Collection messages)
The logic of modeled OCL invariants from derived metafacades will be generated into this method and validation messages created and collected into the messages collection. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.log4j.Logger logger
protected boolean contextRoot
| Constructor Detail |
|---|
public MetafacadeBase(java.lang.Object metaObject,
java.lang.String context)
metaObject
and context. The metaObject is the meta model element which
this metafacade insulates. The context is the name of the
context for this metafacade instance.
metaObject - the meta object.context - the context of this meta object.| Method Detail |
|---|
public java.lang.Object getValidationOwner()
owner of this metafacade (for example: an operation owns its parameters, a class owns
its attributes).
By default null is returned, however this method is overridden by subclasses which have a
parent or owner. This is used to give the model validation messages more context as to
where the validation error occurred.
public java.lang.String getValidationName()
name of this metafacade used within the validation messages.
By default null is returned, however this method is overridden by subclasses model elements that do
have a name.
public final void validate(java.util.Collection validationMessages)
validationMessages - any messages generated during validation.MetafacadeFactory.createMetafacade(Object, String, Class)public void validateInvariants(java.util.Collection messages)
messages collection. This method is called by validate(Collection)
By default this method is empty.
public void initialize()
protected MetafacadeBase shieldedElement(java.lang.Object metaObject)
metaObject can also be a metafacade instance; in that case the actual
meta model element is retrieved from the metafacade and a metafacade is constructed from that.
metaObject - the underlying meta model element. A metafacade is created for each.
MetafacadeFactoryprotected java.util.Collection shieldedElements(java.util.Collection metaobjects)
metaobjects - the objects to decorate
MetafacadeFactorypublic void setMetafacadeContext(java.lang.String context)
context - the metafacade interface name representing the context.MetafacadeMapping.isContextRoot(),
MetafacadeFactory.createMetafacade(Object, String, Class)public void resetMetafacadeContext(java.lang.String context)
context - the context defined by MetafacadeFactoryMetafacadeFactoryprotected boolean isConfiguredProperty(java.lang.String property)
property is registered or not.
property - the name of the property to check.
protected java.lang.Object getConfiguredProperty(java.lang.String property)
property - the property name
protected void setProperty(java.lang.String name,
java.lang.Object value)
name having the specified value on this metafacade.
public final java.lang.Object getMetaObject()
MetafacadeFactory when
attempting to construct a metafacade from a metafacade. This allows us to get the meta object for this metafacade
so that the meta object can be used instead.
public java.lang.String getMetafacadeContext()
context for this metafacade. This is either the contextRoot (if one exists),
or the regular context.
setContextRoot(boolean)public boolean equals(java.lang.Object object)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public final boolean isMetafacadePropertyCachingEnabled()
MetafacadeProperties.ENABLE_METAFACADE_PROPERTY_CACHING namespace property has been set, if this is not the case
then the caching will be enabled by default.
protected final MetafacadeBase THIS()
this. This should be used when
you'd need to check if this was an instance of a given metafacade.
For example: THIS() instanceof SomeMetafacade.
This MUST be used instead of this in order to access the correct
metafacade instance in the hierarchy (since we use delegate inheritance).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||