org.designwizard.design.manager
Class DesignManager

java.lang.Object
  extended by org.designwizard.design.manager.DesignManager
All Implemented Interfaces:
ExtractionListener

public class DesignManager
extends java.lang.Object
implements ExtractionListener

Author:
Joao Arthur Brunet Monteiro - jarthur@dsc.ufcg.edu.br

Constructor Summary
DesignManager(TranslatorUtil translator)
          Creates a new DesignManager.
 
Method Summary
 void analyzeImpact(java.lang.String entityName)
          Analyze the impact of a change in the Entity object specified by the entityName.
 void classExtracted(FactEvent event)
          Event generated by the extractor.
 void extractFacts(java.lang.String path)
          Extracts fact from the given bytecode.
 void extractFacts(java.lang.String path, java.lang.String... internalPath)
           
 java.util.Set<ClassNode> getAllClasses()
          Returns a set containing all classes extracted.
 java.util.Set<MethodNode> getAllMethods()
           
 java.util.Set<PackageNode> getAllPackages()
           
 ClassNode getClass(java.lang.String className)
          Returns a ClassEntity represented by the specified className.
 Design getDesign()
          Returns the design extracted.
 Entity getEntity(java.lang.String entityName)
           
 FieldNode getField(java.lang.String fieldName)
          Returns a Field with the specified name.
 MethodNode getMethod(java.lang.String methodName)
          Returns a Method with the specified name.
 PackageNode getPackage(java.lang.String fullyQualifiedNamePackage)
           
 ResultOfImpact getResultOfAnalyzedEntities()
          The result generated by the analyzeImpact(String entityName) method.
 void modifiersExtracted(FactEvent event)
          Event generated by the extractor when modifiers are extracted.
 void packageExtracted(FactEvent event)
           
 void relationExtracted(FactEvent event)
          Event generated by the extractor.
 void signatureExtracted(FactEvent event)
          Event generated by the extractor.
 void visibilityExtracted(FactEvent event)
          Event generated by the extractor when a visibility is extracted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DesignManager

public DesignManager(TranslatorUtil translator)
Creates a new DesignManager. An instance of this class is responsible by receiving the extraction events and fill the Design object.

Parameters:
translator -
Method Detail

extractFacts

public void extractFacts(java.lang.String path)
                  throws java.io.IOException,
                         java.io.FileNotFoundException
Extracts fact from the given bytecode. The path must be a jar file, or the classes directory from project.

Parameters:
path - The path of a jar file, or the classes directory from project.
Throws:
java.io.IOException - If an I/O error occurs.
java.io.FileNotFoundException

extractFacts

public void extractFacts(java.lang.String path,
                         java.lang.String... internalPath)
                  throws java.io.IOException,
                         java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

getDesign

public Design getDesign()
Returns the design extracted.

Returns:
the design extracted.

relationExtracted

public void relationExtracted(FactEvent event)
Event generated by the extractor.

Specified by:
relationExtracted in interface ExtractionListener

visibilityExtracted

public void visibilityExtracted(FactEvent event)
Event generated by the extractor when a visibility is extracted.

Specified by:
visibilityExtracted in interface ExtractionListener

signatureExtracted

public void signatureExtracted(FactEvent event)
Event generated by the extractor. When a signature of method is extracted.

Specified by:
signatureExtracted in interface ExtractionListener

classExtracted

public void classExtracted(FactEvent event)
Event generated by the extractor. When a class is extracted.

Specified by:
classExtracted in interface ExtractionListener

packageExtracted

public void packageExtracted(FactEvent event)
Specified by:
packageExtracted in interface ExtractionListener

getAllClasses

public java.util.Set<ClassNode> getAllClasses()
Returns a set containing all classes extracted.

Returns:
a set containing all classes extracted. If no class was extracted, this method will return a empty Set;

getEntity

public Entity getEntity(java.lang.String entityName)
                 throws InexistentEntityException
Throws:
InexistentEntityException

getClass

public ClassNode getClass(java.lang.String className)
                   throws InexistentEntityException
Returns a ClassEntity represented by the specified className.

Parameters:
className - - the name of the class.
Returns:
a ClassEntity represented by the specified className.
Throws:
InexistentEntityException

getMethod

public MethodNode getMethod(java.lang.String methodName)
                     throws InexistentEntityException
Returns a Method with the specified name.

Parameters:
methodName - the name of the method.
Returns:
a Method with the specified name.
Throws:
InexistentEntityException

getField

public FieldNode getField(java.lang.String fieldName)
                   throws InexistentEntityException
Returns a Field with the specified name.

Parameters:
fieldName - the name of the field.
Returns:
a Field with the specified name.
Throws:
InexistentEntityException

analyzeImpact

public void analyzeImpact(java.lang.String entityName)
Analyze the impact of a change in the Entity object specified by the entityName. This method fill the ResultManager object with the impact of a change in the Entity object specified by the entityName. To see the result of the analyzed entities, get the ResultManager object invoking the getResultOfAnalyzedEntities() of this class.


getResultOfAnalyzedEntities

public ResultOfImpact getResultOfAnalyzedEntities()
The result generated by the analyzeImpact(String entityName) method.

Returns:
the result generated by the analyzeImpact(String entityName) method.

modifiersExtracted

public void modifiersExtracted(FactEvent event)
Event generated by the extractor when modifiers are extracted.

Specified by:
modifiersExtracted in interface ExtractionListener

getAllPackages

public java.util.Set<PackageNode> getAllPackages()

getPackage

public PackageNode getPackage(java.lang.String fullyQualifiedNamePackage)
                       throws InexistentEntityException
Throws:
InexistentEntityException

getAllMethods

public java.util.Set<MethodNode> getAllMethods()