Top Fields Constructors Methods
org.aspectj.asm.internal

public Class AspectJElementHierarchy

extends Object
implements IHierarchy
Class Inheritance
All Implemented Interfaces
org.aspectj.asm.IHierarchy, java.io.Serializable
Imports
java.io.File, java.util.ArrayList, .Collection, .Collections, .HashMap, .List, .Map, .Set, org.aspectj.asm.AsmManager, .IHierarchy, .IProgramElement, org.aspectj.bridge.ISourceLocation, .SourceLocation

Authors
Mik Kersten, Andy Clement

Field Summary

Modifier and TypeField and Description
private transient AsmManager
protected String
private Map<String, IProgramElement>
private Map<String, IProgramElement>
protected IProgramElement
private static final long
private Map<String, IProgramElement>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
protected void
private IProgramElement
private IProgramElement
public IProgramElement

Returns:

any closer match below 'node' or null if nothing is a more accurate match
findCloserMatchForLineNumber
(IProgramElement
where to start looking
node
,
int
the line number
lineno
)

Implements org.aspectj.asm.IHierarchy.findCloserMatchForLineNumber.

For a specified node, check if any of the children more accurately represent the specified line.
public IProgramElement
private IProgramElement
public IProgramElement
public IProgramElement
findElementForLabel(IProgramElement parent, IProgramElement.Kind
not null
kind
,
String label)

Implements org.aspectj.asm.IHierarchy.findElementForLabel.

Returns the first match
public IProgramElement
findElementForOffSet(String sourceFilePath, int lineNumber, int offSet)

Implements org.aspectj.asm.IHierarchy.findElementForOffSet.

public IProgramElement

Returns:

null if not found
findElementForSignature
(IProgramElement parent, IProgramElement.Kind
not null
kind
,
String signature)

Implements org.aspectj.asm.IHierarchy.findElementForSignature.

Returns the first match
public IProgramElement

Returns:

a new structure node for the file if it was not found in the model
findElementForSourceFile
(String
modified to '/' delimited path for consistency
sourceFile
)

Implements org.aspectj.asm.IHierarchy.findElementForSourceFile.

public IProgramElement
public IProgramElement

Returns:

a new structure node for the file if it was not found in the model
findElementForSourceLine
(String
canonicalized path for consistency
sourceFilePath
,
int
if 0 or 1 the corresponding file node will be returned
lineNumber
)

Implements org.aspectj.asm.IHierarchy.findElementForSourceLine.

Never returns null
public IProgramElement

Returns:

the IProgramElement representing the type, or null if not found
findElementForType
(String
the package in which the type is declared or null for the default package
packageName
,
String
the name of the type
typeName
)

Implements org.aspectj.asm.IHierarchy.findElementForType.

Find the entry in the model that represents a particular type.
public IProgramElement
public List<IProgramElement>

Returns:

a list of package nodes that match that name
findMatchingPackages
(String
the packagename being searched for
packagename
)

Look for any package nodes matching the specified package name.

public IProgramElement

Returns:

the node representing that source file or null if it cannot be found
findNodeForSourceFile
(IProgramElement
where in the model to start looking (usually the root on the initial call)
node
,
String
the source file being searched for
sourcefilePath
)

Implements org.aspectj.asm.IHierarchy.findNodeForSourceFile.

Discover the node representing a particular source file.
private IProgramElement
findNodeForSourceLineHelper(IProgramElement node, String sourceFilePath, int lineno, int offset)

public void
public void
public void
public void
forget(IProgramElement compilationUnitNode, IProgramElement typeNode)

private String
public String
public IProgramElement
public Set<Map.Entry<String, IProgramElement>>
private String
public IProgramElement
private boolean
hasMoreSpecificChild(IProgramElement node, String sourceFilePath, int lineNumber, int offSet)

public boolean
private boolean
matches(IProgramElement node, String sourceFilePath, int lineNumber, int offSet)

public boolean
public void
public void
public void
public void
public String
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

asmback to summary
private transient AsmManager asm
configFileback to summary
protected String configFile
fileMapback to summary
private Map<String, IProgramElement> fileMap
handleMapback to summary
private Map<String, IProgramElement> handleMap
rootback to summary
protected IProgramElement root
serialVersionUIDback to summary
private static final long serialVersionUID
typeMapback to summary
private Map<String, IProgramElement> typeMap

Constructor Detail

AspectJElementHierarchyback to summary
public AspectJElementHierarchy(AsmManager asm)

Method Detail

addToFileMapback to summary
public void addToFileMap(String key, IProgramElement value)

Implements org.aspectj.asm.IHierarchy.addToFileMap.

cacheback to summary
protected void cache(String handle, IProgramElement pe)
createFileStructureNodeback to summary
private IProgramElement createFileStructureNode(String sourceFilePath)
findClassInNodesback to summary
private IProgramElement findClassInNodes(Collection<IProgramElement> nodes, String name, String typeName)
findCloserMatchForLineNumberback to summary
public IProgramElement findCloserMatchForLineNumber(IProgramElement node, int lineno)

Implements org.aspectj.asm.IHierarchy.findCloserMatchForLineNumber.

For a specified node, check if any of the children more accurately represent the specified line.

Parameters
node:IProgramElement

where to start looking

lineno:int

the line number

Returns:IProgramElement

any closer match below 'node' or null if nothing is a more accurate match

findElementForHandleback to summary
public IProgramElement findElementForHandle(String handle)

Implements org.aspectj.asm.IHierarchy.findElementForHandle.

findElementForHandleback to summary
private IProgramElement findElementForHandle(IProgramElement parent, String handle)
findElementForHandleOrCreateback to summary
public IProgramElement findElementForHandleOrCreate(String handle, boolean create)

