org.designwizard.design
Class FieldNode

java.lang.Object
  extended by org.designwizard.design.AbstractEntity
      extended by org.designwizard.design.FieldNode
All Implemented Interfaces:
Entity

public class FieldNode
extends AbstractEntity
implements Entity

A FieldNode provides information about a single field of a class or an interface. To get access to a desired method extracted, do not use the constructor of this class. Instead, use the class DesignWizard as it follows:

                DesignWizard dw = new DesignWizard("/home/user/application/classes");
                FieldNode c = dw.getField("MyAplicationClassExample.field");  
 

Author:
Joao Brunet
See Also:
ClassNode, org.designwizard.design.ClassNode#getFields(), ClassNode.getField(String), ClassNode.getDeclaredFields(), org.designwizard.design.ClassNode#getDeclaredField(String)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.designwizard.design.Entity
Entity.TypesOfEntities
 
Field Summary
 
Fields inherited from class org.designwizard.design.AbstractEntity
modifiers, name, relations, type
 
Constructor Summary
FieldNode(java.lang.String name)
          Creates a new Field.
 
Method Summary
 boolean equals(java.lang.Object other)
          Verifies if this entity is equals the other entity.
 java.util.Set<ClassNode> getCalleeClasses()
          This method returns an empty Set.
 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 FieldNode.
 java.util.Set<MethodNode> getCallerMethods()
          Returns the Methods that access this field.
 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.
 ClassNode getDeclaringClass()
          Returns the ClassNode object representing the class or interface that declares the field represented by this FieldNode object.
 java.util.List<java.lang.String[]> getImpactOfAChange()
          Returns a List of String arrays that represents the trace of calls.
 PackageNode getPackage()
          Returns the package which this Entity belongs to.
 ClassNode getType()
          Returns a ClassNode object that identifies the declared type for the field represented by this FieldNode object.
 int hashCode()
           
 boolean isStatic()
          Returns true if this field is a static field; returns false otherwise.
 java.lang.String toString()
          Method that returns the description of this design element.
 
Methods inherited from class org.designwizard.design.AbstractEntity
addModifier, addModifiers, addRelation, containsModifiers, containsRelation, getModifiers, getName, getRelations, getShortName, getTypeOfEntity, getVisibility, isAbstract, removeRelation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.designwizard.design.Entity
addModifier, addModifiers, addRelation, containsModifiers, containsRelation, getModifiers, getName, getRelations, getShortName, getTypeOfEntity, getVisibility, isAbstract, removeRelation
 

Constructor Detail

FieldNode

public FieldNode(java.lang.String name)
Creates a new Field.

Parameters:
name - the name of this entity.
visibility - the visibility of this entity.
Method Detail

getType

public ClassNode getType()
Returns a ClassNode object that identifies the declared type for the field represented by this FieldNode object.

Returns:
a ClassNode object identifying the declared type of the field represented by this object

getDeclaringClass

public ClassNode getDeclaringClass()
Returns the ClassNode object representing the class or interface that declares the field represented by this FieldNode object. If it is not possible to define the class that declares the field represented by this FieldNode object, then null is returned.


getImpactOfAChange

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

Specified by:
getImpactOfAChange in interface Entity
Returns:

toString

public java.lang.String toString()
Method that returns the description of this design element. The description is a string representation that contains the name of this designElement and all the relations that this designElement is the caller of the relation.

Overrides:
toString in class AbstractEntity
Returns:
a String representation for this element of design.

equals

public boolean equals(java.lang.Object other)
Verifies if this entity is equals the other entity.

Overrides:
equals in class java.lang.Object
Returns:
true if this entity is equals the other entity or false if not.

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractEntity

isStatic

public boolean isStatic()
Returns true if this field is a static field; returns false otherwise.

Returns:
true if and only if this field is a static field.

getClassNode

public ClassNode getClassNode()
Description copied from interface: Entity
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.

Specified by:
getClassNode in interface Entity
Returns:
the ClassNode object that represents this Entity object.

getClassName

public java.lang.String getClassName()
Description copied from interface: Entity
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.

Specified by:
getClassName in interface Entity
Returns:
the name of the class that represents this Entity object.

getPackage

public PackageNode getPackage()
Description copied from interface: Entity
Returns the package which this Entity belongs to. If this Entity belongs to the default package, a package with the name "default" is returned.

Specified by:
getPackage in interface Entity
Returns:
the package which this Entity belongs to.

getCallerMethods

public java.util.Set<MethodNode> getCallerMethods()
Returns the Methods that access this field.

Specified by:
getCallerMethods in interface Entity
Returns:
returns the Methods that access this field.

getCalleeMethods

public java.util.Set<MethodNode> getCalleeMethods()
Description copied from interface: Entity
Returns a Set of MethodNode containing the methods that are called by this Entity.

Specified by:
getCalleeMethods in interface Entity
Returns:
a Set containing the methods that are called by this Entity.

getCallerClasses

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

Specified by:
getCallerClasses in interface Entity
Specified by:
getCallerClasses in class AbstractEntity
Returns:
A set that contains all classes that reference this FieldNode.

getCalleeClasses

public java.util.Set<ClassNode> getCalleeClasses()
This method returns an empty Set. Field does not make any reference in the code.

Specified by:
getCalleeClasses in interface Entity
Specified by:
getCalleeClasses in class AbstractEntity
Returns:
An empty set. Field does not make any reference in the code.

getCallerPackages

public java.util.Set<PackageNode> getCallerPackages()
Description copied from interface: Entity
Returns a Set of PackageNode containing the packages that reference this Entity.

Specified by:
getCallerPackages in interface Entity
Returns:
a Set containing the packages that reference this Entity.

getCalleePackages

public java.util.Set<PackageNode> getCalleePackages()
Description copied from interface: Entity
Returns a Set of PackageNode containing the packages that are referenced by this Entity.

Specified by:
getCalleePackages in interface Entity
Returns:
a Set containing the packages that are referenced by this Entity.