edu.cmu.cs.crystal.internal
Class Crystal

java.lang.Object
  extended by edu.cmu.cs.crystal.internal.Crystal

public class Crystal
extends Object

Provides the ability to run the analyses. Provides output mechanisms for both the Static Analysis developer and the Static Analysis user. Also maintains several useful data structures. They can be accessed through several "get*" methods.

Author:
David Dickey, Jonathan Aldrich, ciera, Nels E. Beckman

Field Summary
static String MARKER_ATTR_ANALYSIS
          Currently unused marker attribute for markers of type MARKER_DEFAULT.
static String MARKER_DEFAULT
          Currently unused default marker type for Crystal.
 
Constructor Summary
Crystal()
           
 
Method Summary
 List<ICrystalAnalysis> getAnalyses()
           
 ASTNode getASTNodeFromBinding(IBinding binding)
          Retrieves the declaring ASTNode of the binding.
 void registerAnalysis(ICrystalAnalysis analysis)
          Registers an analysis with the framework.
 void registerAnnotation(String annotationName, Class<? extends ICrystalAnnotation> annoClass, boolean parseAsMeta)
           
 void registerAnnotationsWithDatabase(AnnotationDatabase annoDB)
          Register all of the annotations in the given annotation registry with the given annotation database.
 void runAnalyses(IRunCrystalCommand command, org.eclipse.core.runtime.IProgressMonitor monitor)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MARKER_DEFAULT

public static final String MARKER_DEFAULT
Currently unused default marker type for Crystal.

See Also:
IMarker, Constant Field Values

MARKER_ATTR_ANALYSIS

public static final String MARKER_ATTR_ANALYSIS
Currently unused marker attribute for markers of type MARKER_DEFAULT.

See Also:
Constant Field Values
Constructor Detail

Crystal

public Crystal()
Method Detail

registerAnalysis

public void registerAnalysis(ICrystalAnalysis analysis)
Registers an analysis with the framework. All analyses must be registered in order for them to be invoked.

Parameters:
analysis - the analysis to be used

getASTNodeFromBinding

public ASTNode getASTNodeFromBinding(IBinding binding)
Retrieves the declaring ASTNode of the binding. The first time this method is called, the mapping between bindings and nodes is created. The creation time will depend on the size of the workspace. Subsequent calls will simply look up the values from a mapping.

Parameters:
binding - the binding from which you want the declaration
Returns:
the declaration node

getAnalyses

public List<ICrystalAnalysis> getAnalyses()

runAnalyses

public void runAnalyses(IRunCrystalCommand command,
                        org.eclipse.core.runtime.IProgressMonitor monitor)

registerAnnotationsWithDatabase

public void registerAnnotationsWithDatabase(AnnotationDatabase annoDB)
Register all of the annotations in the given annotation registry with the given annotation database.

Parameters:
annoDB -

registerAnnotation

public void registerAnnotation(String annotationName,
                               Class<? extends ICrystalAnnotation> annoClass,
                               boolean parseAsMeta)