Class ObjectModelPackageImpl
- java.lang.Object
-
- org.nuiton.eugene.models.object.xml.ObjectModelPackageImpl
-
- All Implemented Interfaces:
WithTagValuesOrStereotypes,ObjectModelPackage
public class ObjectModelPackageImpl extends Object implements ObjectModelPackage
Created on 7/6/14.- Since:
- XXX
- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classObjectModelPackageImpl.PackageNameEqualsPredicateprotected static classObjectModelPackageImpl.PackageNameStartsWithPredicateprotected static classObjectModelPackageImpl.SimpleNameEqualsPredicate
-
Field Summary
Fields Modifier and Type Field Description protected List<String>commentsprotected Stringdocumentationprotected booleanexternprotected Predicate<ObjectModelClassifier>IS_PACKAGE_NAME_EQUALS_PREDICATEprotected Predicate<ObjectModelPackage>IS_PACKAGE_NAME_STARTS_WITH_PREDICATEprotected Stringnameprotected intnumberOfSubPackagesprotected ObjectModelImplobjectModelImplprotected ObjectModelPackageparentPackageprotected Set<String>stereotypesprotected Map<String,String>tagValues
-
Constructor Summary
Constructors Constructor Description ObjectModelPackageImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddComment(String comment)voidaddStereotype(String stereotype)ObjectModelImplRefaddStereotype(ObjectModelImplRef stereotype)voidaddTagValue(String tagValue, String value)Adds the givenvalueassociated to thetagValue.ObjectModelImplTagValueaddTagValue(ObjectModelImplTagValue tagValue)ObjectModelClassgetClass(String simpleName)Returns the class corresponding to the given qualified name, or null if the package contains no class for this simple name.Iterable<ObjectModelClass>getClasses()Returns all classes defined in this package.ObjectModelClassifiergetClassifier(String simpleName)Returns the classifier corresponding to the given simple name, or null if the package contains no classifier for this simple name.Iterable<ObjectModelClassifier>getClassifiers()Returns all classifiers defined in this package.List<String>getComments()Returns all comments not lied to a particular package elementStringgetDescription()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).ObjectModelEnumerationgetEnumeration(String simpleName)Return the enumeration corresponding to the given simple nameIterable<ObjectModelEnumeration>getEnumerations()Returns all enumerations defined in this package.ObjectModelInterfacegetInterface(String simpleName)Returns the interface corresponding to the given qualified name, or null if the package contains no interface for this simple name.Iterable<ObjectModelInterface>getInterfaces()Returns all interfaces defined in this package.StringgetName()intgetNumberOfSubPackages()Iterable<ObjectModelPackage>getPackages()Returns all packages defined in this package.ObjectModelPackagegetParentPackage()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.booleanhasClass(String simpleName)Indicates whether the package contains the class associated to the given classNamebooleanhasPackage(String packageName)Indicates whether the package contains the package associated to the given package namebooleanhasStereotype(String stereotypeName)booleanhasTagValue(String tagValue)Returns whether this element has a tagValue corresponding to the given name, or not.booleanisExtern()protected voidmergeFrom(ObjectModelPackageImpl source)protected Predicate<ObjectModelClassifier>newClassifierNameEquals(String simpleName)voidpostInit()voidremoveStereotype(String stereotype)voidremoveTagValue(String tagvalue)voidsetDocumentation(String documentation)voidsetExtern(boolean extern)voidsetName(String name)voidsetObjectModelImpl(ObjectModelImpl objectModelImpl)voidsetParentPackage(ObjectModelPackage parentPackage)
-
-
-
Field Detail
-
objectModelImpl
protected ObjectModelImpl objectModelImpl
-
extern
protected boolean extern
-
name
protected String name
-
IS_PACKAGE_NAME_EQUALS_PREDICATE
protected final Predicate<ObjectModelClassifier> IS_PACKAGE_NAME_EQUALS_PREDICATE
-
IS_PACKAGE_NAME_STARTS_WITH_PREDICATE
protected final Predicate<ObjectModelPackage> IS_PACKAGE_NAME_STARTS_WITH_PREDICATE
-
numberOfSubPackages
protected int numberOfSubPackages
-
parentPackage
protected ObjectModelPackage parentPackage
-
documentation
protected String documentation
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceObjectModelPackage- Returns:
- the name of this package.
-
getNumberOfSubPackages
public int getNumberOfSubPackages()
- Specified by:
getNumberOfSubPackagesin interfaceObjectModelPackage- Returns:
- the number of sub packages. (0 for a root package).
-
getParentPackage
public ObjectModelPackage getParentPackage()
- Specified by:
getParentPackagein interfaceObjectModelPackage- Returns:
- parent package or
nullif the package is a root package.
-
getDescription
public String getDescription()
Description copied from interface:ObjectModelPackageThe description of this element is the upper part of the element's documentation. The other part of the document can be accessed withObjectModelPackage.getSourceDocumentation()- Specified by:
getDescriptionin interfaceObjectModelPackage- Returns:
- the description associated with this element.
-
getSourceDocumentation
public String getSourceDocumentation()
Description copied from interface:ObjectModelPackageReturns 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 interfaceObjectModelPackage- 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.
-
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
-
removeTagValue
public void removeTagValue(String tagvalue)
- Specified by:
removeTagValuein interfaceWithTagValuesOrStereotypes
-
getComments
public List<String> getComments()
Description copied from interface:ObjectModelPackageReturns all comments not lied to a particular package element- Specified by:
getCommentsin interfaceObjectModelPackage- Returns:
- a List containing all comments for this package as Strings.
-
getDocumentation
public String getDocumentation()
Description copied from interface:ObjectModelPackageReturns the whole documentation associated with this element (description + source documentation).- Specified by:
getDocumentationin interfaceObjectModelPackage- Returns:
- the whole documentation associated with this element.
-
getPackages
public Iterable<ObjectModelPackage> getPackages()
Description copied from interface:ObjectModelPackageReturns all packages defined in this package.- Specified by:
getPackagesin interfaceObjectModelPackage- Returns:
- a Collection containing all ObjectModelPackages for this package.
- See Also:
ObjectModelPackage
-
hasPackage
public boolean hasPackage(String packageName)
Description copied from interface:ObjectModelPackageIndicates whether the package contains the package associated to the given package name- Specified by:
hasPackagein interfaceObjectModelPackage- Parameters:
packageName- - the name of the package to retrieve.- Returns:
- true if the package has been found.
-
getClassifiers
public Iterable<ObjectModelClassifier> getClassifiers()
Description copied from interface:ObjectModelPackageReturns all classifiers defined in this package. (Except innerClasses)- Specified by:
getClassifiersin interfaceObjectModelPackage- Returns:
- a Collection containing all ObjectModelClassifier for this package.
- See Also:
ObjectModelClassifier
-
getClassifier
public ObjectModelClassifier getClassifier(String simpleName)
Description copied from interface:ObjectModelPackageReturns the classifier corresponding to the given simple name, or null if the package contains no classifier for this simple name.- Specified by:
getClassifierin interfaceObjectModelPackage- Parameters:
simpleName- - the qualified name of the classifier to retrieve.- Returns:
- the ObjectModelClassifier of the found classifier, or null if the model contains no classifier for this simple name.
-
getClasses
public Iterable<ObjectModelClass> getClasses()
Description copied from interface:ObjectModelPackageReturns all classes defined in this package. (Except innerClasses)- Specified by:
getClassesin interfaceObjectModelPackage- Returns:
- a Collection containing all ObjectModelClass for this package.
- See Also:
ObjectModelClass
-
getClass
public ObjectModelClass getClass(String simpleName)
Description copied from interface:ObjectModelPackageReturns the class corresponding to the given qualified name, or null if the package contains no class for this simple name.- Specified by:
getClassin interfaceObjectModelPackage- Parameters:
simpleName- - the qualified name of the class to retrieve.- Returns:
- the ObjectModelClass of the found class, or null if the package contains no class for this simple name.
-
hasClass
public boolean hasClass(String simpleName)
Description copied from interface:ObjectModelPackageIndicates whether the package contains the class associated to the given className- Specified by:
hasClassin interfaceObjectModelPackage- Parameters:
simpleName- - the qualified name of the class to retrieve.- Returns:
- true if the class has been found.
-
getInterfaces
public Iterable<ObjectModelInterface> getInterfaces()
Description copied from interface:ObjectModelPackageReturns all interfaces defined in this package.- Specified by:
getInterfacesin interfaceObjectModelPackage- Returns:
- a Collection containing all ObjectModelInterface for this package.
- See Also:
ObjectModelInterface
-
getInterface
public ObjectModelInterface getInterface(String simpleName)
Description copied from interface:ObjectModelPackageReturns the interface corresponding to the given qualified name, or null if the package contains no interface for this simple name.- Specified by:
getInterfacein interfaceObjectModelPackage- Parameters:
simpleName- the qualified name of the interface to retrieve.- Returns:
- the ObjectModelInterface of the found interface, or null if the package contains no interface for this simple name.
-
getEnumerations
public Iterable<ObjectModelEnumeration> getEnumerations()
Description copied from interface:ObjectModelPackageReturns all enumerations defined in this package.- Specified by:
getEnumerationsin interfaceObjectModelPackage- Returns:
- a Collection containing all ObjectModelEnumeration for this package.
- See Also:
ObjectModelEnumeration
-
getEnumeration
public ObjectModelEnumeration getEnumeration(String simpleName)
Description copied from interface:ObjectModelPackageReturn the enumeration corresponding to the given simple name- Specified by:
getEnumerationin interfaceObjectModelPackage- Parameters:
simpleName- the fully qualified name of the enumeration to retrieve.- Returns:
- the ObjectModelEnumeration of the found enumeration or null if the package contains no enumeration for this simple name.
-
isExtern
public boolean isExtern()
-
setExtern
public void setExtern(boolean extern)
-
setDocumentation
public void setDocumentation(String documentation)
-
addComment
public void addComment(String comment)
-
addStereotype
public ObjectModelImplRef addStereotype(ObjectModelImplRef stereotype)
-
addTagValue
public ObjectModelImplTagValue addTagValue(ObjectModelImplTagValue tagValue)
-
setObjectModelImpl
public void setObjectModelImpl(ObjectModelImpl objectModelImpl)
-
setName
public void setName(String name)
-
setParentPackage
public void setParentPackage(ObjectModelPackage parentPackage)
-
postInit
public void postInit()
-
newClassifierNameEquals
protected Predicate<ObjectModelClassifier> newClassifierNameEquals(String simpleName)
-
mergeFrom
protected void mergeFrom(ObjectModelPackageImpl source)
-
-