Implements org.aspectj.asm.IHierarchy.findElementForHandleOrCreate.

findElementForLabelback to summary
public IProgramElement findElementForLabel(IProgramElement parent, IProgramElement.Kind kind, String label)

Implements org.aspectj.asm.IHierarchy.findElementForLabel.

Doc from org.aspectj.asm.IHierarchy.findElementForLabel.

Returns the first match

Parameters
kind:IProgramElement.Kind

not null

Returns:IProgramElement

null if not found

findElementForOffSetback to summary
public IProgramElement findElementForOffSet(String sourceFilePath, int lineNumber, int offSet)

Implements org.aspectj.asm.IHierarchy.findElementForOffSet.

findElementForSignatureback to summary
public IProgramElement findElementForSignature(IProgramElement parent, IProgramElement.Kind kind, String signature)

Implements org.aspectj.asm.IHierarchy.findElementForSignature.

Returns the first match

Parameters
kind:IProgramElement.Kind

not null

Returns:IProgramElement

null if not found

findElementForSourceFileback to summary
public IProgramElement findElementForSourceFile(String sourceFile)

Implements org.aspectj.asm.IHierarchy.findElementForSourceFile.

Parameters
sourceFile:String

modified to '/' delimited path for consistency

Returns:IProgramElement

a new structure node for the file if it was not found in the model

findElementForSourceLineback to summary
public IProgramElement findElementForSourceLine(ISourceLocation location)

Implements org.aspectj.asm.IHierarchy.findElementForSourceLine.

TODO: discriminate columns

findElementForSourceLineback to summary
public IProgramElement findElementForSourceLine(String sourceFilePath, int lineNumber)

Implements org.aspectj.asm.IHierarchy.findElementForSourceLine.

Never returns null

Parameters
sourceFilePath:String

canonicalized path for consistency

lineNumber:int

if 0 or 1 the corresponding file node will be returned

Returns:IProgramElement

a new structure node for the file if it was not found in the model

findElementForTypeback to summary
public IProgramElement findElementForType(String packageName, String typeName)

Implements org.aspectj.asm.IHierarchy.findElementForType.

Find the entry in the model that represents a particular type.

Parameters
packageName:String

the package in which the type is declared or null for the default package

typeName:String

the name of the type

Returns:IProgramElement

the IProgramElement representing the type, or null if not found

findInFileMapback to summary
public IProgramElement findInFileMap(String key)

Implements org.aspectj.asm.IHierarchy.findInFileMap.

findMatchingPackagesback to summary
public List<IProgramElement> findMatchingPackages(String packagename)

Look for any package nodes matching the specified package name. There may be multiple in the case where the types within a package are split across source folders.

Parameters
packagename:String

the packagename being searched for

Returns:List<IProgramElement>

a list of package nodes that match that name

findNodeForSourceFileback to summary
public IProgramElement findNodeForSourceFile(IProgramElement node, String sourcefilePath)

Implements org.aspectj.asm.IHierarchy.findNodeForSourceFile.

Discover the node representing a particular source file.

Parameters
node:IProgramElement

where in the model to start looking (usually the root on the initial call)

sourcefilePath:String

the source file being searched for

Returns:IProgramElement

the node representing that source file or null if it cannot be found

findNodeForSourceLineHelperback to summary
private IProgramElement findNodeForSourceLineHelper(IProgramElement node, String sourceFilePath, int lineno, int offset)
flushFileMapback to summary
public void flushFileMap()
flushHandleMapback to summary
public void flushHandleMap()

Implements org.aspectj.asm.IHierarchy.flushHandleMap.

flushTypeMapback to summary
public void flushTypeMap()

Implements org.aspectj.asm.IHierarchy.flushTypeMap.

forgetback to summary
public void forget(IProgramElement compilationUnitNode, IProgramElement typeNode)
getCanonicalFilePathback to summary
private String getCanonicalFilePath(IProgramElement ipe)
getConfigFileback to summary
public String getConfigFile()

Implements org.aspectj.asm.IHierarchy.getConfigFile.

getElementback to summary
public IProgramElement getElement(String handle)

Implements org.aspectj.asm.IHierarchy.getElement.

getFileMapEntrySetback to summary
public Set<Map.Entry<String, IProgramElement>> getFileMapEntrySet()

Implements org.aspectj.asm.IHierarchy.getFileMapEntrySet.

getFilenameback to summary
private String getFilename(String hid)
getRootback to summary
public IProgramElement getRoot()

Implements org.aspectj.asm.IHierarchy.getRoot.

hasMoreSpecificChildback to summary
private boolean hasMoreSpecificChild(IProgramElement node, String sourceFilePath, int lineNumber, int offSet)
isValidback to summary
public boolean isValid()

Implements org.aspectj.asm.IHierarchy.isValid.

matchesback to summary
private boolean matches(IProgramElement node, String sourceFilePath, int lineNumber, int offSet)
removeFromFileMapback to summary
public boolean removeFromFileMap(String canonicalFilePath)

Implements org.aspectj.asm.IHierarchy.removeFromFileMap.

setAsmManagerback to summary
public void setAsmManager(AsmManager asm)
setConfigFileback to summary
public void setConfigFile(String configFile)

Implements org.aspectj.asm.IHierarchy.setConfigFile.

setFileMapback to summary
public void setFileMap(Map<String, IProgramElement> fileMap)

Implements org.aspectj.asm.IHierarchy.setFileMap.

setRootback to summary
public void setRoot(IProgramElement root)

Implements org.aspectj.asm.IHierarchy.setRoot.

toSummaryStringback to summary
public String toSummaryString()
updateHandleMapback to summary
public void updateHandleMap(Set<String> deletedFiles)

Implements org.aspectj.asm.IHierarchy.updateHandleMap.