Class ObjectModelElementImpl
- java.lang.Object
-
- org.nuiton.eugene.models.object.xml.ObjectModelElementImpl
-
- All Implemented Interfaces:
WithTagValuesOrStereotypes
,ObjectModelElement
- Direct Known Subclasses:
ObjectModelClassifierImpl
,ObjectModelOperationImpl
,ObjectModelParameterImpl
public abstract class ObjectModelElementImpl extends Object implements ObjectModelElement
ObjectModelElementImpl.- Author:
- chatellier, cedric
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>
comments
protected ObjectModelElement
declaringElement
protected String
documentation
protected Set<ObjectModelModifier>
modifiers
protected String
name
protected ObjectModelImpl
objectModelImpl
protected Map<String,String>
tagValues
-
Constructor Summary
Constructors Constructor Description ObjectModelElementImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addComment(String comment)
void
addModifier(ObjectModelModifier... modifiers)
protected void
addOrRemoveModifier(ObjectModelModifier modifier, boolean add)
void
addStereotype(String stereotype)
ObjectModelImplRef
addStereotype(ObjectModelImplRef stereotype)
void
addTagValue(String tagValue, String value)
Adds the givenvalue
associated to thetagValue
.ObjectModelImplTagValue
addTagValue(ObjectModelImplTagValue tagValue)
protected abstract Set<ObjectModelModifier>
getAuthorizedModifiers()
List<String>
getComments()
Returns all comments lied to this particular model elementObjectModelElement
getDeclaringElement()
Returns the element in which this element is defined, or null if there's none.String
getDescription()
The description of this element is the upper part of the element's documentation.String
getDocumentation()
Returns the whole documentation associated with this element (description + source documentation).ObjectModelImpl
getModel()
TODO a testerString
getName()
Returns the name of this element.String
getSourceDocumentation()
Returns the source documentation part associated with this element.Set<String>
getStereotypes()
String
getTagValue(String tagValue)
Returns the tagValue corresponding to the given name, or null if the element has no associated tagValue for this name.Map<String,String>
getTagValues()
Returns the tagValues associated with this element.boolean
hasStereotype(String stereotypeName)
boolean
hasTagValue(String tagValue)
Returns whether this element has a tagValue corresponding to the given name, or not.boolean
isStatic()
Return if this element has static declaration, only valid when getDeclaringElement is classifier.void
postInit()
protected void
removeModifier(ObjectModelModifier... modifiers)
protected void
removeModifiers(Iterable<? extends ObjectModelModifier> modifiers)
void
removeStereotype(String stereotype)
void
removeTagValue(String tagvalue)
void
setDeclaringElement(ObjectModelElement declaringElement)
void
setDocumentation(String documentation)
void
setName(String name)
void
setObjectModelImpl(ObjectModelImpl objectModelImpl)
void
setStatic(boolean isStatic)
-
-
-
Field Detail
-
objectModelImpl
protected ObjectModelImpl objectModelImpl
-
declaringElement
protected ObjectModelElement declaringElement
-
name
protected String name
-
documentation
protected String documentation
-
modifiers
protected Set<ObjectModelModifier> modifiers
-
-
Method Detail
-
setObjectModelImpl
public void setObjectModelImpl(ObjectModelImpl objectModelImpl)
- Parameters:
objectModelImpl
- the objectModelImpl
-
setDeclaringElement
public void setDeclaringElement(ObjectModelElement declaringElement)
- Parameters:
declaringElement
- the declaringElement to set
-
getModel
public ObjectModelImpl getModel()
TODO a tester- Returns:
- the objectModel
-
postInit
public void postInit()
-
setName
public void setName(String name)
-
setDocumentation
public void setDocumentation(String documentation)
-
addStereotype
public ObjectModelImplRef addStereotype(ObjectModelImplRef stereotype)
-
addTagValue
public ObjectModelImplTagValue addTagValue(ObjectModelImplTagValue tagValue)
-
addOrRemoveModifier
protected void addOrRemoveModifier(ObjectModelModifier modifier, boolean add)
-
addModifier
public void addModifier(ObjectModelModifier... modifiers)
-
removeModifiers
protected void removeModifiers(Iterable<? extends ObjectModelModifier> modifiers)
-
removeModifier
protected void removeModifier(ObjectModelModifier... modifiers)
-
getAuthorizedModifiers
protected abstract Set<ObjectModelModifier> getAuthorizedModifiers()
-
setStatic
public void setStatic(boolean isStatic)
-
addComment
public void addComment(String comment)
-
getName
public String getName()
Description copied from interface:ObjectModelElement
Returns the name of this element.- Specified by:
getName
in interfaceObjectModelElement
- Returns:
- the name of this element.
-
getDeclaringElement
public ObjectModelElement getDeclaringElement()
Description copied from interface:ObjectModelElement
Returns the element in which this element is defined, or null if there's none.- Specified by:
getDeclaringElement
in interfaceObjectModelElement
- Returns:
- the ObjectModelElement in which this element is defined, or null if there's none.
-
getDocumentation
public String getDocumentation()
Description copied from interface:ObjectModelElement
Returns the whole documentation associated with this element (description + source documentation).- Specified by:
getDocumentation
in interfaceObjectModelElement
- Returns:
- the whole documentation associated with this element.
-
getDescription
public String getDescription()
Description copied from interface:ObjectModelElement
The description of this element is the upper part of the element's documentation. The other part of the document can be accessed withObjectModelElement.getSourceDocumentation()
- Specified by:
getDescription
in interfaceObjectModelElement
- Returns:
- the description associated with this element.
-
getSourceDocumentation
public String getSourceDocumentation()
Description copied from interface:ObjectModelElement
Returns the source documentation part associated with this element. Source documentation is at end of documentation and are separated of over documentation by "--"- Specified by:
getSourceDocumentation
in interfaceObjectModelElement
- Returns:
- the source documentation part associated with this element.
-
getStereotypes
public Set<String> getStereotypes()
- Specified by:
getStereotypes
in interfaceWithTagValuesOrStereotypes
-
hasStereotype
public boolean hasStereotype(String stereotypeName)
- Specified by:
hasStereotype
in interfaceWithTagValuesOrStereotypes
-
addStereotype
public void addStereotype(String stereotype)
- Specified by:
addStereotype
in interfaceWithTagValuesOrStereotypes
-
removeStereotype
public void removeStereotype(String stereotype)
- Specified by:
removeStereotype
in interfaceWithTagValuesOrStereotypes
-
getTagValues
public Map<String,String> getTagValues()
Description copied from interface:WithTagValuesOrStereotypes
Returns the tagValues associated with this element. For each entry, the key is the name of the tagValue, the value is the value of the tagValue :-)- Specified by:
getTagValues
in interfaceWithTagValuesOrStereotypes
- Returns:
- a Map containing all tagValues associated with this element
-
getTagValue
public String getTagValue(String tagValue)
Description copied from interface:WithTagValuesOrStereotypes
Returns the tagValue corresponding to the given name, or null if the element has no associated tagValue for this name.- Specified by:
getTagValue
in interfaceWithTagValuesOrStereotypes
- Parameters:
tagValue
- tag value key- Returns:
- the value of the found tagValue, or null if the element has no associated tagValue for this name.
-
hasTagValue
public boolean hasTagValue(String tagValue)
Description copied from interface:WithTagValuesOrStereotypes
Returns whether this element has a tagValue corresponding to the given name, or not.- Specified by:
hasTagValue
in interfaceWithTagValuesOrStereotypes
- Parameters:
tagValue
- tag value name- Returns:
- a boolean indicating whether this element has a tagValue corresponding to the given name, or not.
-
removeTagValue
public void removeTagValue(String tagvalue)
- Specified by:
removeTagValue
in interfaceWithTagValuesOrStereotypes
-
addTagValue
public void addTagValue(String tagValue, String value)
Description copied from interface:WithTagValuesOrStereotypes
Adds the givenvalue
associated to thetagValue
. Note: If a previous tag value was definied, then it will be replaced.- Specified by:
addTagValue
in interfaceWithTagValuesOrStereotypes
- Parameters:
tagValue
- the name of the tag valuevalue
- the value to associate
-
isStatic
public boolean isStatic()
Description copied from interface:ObjectModelElement
Return if this element has static declaration, only valid when getDeclaringElement is classifier. Not possible for the moment to have static innerClass (from XMI 1.2 and 2.1).- Specified by:
isStatic
in interfaceObjectModelElement
- Returns:
- true if element is static
-
getComments
public List<String> getComments()
Description copied from interface:ObjectModelElement
Returns all comments lied to this particular model element- Specified by:
getComments
in interfaceObjectModelElement
- Returns:
- a List containing all comments for this element as Strings.
-
-