Package org.aspectj.asm.internal
Class AspectJElementHierarchy
java.lang.Object
org.aspectj.asm.internal.AspectJElementHierarchy
- All Implemented Interfaces:
Serializable
,IHierarchy
- Author:
- Mik Kersten, Andy Clement
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from interface org.aspectj.asm.IHierarchy
NO_STRUCTURE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addToFileMap(String key, IProgramElement value)
protected void
cache(String handle, IProgramElement pe)
findCloserMatchForLineNumber(IProgramElement node, int lineno)
For a specified node, check if any of the children more accurately represent the specified line.findElementForHandle(String handle)
findElementForHandleOrCreate(String handle, boolean create)
findElementForLabel(IProgramElement parent, IProgramElement.Kind kind, String label)
Returns the first matchfindElementForOffSet(String sourceFilePath, int lineNumber, int offSet)
findElementForSignature(IProgramElement parent, IProgramElement.Kind kind, String signature)
Returns the first matchfindElementForSourceFile(String sourceFile)
findElementForSourceLine(String sourceFilePath, int lineNumber)
Never returns nullfindElementForSourceLine(ISourceLocation location)
TODO: discriminate columnsfindElementForType(String packageName, String typeName)
Find the entry in the model that represents a particular type.findInFileMap(Object key)
findMatchingPackages(String packagename)
Look for any package nodes matching the specified package name.findNodeForSourceFile(IProgramElement node, String sourcefilePath)
Discover the node representing a particular source file.void
void
void
void
forget(IProgramElement compilationUnitNode, IProgramElement typeNode)
getElement(String handle)
getRoot()
boolean
isValid()
boolean
removeFromFileMap(String canonicalFilePath)
void
setAsmManager(AsmManager asm)
void
setConfigFile(String configFile)
void
setFileMap(Map<String,IProgramElement> fileMap)
void
setRoot(IProgramElement root)
void
updateHandleMap(Set<String> deletedFiles)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.aspectj.asm.IHierarchy
setFileMap
-
Field Details
-
root
-
configFile
-
-
Constructor Details
-
AspectJElementHierarchy
-
-
Method Details
-
getElement
- Specified by:
getElement
in interfaceIHierarchy
-
setAsmManager
-
getRoot
- Specified by:
getRoot
in interfaceIHierarchy
-
toSummaryString
-
setRoot
- Specified by:
setRoot
in interfaceIHierarchy
-
addToFileMap
- Specified by:
addToFileMap
in interfaceIHierarchy
-
removeFromFileMap
- Specified by:
removeFromFileMap
in interfaceIHierarchy
-
setFileMap
- Specified by:
setFileMap
in interfaceIHierarchy
-
findInFileMap
- Specified by:
findInFileMap
in interfaceIHierarchy
-
getFileMapEntrySet
- Specified by:
getFileMapEntrySet
in interfaceIHierarchy
-
isValid
public boolean isValid()- Specified by:
isValid
in interfaceIHierarchy
-
findElementForSignature
public IProgramElement findElementForSignature(IProgramElement parent, IProgramElement.Kind kind, String signature)Returns the first match- Specified by:
findElementForSignature
in interfaceIHierarchy
- Parameters:
parent
-kind
- not null- Returns:
- null if not found
-
findElementForLabel
public IProgramElement findElementForLabel(IProgramElement parent, IProgramElement.Kind kind, String label)Description copied from interface:IHierarchy
Returns the first match- Specified by:
findElementForLabel
in interfaceIHierarchy
kind
- not null- Returns:
- null if not found
-
findElementForType
Find the entry in the model that represents a particular type.- Specified by:
findElementForType
in interfaceIHierarchy
- Parameters:
packageName
- the package in which the type is declared or null for the default packagetypeName
- the name of the type- Returns:
- the IProgramElement representing the type, or null if not found
-
findMatchingPackages
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
- the packagename being searched for- Returns:
- a list of package nodes that match that name
-
findElementForSourceFile
- Specified by:
findElementForSourceFile
in interfaceIHierarchy
- Parameters:
sourceFile
- modified to '/' delimited path for consistency- Returns:
- a new structure node for the file if it was not found in the model
-
findElementForSourceLine
TODO: discriminate columns- Specified by:
findElementForSourceLine
in interfaceIHierarchy
-
findElementForSourceLine
Never returns null- Specified by:
findElementForSourceLine
in interfaceIHierarchy
- Parameters:
sourceFilePath
- canonicalized path for consistencylineNumber
- if 0 or 1 the corresponding file node will be returned- Returns:
- a new structure node for the file if it was not found in the model
-
findNodeForSourceFile
Discover the node representing a particular source file.- Specified by:
findNodeForSourceFile
in interfaceIHierarchy
- Parameters:
node
- where in the model to start looking (usually the root on the initial call)sourcefilePath
- the source file being searched for- Returns:
- the node representing that source file or null if it cannot be found
-
findElementForOffSet
- Specified by:
findElementForOffSet
in interfaceIHierarchy
-
findCloserMatchForLineNumber
For a specified node, check if any of the children more accurately represent the specified line.- Specified by:
findCloserMatchForLineNumber
in interfaceIHierarchy
- Parameters:
node
- where to start lookinglineno
- the line number- Returns:
- any closer match below 'node' or null if nothing is a more accurate match
-
getConfigFile
- Specified by:
getConfigFile
in interfaceIHierarchy
-
setConfigFile
- Specified by:
setConfigFile
in interfaceIHierarchy
-
findElementForHandle
- Specified by:
findElementForHandle
in interfaceIHierarchy
-
findElementForHandleOrCreate
- Specified by:
findElementForHandleOrCreate
in interfaceIHierarchy
-
cache
-
flushTypeMap
public void flushTypeMap()- Specified by:
flushTypeMap
in interfaceIHierarchy
-
flushHandleMap
public void flushHandleMap()- Specified by:
flushHandleMap
in interfaceIHierarchy
-
flushFileMap
public void flushFileMap() -
forget
-
updateHandleMap
- Specified by:
updateHandleMap
in interfaceIHierarchy
-