Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] parsePointcutExpression in a multi-package context

Hi,

As the doc mentions inScope is for defining what the pointcut should 'appear' to have been defined in for the purposes of resolution (being Object if you pass in null). I haven't dug into it but I presume that would be for reasons of chasing down unqualified type references. I think the 'overall scope' in which type references would be resolved would be the classloader you passed in to configure the pointcut parser.  So if you pass in a classloader with a certain classpath, the pointcut will be parsed with respect to that.  Do you have an example pointcut that causes you problems with this approach?  If you have a class around that was loaded from the classloader (classpath) you are interested in, access its classloader and pass that to the getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution() call. 

cheers,
Andy



On 21 January 2013 10:48, ccol002 <chriscol002@xxxxxxxxx> wrote:
I am using reflection to parse pointcuts and it works fine within the same
package. I am also able to change the scope by specifying a particular class
(inScope in the code below). However I was wondering whether there is a way
of specifying a multi-package context (e.g. all the packages in the class
path).

ClassLoader cl = ClassLoader.getSystemClassLoader();
PointcutParser pp =
PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(cl);
PointcutExpression pe = pp.parsePointcutExpression(pattern,inScope,new
PointcutParameter[0]);

Thanks!



--
View this message in context: http://aspectj.2085585.n4.nabble.com/parsePointcutExpression-in-a-multi-package-context-tp4650730.html
Sent from the AspectJ - users mailing list archive at Nabble.com.
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top