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>commentsprotected ObjectModelElementdeclaringElementprotected Stringdocumentationprotected Set<ObjectModelModifier>modifiersprotected Stringnameprotected ObjectModelImplobjectModelImplprotected 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 voidaddComment(String comment)voidaddModifier(ObjectModelModifier... modifiers)protected voidaddOrRemoveModifier(ObjectModelModifier modifier, boolean add)voidaddStereotype(String stereotype)ObjectModelImplRefaddStereotype(ObjectModelImplRef stereotype)voidaddTagValue(String tagValue, String value)Adds the givenvalueassociated to thetagValue.ObjectModelImplTagValueaddTagValue(ObjectModelImplTagValue tagValue)protected abstract Set<ObjectModelModifier>getAuthorizedModifiers()List<String>getComments()Returns all comments lied to this particular model elementObjectModelElementgetDeclaringElement()Returns the element in which this element is defined, or null if there's none.StringgetDescription()The description of this element is the upper part of the element's documentation.StringgetDocumentation()Returns the whole documentation associated with this element (description + source documentation).ObjectModelImplgetModel()TODO a testerStringgetName()Returns the name of this element.StringgetSourceDocumentation()Returns the source documentation part associated with this element.Set<String>getStereotypes()StringgetTagValue(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.booleanhasStereotype(String stereotypeName)booleanhasTagValue(String tagValue)Returns whether this element has a tagValue corresponding to the given name, or not.booleanisStatic()Return if this element has static declaration, only valid when getDeclaringElement is classifier.voidpostInit()protected voidremoveModifier(ObjectModelModifier... modifiers)protected voidremoveModifiers(Iterable<? extends ObjectModelModifier> modifiers)voidremoveStereotype(String stereotype)voidremoveTagValue(String tagvalue)voidsetDeclaringElement(ObjectModelElement declaringElement)voidsetDocumentation(String documentation)voidsetName(String name)voidsetObjectModelImpl(ObjectModelImpl objectModelImpl)voidsetStatic(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:ObjectModelElementReturns the name of this element.- Specified by:
getNamein interfaceObjectModelElement- Returns:
- the name of this element.
-
getDeclaringElement
public ObjectModelElement getDeclaringElement()
Description copied from interface:ObjectModelElementReturns the element in which this element is defined, or null if there's none.- Specified by:
getDeclaringElementin interfaceObjectModelElement- Returns:
- the ObjectModelElement in which this element is defined, or null if there's none.
-
getDocumentation
public String getDocumentation()
Description copied from interface:ObjectModelElementReturns the whole documentation associated with this element (description + source documentation).- Specified by:
getDocumentationin interfaceObjectModelElement- Returns:
- the whole documentation associated with this element.
-
getDescription
public String getDescription()
Description copied from interface:ObjectModelElementThe 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:
getDescriptionin interfaceObjectModelElement- Returns:
- the description associated with this element.
-
getSourceDocumentation
public String getSourceDocumentation()
Description copied from interface:ObjectModelElementReturns the source documentation part associated with this element. Source documentation is at end of documentation and are separated of over documentation by "--"- Specified by:
getSourceDocumentationin interfaceObjectModelElement- Returns:
- the source documentation part associated with this element.
-
getStereotypes
public Set<String> getStereotypes()
- Specified by:
getStereotypesin interfaceWithTagValuesOrStereotypes
-
hasStereotype
public boolean hasStereotype(String stereotypeName)
- Specified by:
hasStereotypein interfaceWithTagValuesOrStereotypes
-
addStereotype
public void addStereotype(String stereotype)
- Specified by:
addStereotypein interfaceWithTagValuesOrStereotypes
-
removeStereotype
public void removeStereotype(String stereotype)
- Specified by:
removeStereotypein interfaceWithTagValuesOrStereotypes
-
getTagValues
public Map<String,String> getTagValues()
Description copied from interface:WithTagValuesOrStereotypesReturns 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:
getTagValuesin interfaceWithTagValuesOrStereotypes- Returns:
- a Map containing all tagValues associated with this element
-
getTagValue
public String getTagValue(String tagValue)
Description copied from interface:WithTagValuesOrStereotypesReturns the tagValue corresponding to the given name, or null if the element has no associated tagValue for this name.- Specified by:
getTagValuein 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:WithTagValuesOrStereotypesReturns whether this element has a tagValue corresponding to the given name, or not.- Specified by:
hasTagValuein 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:
removeTagValuein interfaceWithTagValuesOrStereotypes
-
addTagValue
public void addTagValue(String tagValue, String value)
Description copied from interface:WithTagValuesOrStereotypesAdds the givenvalueassociated to thetagValue. Note: If a previous tag value was definied, then it will be replaced.- Specified by:
addTagValuein interfaceWithTagValuesOrStereotypes- Parameters:
tagValue- the name of the tag valuevalue- the value to associate
-
isStatic
public boolean isStatic()
Description copied from interface:ObjectModelElementReturn 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:
isStaticin interfaceObjectModelElement- Returns:
- true if element is static
-
getComments
public List<String> getComments()
Description copied from interface:ObjectModelElementReturns all comments lied to this particular model element- Specified by:
getCommentsin interfaceObjectModelElement- Returns:
- a List containing all comments for this element as Strings.
-
-