|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Logger |
logger
The metafacade logger instance. |
Constructor Summary | |
---|---|
MetafacadeBase(Object metaObjectIn,
String contextIn)
Constructs a new instance of this class with the given metaObject
and context . |
Method Summary | |
---|---|
int |
compareTo(Object object)
Allow sorting and use in TreeSet. |
boolean |
equals(Object object)
|
protected Object |
getConfiguredProperty(String property)
Gets a configured property from the container. |
(package private) String |
getContext()
Gets the context for this metafacade. |
String |
getMetafacadeContext()
Gets the context for this metafacade. |
(package private) String |
getMetafacadeName()
Gets the name for this metafacade. |
(package private) String |
getMetafacadeNamespace()
Gets the current namespace for this metafacade |
Object |
getMetaObject()
Gets the current meta model object for this metafacade. |
String |
getValidationName()
Retrieves the name of this metafacade used within the validation messages. |
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(String property)
Returns true or false depending on whether the property is registered or not. |
(package private) boolean |
isInitialized()
Indicates if this metafacade has been initialized. |
boolean |
isMetafacadePropertyCachingEnabled()
A check to verify whether or not to make use of metafacade property caching. |
void |
resetMetafacadeContext(String contextIn)
Resets the metafacade context after the metafacade was retrieved from the metafacade cache. |
(package private) void |
setContextRoot(boolean contextRootIn)
Sets whether or not this metafacade represents a contextRoot. |
(package private) void |
setInitialized()
Sets the flag indicating this metafacade has been initialized. |
(package private) void |
setLogger(Logger loggerIn)
Package-local setter, called by facade factory. |
void |
setMetafacadeContext(String contextIn)
Sets the context for this metafacade. |
(package private) void |
setNamespace(String namespaceIn)
Sets the namespace for this metafacade. |
protected void |
setProperty(String nameIn,
Object value)
Attempts to set the property with name having the specified value on this metafacade. |
protected MetafacadeBase |
shieldedElement(Object metaObjectIn)
Returns one facade for a particular metaObject. |
protected List |
shieldedElements(Collection metaobjects)
Returns a collection of facades for a collection of metaobjects. |
protected MetafacadeBase |
THIS()
The metafacade instance of this . |
String |
toString()
|
void |
validate(Collection<ModelValidationMessage> validationMessages)
Validates that this facade's meta object is in a valid state. |
void |
validateInvariants(Collection<ModelValidationMessage> 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, wait, wait, wait |
Field Detail |
---|
protected Logger logger
protected boolean contextRoot
Constructor Detail |
---|
public MetafacadeBase(Object metaObjectIn, String contextIn)
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.
metaObjectIn
- the meta object.contextIn
- the context of this meta object.Method Detail |
---|
public 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 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.
final void setInitialized()
final boolean isInitialized()
public final void validate(Collection<ModelValidationMessage> validationMessages)
validationMessages
- any messages generated during validation.public void validateInvariants(Collection<ModelValidationMessage> messages)
messages
collection. This method is called by validate(Collection validationMessages)
By default this method is empty.
messages
- Collection of org.andromda.core.metafacade.ModelValidationMessagepublic void initialize()
protected MetafacadeBase shieldedElement(Object metaObjectIn)
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.
metaObjectIn
- the underlying meta model element. A metafacade is created for each.
MetafacadeFactory
protected List shieldedElements(Collection metaobjects)
metaobjects
- the objects to decorate
MetafacadeFactory
final String getContext()
public void setMetafacadeContext(String contextIn)
contextIn
- the metafacade interface name representing the context.MetafacadeMapping.isContextRoot()
public void resetMetafacadeContext(String contextIn)
contextIn
- the context defined by MetafacadeFactoryMetafacadeFactory
final String getMetafacadeNamespace()
final void setNamespace(String namespaceIn)
namespaceIn
- protected boolean isConfiguredProperty(String property)
property
is registered or not.
property
- the name of the property to check.
protected Object getConfiguredProperty(String property)
property
- the property name
protected void setProperty(String nameIn, Object value)
name
having the specified value
on this metafacade.
nameIn
- value
- public final 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.
final void setLogger(Logger loggerIn)
loggerIn
- the logger to setfinal void setContextRoot(boolean contextRootIn)
getMetafacadeContext()
returns the metafacade interface for this metafacade, otherwise the regular
context
is returned.
contextRootIn
- public String getMetafacadeContext()
context
for this metafacade. This is either the contextRoot
(if one exists),
or the regular context
.
final String getMetafacadeName()
public boolean equals(Object object)
equals
in class Object
Object.equals(Object)
public int hashCode()
hashCode
in class Object
Object.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).
public String toString()
toString
in class Object
Object.toString()
public int compareTo(Object object)
compareTo
in interface Comparable
Comparable.compareTo(Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |