From 87015450336c5eef0572e445cddcdacfec10cc91 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 14 Mar 2008 18:53:37 +0000 Subject: [PATCH] 205907 - world remembers registered handlers --- weaver/src/org/aspectj/weaver/World.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java index bb0cd0b48..99b7c89e5 100644 --- a/weaver/src/org/aspectj/weaver/World.java +++ b/weaver/src/org/aspectj/weaver/World.java @@ -20,10 +20,12 @@ import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; +import java.util.Set; import java.util.WeakHashMap; import org.aspectj.asm.IHierarchy; @@ -39,6 +41,7 @@ import org.aspectj.weaver.patterns.DeclarePrecedence; import org.aspectj.weaver.patterns.PerClause; import org.aspectj.weaver.patterns.Pointcut; import org.aspectj.weaver.reflect.ReflectionBasedReferenceTypeDelegate; +import org.aspectj.weaver.tools.PointcutDesignatorHandler; import org.aspectj.weaver.tools.Trace; import org.aspectj.weaver.tools.TraceFactory; @@ -58,6 +61,9 @@ public abstract class World implements Dump.INode { /** The heart of the world, a map from type signatures to resolved types */ protected TypeMap typeMap = new TypeMap(this); // Signature to ResolvedType + /** New pointcut designators this world supports */ + private Set pointcutDesignators; + // see pr145963 /** Should we create the hierarchy for binary classes and aspects*/ public static boolean createInjarHierarchy = true; @@ -1277,4 +1283,20 @@ public abstract class World implements Dump.INode { return typeMap.getAllTypes(); } + /** + * Register a new pointcut designator handler with the world - this can be used by any pointcut parsers attached + * to the world. + * + * @param designatorHandler handler for the new pointcut + */ + public void registerPointcutHandler(PointcutDesignatorHandler designatorHandler) { + if (pointcutDesignators == null) pointcutDesignators = new HashSet(); + pointcutDesignators.add(designatorHandler); + } + + public Set getRegisteredPointcutHandlers() { + if (pointcutDesignators == null) return Collections.EMPTY_SET; + return pointcutDesignators; + } + } \ No newline at end of file -- 2.39.5