Top Description Inners Fields Constructors Methods
org.aspectj.asm

public Class AsmManager

extends Object
implements IStructureModel
Class Inheritance
All Implemented Interfaces
org.aspectj.util.IStructureModel
Imports
java.io.BufferedWriter, .EOFException, .File, .FileInputStream, .FileNotFoundException, .FileOutputStream, .FileWriter, .IOException, .ObjectInputStream, .ObjectOutputStream, .Writer, java.util.ArrayList, .Collection, .Enumeration, .HashMap, .HashSet, .Hashtable, .List, .Map, .Properties, .Set, org.aspectj.asm.internal.AspectJElementHierarchy, .HandleProviderDelimiter, .JDTLikeHandleProvider, .RelationshipMap, org.aspectj.bridge.ISourceLocation, org.aspectj.util.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.
Authors
Mik Kersten, Andy Clement

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static class
AsmManager.ModelInfo

A ModelInfo object captures basic information about the structure model.

Field Summary

Modifier and TypeField and Description
pack-priv final Set<File>
public static boolean
private final AsmManager.CanonicalFilePathMap
private static boolean
private static boolean
private static String
private static boolean
public static boolean
private static boolean
public static boolean
private IElementHandleProvider
protected IHierarchy
protected Map<File, String>
public static AsmManager
private final Set<File>
private IRelationshipMap
private static IModelFilter
public static boolean
private static boolean
private final List<IHierarchyListener>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
public void
public static AsmManager
public void
private void
public static void
dumptree(Writer w, IProgramElement node, int indent)

public static void
dumptree(IProgramElement node, int indent)

public void
private String
genExternFilePath(String configFilePath)

private void
getAllStructureChildren(IProgramElement node, List<IProgramElement> result, boolean showSubMember, boolean showMemberAndType)

public Set<File>

Returns:

the Set of aspects that wove files on the last build (either incremental or full build)
getAspectsWeavingFilesOnLastBuild
()

public String
public AsmManager.CanonicalFilePathMap
public String
public IElementHandleProvider
public IHierarchy
public HashMap<Integer, List<IProgramElement>>
getInlineAnnotations(String sourceFile, boolean showSubMember, boolean showMemberAndType)

Constructs map each time it's called.

public Set<File>

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.
getModelChangesOnLastBuild
()

public IRelationshipMap
private String
public static boolean
private boolean

Returns:

true if the handle contains ';' - the char indicating that it is a phantom handle
isPhantomHandle
(String
a JDT like handle, following the form described in AsmRelationshipProvider.findOrFakeUpNode
handle
)

public static boolean
private void
public void
processDelta(Collection<File> files_tobecompiled, Set<File> files_added, Set<File> files_deleted)

public void
readStructureModel(String
path to an ".lst" file
configFilePath
)

public void
private void
removeNode(IProgramElement progElem)

Removes a specified program element from the structure model.

public void
removeRelationshipsTargettingThisType(String typename)

two kinds of relationships A affects B B affectedBy A Both of these relationships are added when 'B' is modified.

private void
removeSingleNode(IProgramElement progElem)

Removes a specified program element from the structure model.

public void
public boolean
removeStructureModelForFiles(Writer fw, Collection<File> files)

Removes the hierarchy structure for the specified files from the structure model.

private void
repairRelationships(Writer fw)

Go through all the relationships in the model, if any endpoints no longer exist (the node it points to has been deleted from the model) then delete the relationship.

public void
reportModelInfo(String reasonForReport)

public void
private boolean
sameType(String hid, IProgramElement target, IProgramElement type)

Return true if the target element is in the type specified.

public static void
setCompletingTypeBindings(boolean b)

Set to indicate whether we are currently building a structure model, should be set up front.

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

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

public AsmManager.ModelInfo
public static void
verifyAssumption(boolean b, String info)

public static void
verifyAssumption(boolean b)

