]> source.dussan.org Git - aspectj.git/commitdiff
271201: inpath handles
authoraclement <aclement>
Mon, 6 Apr 2009 19:24:09 +0000 (19:24 +0000)
committeraclement <aclement>
Mon, 6 Apr 2009 19:24:09 +0000 (19:24 +0000)
asm/src/org/aspectj/asm/AsmManager.java

index 5152908f2a54e2d9d613dc3ae9a958f28dd71909..e5e30fd49fd6b1e9ed31b72fed66e0d41b517dd3 100644 (file)
@@ -82,6 +82,10 @@ public class AsmManager implements IStructureModel {
        // below to the AjState for a compilation and recover it if switching
        // between projects.
        protected IHierarchy hierarchy;
+       
+       /* Map from String > String - it maps absolute paths for 
+        * inpath dirs/jars to workspace relative paths suitable for handle inclusion */
+       protected Map inpathMap;
        private IRelationshipMap mapper;
        private IElementHandleProvider handleProvider;
 
@@ -100,11 +104,12 @@ public class AsmManager implements IStructureModel {
        private AsmManager() {
        }
 
-       public static AsmManager createNewStructureModel() {
+       public static AsmManager createNewStructureModel(Map inpathMap) {
                if (forceSingletonBehaviour && lastActiveStructureModel != null) {
                        return lastActiveStructureModel;
                }
                AsmManager asm = new AsmManager();
+               asm.inpathMap = inpathMap;
                asm.hierarchy = new AspectJElementHierarchy(asm);
                asm.mapper = new RelationshipMap(asm.hierarchy);
                asm.handleProvider = new JDTLikeHandleProvider(asm);
@@ -1256,4 +1261,8 @@ public class AsmManager implements IStructureModel {
                }
        }
 
+       public String getHandleElementForInpath(String binaryPath) {
+               return (String)inpathMap.get(new File(binaryPath));
+       }
+
 }