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 - chemit@codelutin.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ObjectModelPackageImpl.PackageNameEqualsPredicate
protected static class
ObjectModelPackageImpl.PackageNameStartsWithPredicate
protected static class
ObjectModelPackageImpl.SimpleNameEqualsPredicate
-
Field Summary
Fields Modifier and Type Field Description protected List<String>
comments
protected String
documentation
protected boolean
extern
protected com.google.common.base.Predicate<ObjectModelClassifier>
IS_PACKAGE_NAME_EQUALS_PREDICATE
protected com.google.common.base.Predicate<ObjectModelPackage>
IS_PACKAGE_NAME_STARTS_WITH_PREDICATE
protected String
name
protected int
numberOfSubPackages
protected ObjectModelImpl
objectModelImpl
protected ObjectModelPackage
parentPackage
protected Set<String>
stereotypes
protected Map<String,String>
tagValues
-
Constructor Summary
Constructors Constructor Description ObjectModelPackageImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addComment(String comment)
void
addStereotype(String stereotype)
ObjectModelImplRef
addStereotype(ObjectModelImplRef stereotype)
void
addTagValue(String tagValue, String value)
Adds the givenvalue
associated to thetagValue
.ObjectModelImplTagValue
addTagValue(ObjectModelImplTagValue tagValue)
ObjectModelClass
getClass(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.ObjectModelClassifier
getClassifier(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 elementString
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).ObjectModelEnumeration
getEnumeration(String simpleName)
Return the enumeration corresponding to the given simple nameIterable<ObjectModelEnumeration>
getEnumerations()
Returns all enumerations defined in this package.ObjectModelInterface
getInterface(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.String
getName()
int
getNumberOfSubPackages()
Iterable<ObjectModelPackage>
getPackages()
Returns all packages defined in this package.ObjectModelPackage
getParentPackage()
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
hasClass(String simpleName)
Indicates whether the package contains the class associated to the given classNameboolean
hasPackage(String packageName)
Indicates whether the package contains the package associated to the given package nameboolean
hasStereotype(String stereotypeName)
boolean
hasTagValue(String tagValue)
Returns whether this element has a tagValue corresponding to the given name, or not.boolean
isExtern()
protected com.google.common.base.Predicate<ObjectModelClassifier>
newClassifierNameEquals(String simpleName)
void
postInit()
void
removeStereotype(String stereotype)
void
removeTagValue(String tagvalue)
void
setDocumentation(String documentation)
void
setExtern(boolean extern)
void
setName(String name)
void
setObjectModelImpl(ObjectModelImpl objectModelImpl)
void
setParentPackage(ObjectModelPackage parentPackage)
-
-
-
Field Detail
-
objectModelImpl
protected ObjectModelImpl objectModelImpl
-
extern
protected boolean extern
-
name
protected String name
-
numberOfSubPackages
protected int numberOfSubPackages
-
parentPackage
protected ObjectModelPackage parentPackage
-
documentation
protected String documentation
-
IS_PACKAGE_NAME_EQUALS_PREDICATE
protected final com.google.common.base.Predicate<ObjectModelClassifier> IS_PACKAGE_NAME_EQUALS_PREDICATE
-
IS_PACKAGE_NAME_STARTS_WITH_PREDICATE
protected final com.google.common.base.Predicate<ObjectModelPackage> IS_PACKAGE_NAME_STARTS_WITH_PREDICATE
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceObjectModelPackage
- Returns:
- the name of this package.
-
getNumberOfSubPackages
public int getNumberOfSubPackages()
- Specified by:
getNumberOfSubPackages
in interfaceObjectModelPackage
- Returns:
- the number of sub packages. (0 for a root package).
-
getParentPackage
public ObjectModelPackage getParentPackage()
- Specified by:
getParentPackage
in interfaceObjectModelPackage
- Returns:
- parent package or
null
if the package is a root package.
-
getDescription
public String getDescription()
Description copied from interface:ObjectModelPackage
The 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:
getDescription
in interfaceObjectModelPackage
- Returns:
- the description associated with this element.
-
getSourceDocumentation
public String getSourceDocumentation()
Description copied from interface:ObjectModelPackage
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 interfaceObjectModelPackage
- 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.
-
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
-
removeTagValue
public void removeTagValue(String tagvalue)
- Specified by:
removeTagValue
in interfaceWithTagValuesOrStereotypes
-
getComments
public List<String> getComments()
Description copied from interface:ObjectModelPackage
Returns all comments not lied to a particular package element- Specified by:
getComments
in interfaceObjectModelPackage
- Returns:
- a List containing all comments for this package as Strings.
-
getDocumentation
public String getDocumentation()
Description copied from interface:ObjectModelPackage
Returns the whole documentation associated with this element (description + source documentation).- Specified by:
getDocumentation
in interfaceObjectModelPackage
- Returns:
- the whole documentation associated with this element.
-
getPackages
public Iterable<ObjectModelPackage> getPackages()
Description copied from interface:ObjectModelPackage
Returns all packages defined in this package.- Specified by:
getPackages
in interfaceObjectModelPackage
- Returns:
- a Collection containing all ObjectModelPackages for this package.
- See Also:
ObjectModelPackage
-
hasPackage
public boolean hasPackage(String packageName)
Description copied from interface:ObjectModelPackage
Indicates whether the package contains the package associated to the given package name- Specified by:
hasPackage
in 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:ObjectModelPackage
Returns all classifiers defined in this package. (Except innerClasses)- Specified by:
getClassifiers
in interfaceObjectModelPackage
- Returns:
- a Collection containing all ObjectModelClassifier for this package.
- See Also:
ObjectModelClassifier
-
getClassifier
public ObjectModelClassifier getClassifier(String simpleName)
Description copied from interface:ObjectModelPackage
Returns the classifier corresponding to the given simple name, or null if the package contains no classifier for this simple name.- Specified by:
getClassifier
in 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:ObjectModelPackage
Returns all classes defined in this package. (Except innerClasses)- Specified by:
getClasses
in interfaceObjectModelPackage
- Returns:
- a Collection containing all ObjectModelClass for this package.
- See Also:
ObjectModelClass
-
getClass
public ObjectModelClass getClass(String simpleName)
Description copied from interface:ObjectModelPackage
Returns the class corresponding to the given qualified name, or null if the package contains no class for this simple name.- Specified by:
getClass
in 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:ObjectModelPackage
Indicates whether the package contains the class associated to the given className- Specified by:
hasClass
in 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:ObjectModelPackage
Returns all interfaces defined in this package.- Specified by:
getInterfaces
in interfaceObjectModelPackage
- Returns:
- a Collection containing all ObjectModelInterface for this package.
- See Also:
ObjectModelInterface
-
getInterface
public ObjectModelInterface getInterface(String simpleName)
Description copied from interface:ObjectModelPackage
Returns the interface corresponding to the given qualified name, or null if the package contains no interface for this simple name.- Specified by:
getInterface
in 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:ObjectModelPackage
Returns all enumerations defined in this package.- Specified by:
getEnumerations
in interfaceObjectModelPackage
- Returns:
- a Collection containing all ObjectModelEnumeration for this package.
- See Also:
ObjectModelEnumeration
-
getEnumeration
public ObjectModelEnumeration getEnumeration(String simpleName)
Description copied from interface:ObjectModelPackage
Return the enumeration corresponding to the given simple name- Specified by:
getEnumeration
in 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 com.google.common.base.Predicate<ObjectModelClassifier> newClassifierNameEquals(String simpleName)
-
-