public void
writeStructureModel(String configFilePath)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aspectsWeavingInLastBuildback to summary
pack-priv final Set<File> aspectsWeavingInLastBuild
attemptIncrementalModelRepairsback to summary
public static boolean attemptIncrementalModelRepairs
canonicalFilePathMapback to summary
private final AsmManager.CanonicalFilePathMap canonicalFilePathMap
completingTypeBindingsback to summary
private static boolean completingTypeBindings
dumpDeltaProcessingback to summary
private static boolean dumpDeltaProcessing
dumpFilenameback to summary
private static String dumpFilename
dumpModelback to summary
private static boolean dumpModel
dumpModelPostBuildback to summary
public static boolean dumpModelPostBuild
dumpRelationshipsback to summary
private static boolean dumpRelationships
forceSingletonBehaviourback to summary
public static boolean forceSingletonBehaviour
handleProviderback to summary
private IElementHandleProvider handleProvider
hierarchyback to summary
protected IHierarchy hierarchy
inpathMapback to summary
protected Map<File, String> inpathMap
lastActiveStructureModelback to summary
public static AsmManager lastActiveStructureModel
lastBuildChangesback to summary
private final Set<File> lastBuildChanges
mapperback to summary
private IRelationshipMap mapper
modelFilterback to summary
private static IModelFilter modelFilter
recordingLastActiveStructureModelback to summary
public static boolean recordingLastActiveStructureModel
reportingback to summary
private static boolean reporting
structureListenersback to summary
private final List<IHierarchyListener> structureListeners

Constructor Detail

AsmManagerback to summary
private AsmManager()

Method Detail

addAspectInEffectThisBuildback to summary
public void addAspectInEffectThisBuild(File f)
addListenerback to summary
public void addListener(IHierarchyListener listener)
createNewStructureModelback to summary
public static AsmManager createNewStructureModel(Map<File, String> inpathMap)
dumprelsback to summary
public void dumprels(Writer w) throws IOException
dumprelsStderrback to summary
private void dumprelsStderr(String key)
dumptreeback to summary
public static void dumptree(Writer w, IProgramElement node, int indent) throws IOException
dumptreeback to summary
public static void dumptree(IProgramElement node, int indent) throws IOException
fireModelUpdatedback to summary
public void fireModelUpdated()
genExternFilePathback to summary
private String genExternFilePath(String configFilePath)
getAllStructureChildrenback to summary
private void getAllStructureChildren(IProgramElement node, List<IProgramElement> result, boolean showSubMember, boolean showMemberAndType)
getAspectsWeavingFilesOnLastBuildback to summary
public Set<File> getAspectsWeavingFilesOnLastBuild()
Returns:Set<File>

the Set of aspects that wove files on the last build (either incremental or full build)

getCanonicalFilePathback to summary
public String getCanonicalFilePath(File f)
getCanonicalFilePathMapback to summary
public AsmManager.CanonicalFilePathMap getCanonicalFilePathMap()
getHandleElementForInpathback to summary
public String getHandleElementForInpath(String binaryPath)
getHandleProviderback to summary
public IElementHandleProvider getHandleProvider()
getHierarchyback to summary
public IHierarchy getHierarchy()
getInlineAnnotationsback to summary
public HashMap<Integer, List<IProgramElement>> getInlineAnnotations(String sourceFile, boolean showSubMember, boolean showMemberAndType)

Constructs map each time it's called.

getModelChangesOnLastBuildback to summary
public Set<File> getModelChangesOnLastBuild()
Returns:Set<File>

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.

getRelationshipMapback to summary
public IRelationshipMap getRelationshipMap()
getTypeNameFromHandleback to summary
private String getTypeNameFromHandle(String handle, Map<String, String> cache)
isCompletingTypeBindingsback to summary
public static boolean isCompletingTypeBindings()
isPhantomHandleback to summary
private boolean isPhantomHandle(String handle)
Parameters
handle:String

a JDT like handle, following the form described in AsmRelationshipProvider.findOrFakeUpNode

Returns:boolean

true if the handle contains ';' - the char indicating that it is a phantom handle

isReportingback to summary
public static boolean isReporting()
notifyListenersback to summary
private void notifyListeners()
processDeltaback to summary
public void processDelta(Collection<File> files_tobecompiled, Set<File> files_added, Set<File> files_deleted)
readStructureModelback to summary
public void readStructureModel(String configFilePath)
Parameters
configFilePath:String

