org.designwizard.design
Interface Entity

All Known Implementing Classes:
AbstractEntity, ClassNode, FieldNode, MethodNode, PackageNode

public interface Entity

Represents the entities of the Design.

Author:
Jo�o Arthur Brunet Monteiro - joaoarthurbm@gmail.com

Nested Class Summary
static class Entity.TypesOfEntities
          This enum represents the entities of the design.
 
Method Summary
 void addModifier(Modifier modifier)
          This method is used to add a Modifier on this Entity.
 void addModifiers(java.util.Collection<Modifier> modifiers)
          This method is used to add a Collection of Modifier on this Entity.
 void addRelation(Relation relation)
          Adds a relation for this entity.
 boolean containsModifiers(Modifier... modifiers)
          Verifies whether this Entity has the specified modifiers.
 boolean containsRelation(Relation relation)
          Method that verifies if the Entity has the specified relation.
 java.util.Set<ClassNode> getCalleeClasses()
          Returns the classes that are referenced by this Entity.
 java.util.Set<MethodNode> getCalleeMethods()
          Returns a Set of MethodNode containing the methods that are called by this Entity.
 java.util.Set<PackageNode> getCalleePackages()
          Returns a Set of PackageNode containing the packages that are referenced by this Entity.
 java.util.Set<ClassNode> getCallerClasses()
          Returns the classes that reference this Entity.
 java.util.Set<MethodNode> getCallerMethods()
          Returns a Set of MethodNode containing the methods that call this Entity.
 java.util.Set<PackageNode> getCallerPackages()
          Returns a Set of PackageNode containing the packages that reference this Entity.
 java.lang.String getClassName()
          Returns the name of the class that represents this Entity object.
 ClassNode getClassNode()
          Returns the ClassNode that represents this Entity object.
 java.util.List<java.lang.String[]> getImpactOfAChange()
          Returns a List of String arrays that represents the trace of calls.
 java.util.Collection<Modifier> getModifiers()
          Returns a Collection of Modifiers representing the modifiers of this Entity.
 java.lang.String getName()
          Method that returns the description of this design element.
 PackageNode getPackage()
          Returns the package which this Entity belongs to.
 java.util.Collection<Relation> getRelations(Relation.TypesOfRelation type)
          Method that returns all the relations with the specified type.
 java.lang.String getShortName()
          Returns the short name of this Entity.
 Entity.TypesOfEntities getTypeOfEntity()
          Method that returns the type of this element of design.
 Modifier getVisibility()
          Returns the visibility of this Entity.
 boolean isAbstract()
          Verifies if this Entity is abstract.
 boolean removeRelation(Relation relation)
          Method that removes a Relation from this Entity.
 

Method Detail

getName

java.lang.String getName()
Method that returns the description of this design element.

Returns:
a String representation for this element of design.

getClassNode

ClassNode getClassNode()
Returns the ClassNode that represents this Entity object. For instance, if this Entity object is a FieldNode, this method will return the ClassNode that contains the field. The same is applied to MethodNodes objects.

Returns:
the ClassNode object that represents this Entity object.

getShortName

java.lang.String getShortName()
Returns the short name of this Entity. The short name of an attribute is just its name. For example, if the short name of attribute out from class System is out but not java.lang.System.out. The short name of a method is just its name and signature. For example, the short name of clone method from Object class is clone() but not java.lang.Object.clone(). The short name of a class is just its name. Not the fully qualified name. For example, the short name of Object class is Object but not java.lang.Object.

Returns:
the short name of this Entity.

getPackage

PackageNode getPackage()
Returns the package which this Entity belongs to. If this Entity belongs to the default package, a package with the name "default" is returned.

Returns:
the package which this Entity belongs to.

addRelation

void addRelation(Relation relation)
Adds a relation for this entity.

Parameters:
relation - the relation to be added.

containsRelation

boolean containsRelation(Relation relation)
Method that verifies if the Entity has the specified relation.

Parameters:
relation - the relation to be verified.
Returns:
true if the specified relation is on this entity or false if not.

getRelations

java.util.Collection<Relation> getRelations(Relation.TypesOfRelation type)
Method that returns all the relations with the specified type.

Parameters:
type - the type of the relation.
Returns:
A Collection containing all the relations with the specified type. If there is no Relation of the specified type, an empty Set will be returned.

removeRelation

boolean removeRelation(Relation relation)
Method that removes a Relation from this Entity.

Parameters:
relation - the relation to be removed from this Entity.

getTypeOfEntity

Entity.TypesOfEntities getTypeOfEntity()
Method that returns the type of this element of design.

Returns:
the type of this element of design.

getCallerMethods

java.util.Set<MethodNode> getCallerMethods()
Returns a Set of MethodNode containing the methods that call this Entity.

Returns:
a Set containing the methods that calls this Entity.

getCalleeMethods

java.util.Set<MethodNode> getCalleeMethods()
Returns a Set of MethodNode containing the methods that are called by this Entity.

Returns:
a Set containing the methods that are called by this Entity.

getCallerClasses

java.util.Set<ClassNode> getCallerClasses()
Returns the classes that reference this Entity.

Returns:
A set containing all classes that makes reference to this Entity.

getCalleeClasses

java.util.Set<ClassNode> getCalleeClasses()
Returns the classes that are referenced by this Entity.

Returns:
A set containing all classes that are referenced by this Entity.

getCallerPackages

java.util.Set<PackageNode> getCallerPackages()
Returns a Set of PackageNode containing the packages that reference this Entity.

Returns:
a Set containing the packages that reference this Entity.

getCalleePackages

java.util.Set<PackageNode> getCalleePackages()
Returns a Set of PackageNode containing the packages that are referenced by this Entity.

Returns:
a Set containing the packages that are referenced by this Entity.

getModifiers

java.util.Collection<Modifier> getModifiers()
Returns a Collection of Modifiers representing the modifiers of this Entity.

Returns:
a Collection of Modifiers representing the modifiers of this Entity.

getVisibility

Modifier getVisibility()
Returns the visibility of this Entity.

Returns:

addModifier

void addModifier(Modifier modifier)
This method is used to add a Modifier on this Entity.

Parameters:
modifier -

addModifiers

void addModifiers(java.util.Collection<Modifier> modifiers)
This method is used to add a Collection of Modifier on this Entity.

Parameters:
modifier -

containsModifiers

boolean containsModifiers(Modifier... modifiers)
Verifies whether this Entity has the specified modifiers.

Parameters:
modifiers -
Returns:
true if this Entity has the specified modifiers or false otherwise.

getImpactOfAChange

java.util.List<java.lang.String[]> getImpactOfAChange()
Returns a List of String arrays that represents the trace of calls. The deep of the search is configured on designwizard.properties

Returns:

isAbstract

boolean isAbstract()
Verifies if this Entity is abstract.

Returns:
true if this Entity is abstract; false otherwise.

getClassName

java.lang.String getClassName()
Returns the name of the class that represents this Entity object. For instance, if this Entity object is a FieldNode, this method will return the name of the class that contains the field. The same is applied to MethodNodes objects. In the case of ClassNode objects, calling this method has the same effect as the designwizard.design.ClassNode.getName() method.

Returns:
the name of the class that represents this Entity object.