diff options
author | mkersten <mkersten> | 2004-10-14 21:45:07 +0000 |
---|---|---|
committer | mkersten <mkersten> | 2004-10-14 21:45:07 +0000 |
commit | 4a4d4b2612ab6bbd9c82dc03b08b13f696725bf3 (patch) | |
tree | 1655439b851c7caad506cf53b8500a1a929696fd /asm | |
parent | 0a77939b3286d5ac033797234741436c57ad202f (diff) | |
download | aspectj-4a4d4b2612ab6bbd9c82dc03b08b13f696725bf3.tar.gz aspectj-4a4d4b2612ab6bbd9c82dc03b08b13f696725bf3.zip |
Added "uses pointcut" relation to the ASM.
Diffstat (limited to 'asm')
-rw-r--r-- | asm/src/org/aspectj/asm/IRelationship.java | 3 | ||||
-rw-r--r-- | asm/src/org/aspectj/asm/internal/ProgramElement.java | 30 | ||||
-rw-r--r-- | asm/src/org/aspectj/asm/overview.html | 11 |
3 files changed, 28 insertions, 16 deletions
diff --git a/asm/src/org/aspectj/asm/IRelationship.java b/asm/src/org/aspectj/asm/IRelationship.java index 53b118262..4a33d4fb0 100644 --- a/asm/src/org/aspectj/asm/IRelationship.java +++ b/asm/src/org/aspectj/asm/IRelationship.java @@ -48,11 +48,12 @@ public interface IRelationship extends Serializable { public static final Kind ADVICE = new Kind("advice"); public static final Kind DECLARE = new Kind("declare"); public static final Kind DECLARE_INTER_TYPE = new Kind("inter-type declaration"); + public static final Kind USES_POINTCUT = new Kind("uses pointcut"); public static final Kind[] ALL = { DECLARE_WARNING, DECLARE_ERROR, ADVICE_AROUND,ADVICE_AFTERRETURNING,ADVICE_AFTERTHROWING,ADVICE_AFTER,ADVICE_BEFORE, - ADVICE, DECLARE, DECLARE_INTER_TYPE }; + ADVICE, DECLARE, DECLARE_INTER_TYPE, USES_POINTCUT }; private final String name; diff --git a/asm/src/org/aspectj/asm/internal/ProgramElement.java b/asm/src/org/aspectj/asm/internal/ProgramElement.java index ef4b28507..3965c21d0 100644 --- a/asm/src/org/aspectj/asm/internal/ProgramElement.java +++ b/asm/src/org/aspectj/asm/internal/ProgramElement.java @@ -459,21 +459,25 @@ public class ProgramElement implements IProgramElement { private String handle = null; public String getHandleIdentifier() { - if (null == handle) { - if (sourceLocation != null) { - StringBuffer sb = new StringBuffer(); - sb.append(AsmManager.getDefault() - .getCanonicalFilePath(sourceLocation.getSourceFile())); - sb.append(ID_DELIM); - sb.append(sourceLocation.getLine()); - sb.append(ID_DELIM); - sb.append(sourceLocation.getColumn()); - handle = sb.toString(); - } - } - return handle; + if (null == handle) { + if (sourceLocation != null) { + return genHandleIdentifier(sourceLocation); + } + } + return handle; } + public static String genHandleIdentifier(ISourceLocation sourceLocation) { + StringBuffer sb = new StringBuffer(); + sb.append(AsmManager.getDefault() + .getCanonicalFilePath(sourceLocation.getSourceFile())); + sb.append(ID_DELIM); + sb.append(sourceLocation.getLine()); + sb.append(ID_DELIM); + sb.append(sourceLocation.getColumn()); + return sb.toString(); + } + public List getParameterNames() { return parameterNames; } diff --git a/asm/src/org/aspectj/asm/overview.html b/asm/src/org/aspectj/asm/overview.html index 6608bd24e..3c5f61411 100644 --- a/asm/src/org/aspectj/asm/overview.html +++ b/asm/src/org/aspectj/asm/overview.html @@ -1,9 +1,16 @@ -<p>The is a placeholder for a document describing the Abstract Structure Model (ASM). +<p> </p> -<p><b>Notes</b></p> +<p><b>Notes on using the Abstract Structure Model (ASM)</b></p> <ul> <li>The ASM contains the declaration hierarchy up to the member signature level of granularity. In the case that an sub-method element is advised (e.g. a call site, field get/set, or exception handler) the advised element will also be present as a child of that member.</li> + <li>The structure model is built during the compilation process, after advice planning is done and before bytecodes are produced. Here are the method calls involved with compiling and getting the model. The org.aspectj.asm package contains the structure model APIs. + Ajde.getDefault().getConfigurationManager().setActiveConfigFile("foo.lst"); +Ajde.getDefault().getBuildManager().build(); Ajde.getDefault().getStructureModelManager().getStructureModel(); +<li> +For examples of how to walk the model take a look at StructureModelTest in the test sources of the org.aspectj.ajde package. +<li> +If you're interested in being notified of when the model has been updated (i.e. when the user completed a compile) you can register a new listener with by calling the StructureModelManager.addListener method in the org.aspectj.asm package. The org.aspectj.ajde package also has an API for creating views of the model, and you can look to the any IDE plug-in to see how they are used. </ul> |