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
FieldsFields inherited from interface org.aspectj.asm.IHierarchy
NO_STRUCTURE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToFileMap(String key, IProgramElement value)protected voidcache(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.voidvoidvoidvoidforget(IProgramElement compilationUnitNode, IProgramElement typeNode)getElement(String handle)getRoot()booleanisValid()booleanremoveFromFileMap(String canonicalFilePath)voidsetAsmManager(AsmManager asm)voidsetConfigFile(String configFile)voidsetFileMap(Map<String,IProgramElement> fileMap)voidsetRoot(IProgramElement root)voidupdateHandleMap(Set<String> deletedFiles)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aspectj.asm.IHierarchy
setFileMap
-
Field Details
-
root
-
configFile
-
-
Constructor Details
-
AspectJElementHierarchy
-
-
Method Details
-
getElement
- Specified by:
getElementin interfaceIHierarchy
-
setAsmManager
-
getRoot
- Specified by:
getRootin interfaceIHierarchy
-
toSummaryString
-
setRoot
- Specified by:
setRootin interfaceIHierarchy
-
addToFileMap
- Specified by:
addToFileMapin interfaceIHierarchy
-
removeFromFileMap
- Specified by:
removeFromFileMapin interfaceIHierarchy
-
setFileMap
- Specified by:
setFileMapin interfaceIHierarchy
-
findInFileMap
- Specified by:
findInFileMapin interfaceIHierarchy
-
getFileMapEntrySet
- Specified by:
getFileMapEntrySetin interfaceIHierarchy
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceIHierarchy
-
findElementForSignature
public IProgramElement findElementForSignature(IProgramElement parent, IProgramElement.Kind kind, String signature)Returns the first match- Specified by:
findElementForSignaturein 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:IHierarchyReturns the first match- Specified by:
findElementForLabelin interfaceIHierarchykind- not null- Returns:
- null if not found
-
findElementForType
Find the entry in the model that represents a particular type.- Specified by:
findElementForTypein 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:
findElementForSourceFilein 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:
findElementForSourceLinein interfaceIHierarchy
-
findElementForSourceLine
Never returns null- Specified by:
findElementForSourceLinein 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:
findNodeForSourceFilein 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:
findElementForOffSetin interfaceIHierarchy
-
findCloserMatchForLineNumber
For a specified node, check if any of the children more accurately represent the specified line.- Specified by:
findCloserMatchForLineNumberin 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:
getConfigFilein interfaceIHierarchy
-
setConfigFile
- Specified by:
setConfigFilein interfaceIHierarchy
-
findElementForHandle
- Specified by:
findElementForHandlein interfaceIHierarchy
-
findElementForHandleOrCreate
- Specified by:
findElementForHandleOrCreatein interfaceIHierarchy
-
cache
-
flushTypeMap
public void flushTypeMap()- Specified by:
flushTypeMapin interfaceIHierarchy
-
flushHandleMap
public void flushHandleMap()- Specified by:
flushHandleMapin interfaceIHierarchy
-
flushFileMap
public void flushFileMap() -
forget
-
updateHandleMap
- Specified by:
updateHandleMapin interfaceIHierarchy
-