org.aspectj.asm
Class AsmManager

java.lang.Object
  extended by org.aspectj.asm.AsmManager
All Implemented Interfaces:
IStructureModel

public class AsmManager
extends java.lang.Object
implements IStructureModel

The Abstract Structure Model (ASM) represents the containment hierarchy and crosscutting structure map for AspectJ programs. It is used by IDE views such as the document outline, and by other tools such as ajdoc to show both AspectJ declarations and crosscutting links, such as which advice affects which join point shadows.


Nested Class Summary
static class AsmManager.ModelInfo
          A ModelInfo object captures basic information about the structure model.
 
Field Summary
static boolean attemptIncrementalModelRepairs
           
static boolean dumpModelPostBuild
           
static boolean forceSingletonBehaviour
           
protected  IHierarchy hierarchy
           
protected  java.util.Map<java.io.File,java.lang.String> inpathMap
           
static AsmManager lastActiveStructureModel
           
static boolean recordingLastActiveStructureModel
           
 
Method Summary
 void addAspectInEffectThisBuild(java.io.File f)
           
 void addListener(IHierarchyListener listener)
           
static AsmManager createNewStructureModel(java.util.Map<java.io.File,java.lang.String> inpathMap)
           
 void dumprels(java.io.Writer w)
           
static void dumptree(IProgramElement node, int indent)
           
static void dumptree(java.io.Writer w, IProgramElement node, int indent)
           
 void fireModelUpdated()
           
 java.util.Set<java.io.File> getAspectsWeavingFilesOnLastBuild()
           
 java.lang.String getCanonicalFilePath(java.io.File f)
           
 org.aspectj.asm.AsmManager.CanonicalFilePathMap getCanonicalFilePathMap()
           
 java.lang.String getHandleElementForInpath(java.lang.String binaryPath)
           
 IElementHandleProvider getHandleProvider()
           
 IHierarchy getHierarchy()
           
 java.util.HashMap<java.lang.Integer,java.util.List<IProgramElement>> getInlineAnnotations(java.lang.String sourceFile, boolean showSubMember, boolean showMemberAndType)
          Constructs map each time it's called.
 java.util.Set<java.io.File> getModelChangesOnLastBuild()
           
 IRelationshipMap getRelationshipMap()
           
static boolean isCompletingTypeBindings()
           
static boolean isReporting()
           
 void processDelta(java.util.Collection<java.io.File> files_tobecompiled, java.util.Set<java.io.File> files_added, java.util.Set<java.io.File> files_deleted)
           
 void readStructureModel(java.lang.String configFilePath)
           
 void removeAllListeners()
           
 void removeRelationshipsTargettingThisType(java.lang.String typename)
          two kinds of relationships A affects B B affectedBy A Both of these relationships are added when 'B' is modified.
 void removeStructureListener(IHierarchyListener listener)
           
 boolean removeStructureModelForFiles(java.io.Writer fw, java.util.Collection<java.io.File> files)
          Removes the hierarchy structure for the specified files from the structure model.
 void reportModelInfo(java.lang.String reasonForReport)
           
 void resetDeltaProcessing()
           
static void setCompletingTypeBindings(boolean b)
          Set to indicate whether we are currently building a structure model, should be set up front.
static void setDontReport()
           
 void setHandleProvider(IElementHandleProvider handleProvider)
           
static void setLastActiveStructureModel(AsmManager structureModel)
           
static void setReporting(java.lang.String filename, boolean dModel, boolean dRels, boolean dDeltaProcessing, boolean deletefile)
           
static void setReporting(java.lang.String filename, boolean dModel, boolean dRels, boolean dDeltaProcessing, boolean deletefile, IModelFilter aFilter)
           
 AsmManager.ModelInfo summarizeModel()
           
static void verifyAssumption(boolean b)
           