path to an ".lst" file

removeAllListenersback to summary
public void removeAllListeners()
removeNodeback to summary
private void removeNode(IProgramElement progElem)

Removes a specified program element from the structure model. Two processing stages:

First: We go to the parent of the program element, ask for all its children and remove the node we want to delete from the list of children.

Second:We check if that parent has any other children. If it has no other children and it is either a CODE node or a PACKAGE node, we delete it too.

removeRelationshipsTargettingThisTypeback to summary
public void removeRelationshipsTargettingThisType(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'.

removeSingleNodeback to summary
private void removeSingleNode(IProgramElement progElem)

Removes a specified program element from the structure model. We go to the parent of the program element, ask for all its children and remove the node we want to delete from the list of children.

removeStructureListenerback to summary
public void removeStructureListener(IHierarchyListener listener)
removeStructureModelForFilesback to summary
public boolean removeStructureModelForFiles(Writer fw, Collection<File> files) throws IOException

Removes the hierarchy structure for the specified files from the structure model. Returns true if it deleted anything

repairRelationshipsback to summary
private void repairRelationships(Writer fw)

Go through all the relationships in the model, if any endpoints no longer exist (the node it points to has been deleted from the model) then delete the relationship.

reportModelInfoback to summary
public void reportModelInfo(String reasonForReport)
resetDeltaProcessingback to summary
public void resetDeltaProcessing()
sameTypeback to summary
private boolean sameType(String hid, IProgramElement target, IProgramElement type)

Return true if the target element is in the type specified.

setCompletingTypeBindingsback to summary
public static void setCompletingTypeBindings(boolean b)

Set to indicate whether we are currently building a structure model, should be set up front.

setDontReportback to summary
public static void setDontReport()
setHandleProviderback to summary
public void setHandleProvider(IElementHandleProvider handleProvider)
setLastActiveStructureModelback to summary
public static void setLastActiveStructureModel(AsmManager structureModel)
setReportingback to summary
public static void setReporting(String filename, boolean dModel, boolean dRels, boolean dDeltaProcessing, boolean deletefile)
setReportingback to summary
public static void setReporting(String filename, boolean dModel, boolean dRels, boolean dDeltaProcessing, boolean deletefile, IModelFilter aFilter)
summarizeModelback to summary
public AsmManager.ModelInfo summarizeModel()
verifyAssumptionback to summary
public static void verifyAssumption(boolean b, String info)
verifyAssumptionback to summary
public static void verifyAssumption(boolean b)
writeStructureModelback to summary
public void writeStructureModel(String configFilePath)
org.aspectj.asm back to summary

private Class AsmManager.CanonicalFilePathMap

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final int
private final Map<String, String>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
get(File f)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MAX_SIZEback to summary
private static final int MAX_SIZE
pathMapback to summary
private final Map<String, String> pathMap

Constructor Detail

CanonicalFilePathMapback to summary
private CanonicalFilePathMap()

Method Detail

getback to summary
public String get(File f)
org.aspectj.asm back to summary

public Class AsmManager.ModelInfo

extends Object
Class Inheritance

A ModelInfo object captures basic information about the structure model. It is used for testing and producing debug info.

Field Summary

Modifier and TypeField and Description
private final Properties
private final Hashtable<String, Integer>

Constructor Summary

AccessConstructor and Description
private
ModelInfo(IHierarchy hierarchy, IRelationshipMap relationshipMap)

Method Summary

Modifier and TypeMethod and Description
private void
public Properties
public void
recordStat(String string, String string2)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

extraPropertiesback to summary
private final Properties extraProperties
nodeTypeCountback to summary
private final Hashtable<String, Integer> nodeTypeCount

Constructor Detail

ModelInfoback to summary
private ModelInfo(IHierarchy hierarchy, IRelationshipMap relationshipMap)

Method Detail

countNodeback to summary
private void countNode(IProgramElement ipe)
getPropertiesback to summary
public Properties getProperties()
recordStatback to summary
public void recordStat(String string, String string2)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

walkModelback to summary
private void walkModel(IProgramElement ipe)