static void verifyAssumption(boolean b, java.lang.String info)
           
 void writeStructureModel(java.lang.String configFilePath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

recordingLastActiveStructureModel

public static boolean recordingLastActiveStructureModel

lastActiveStructureModel

public static AsmManager lastActiveStructureModel

forceSingletonBehaviour

public static boolean forceSingletonBehaviour

attemptIncrementalModelRepairs

public static boolean attemptIncrementalModelRepairs

dumpModelPostBuild

public static boolean dumpModelPostBuild

hierarchy

protected IHierarchy hierarchy

inpathMap

protected java.util.Map<java.io.File,java.lang.String> inpathMap
Method Detail

createNewStructureModel

public static AsmManager createNewStructureModel(java.util.Map<java.io.File,java.lang.String> inpathMap)

getHierarchy

public IHierarchy getHierarchy()

getRelationshipMap

public IRelationshipMap getRelationshipMap()

fireModelUpdated

public void fireModelUpdated()

getInlineAnnotations

public java.util.HashMap<java.lang.Integer,java.util.List<IProgramElement>> getInlineAnnotations(java.lang.String sourceFile,
                                                                                                 boolean showSubMember,
                                                                                                 boolean showMemberAndType)
Constructs map each time it's called.


addListener

public void addListener(IHierarchyListener listener)

removeStructureListener

public void removeStructureListener(IHierarchyListener listener)

removeAllListeners

public void removeAllListeners()

getHandleProvider

public IElementHandleProvider getHandleProvider()

setHandleProvider

public void setHandleProvider(IElementHandleProvider handleProvider)

writeStructureModel

public void writeStructureModel(java.lang.String configFilePath)

readStructureModel

public void readStructureModel(java.lang.String configFilePath)
Parameters:
configFilePath - path to an ".lst" file

getCanonicalFilePath

public java.lang.String getCanonicalFilePath(java.io.File f)

getCanonicalFilePathMap

public org.aspectj.asm.AsmManager.CanonicalFilePathMap getCanonicalFilePathMap()

setReporting

public static void setReporting(java.lang.String filename,
                                boolean dModel,
                                boolean dRels,
                                boolean dDeltaProcessing,
                                boolean deletefile)

setReporting

public static void setReporting(java.lang.String filename,
                                boolean dModel,
                                boolean dRels,
                                boolean dDeltaProcessing,
                                boolean deletefile,
                                IModelFilter aFilter)

isReporting

public static boolean isReporting()

setDontReport

public static void setDontReport()

reportModelInfo

public void reportModelInfo(java.lang.String reasonForReport)

dumptree

public static void dumptree(java.io.Writer w,
                            IProgramElement node,
                            int indent)
                     throws java.io.IOException
Throws:
java.io.IOException

dumptree

public static void dumptree(IProgramElement node,
                            int indent)
                     throws java.io.IOException
Throws:
java.io.IOException

dumprels

public void dumprels(java.io.Writer w)
              throws java.io.IOException
Throws:
java.io.IOException

removeStructureModelForFiles

public boolean removeStructureModelForFiles(java.io.Writer fw,
                                            java.util.Collection<java.io.File> files)
                                     throws java.io.IOException
Removes the hierarchy structure for the specified files from the structure model. Returns true if it deleted anything

Throws:
java.io.IOException

processDelta

public void processDelta(java.util.Collection<java.io.File> files_tobecompiled,
                         java.util.Set<java.io.File> files_added,
                         java.util.Set<java.io.File> files_deleted)

removeRelationshipsTargettingThisType

public void removeRelationshipsTargettingThisType(java.lang.String typename)
two kinds of relationships A affects B B affectedBy A Both of these relationships are added when 'B' is modified. Concrete examples are 'advises/advisedby' or 'annotates/annotatedby'. What we need to do is when 'B' is going to be woven, remove all relationships that may reoccur when it is woven. So - remove 'affects' relationships where the target is 'B', remove all 'affectedBy' relationships where the source is 'B'.


verifyAssumption

public static void verifyAssumption(boolean b,
                                    java.lang.String info)

verifyAssumption

public static void verifyAssumption(boolean b)

summarizeModel

public AsmManager.ModelInfo summarizeModel()

setCompletingTypeBindings

public static void setCompletingTypeBindings(boolean b)
Set to indicate whether we are currently building a structure model, should be set up front.


isCompletingTypeBindings

public static boolean isCompletingTypeBindings()

resetDeltaProcessing

public void resetDeltaProcessing()

getModelChangesOnLastBuild

public java.util.Set<java.io.File> getModelChangesOnLastBuild()
Returns:
the Set of files for which the structure model was modified (they may have been removed or otherwise rebuilt). Set is empty for a full build.

getAspectsWeavingFilesOnLastBuild

public java.util.Set<java.io.File> getAspectsWeavingFilesOnLastBuild()
Returns:
the Set of aspects that wove files on the last build (either incremental or full build)

addAspectInEffectThisBuild

public void addAspectInEffectThisBuild(java.io.File f)

setLastActiveStructureModel

public static void setLastActiveStructureModel(AsmManager structureModel)

getHandleElementForInpath

public java.lang.String getHandleElementForInpath(java.lang.String binaryPath)