public class PointcutParser
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
PointcutParser()
Create a pointcut parser that can parse the full AspectJ pointcut language with the following exceptions:
The
if, cflow, and cflowbelow pointcut designators are not supported
Pointcut expressions must be self-contained :- they cannot contain references to other named pointcuts
The pointcut expression must be anonymous with no formals allowed. |
Modifier and Type | Method and Description |
---|---|
protected Pointcut |
concretizePointcutExpression(Pointcut pc,
java.lang.Class<?> inScope,
PointcutParameter[] formalParameters) |
PointcutParameter |
createPointcutParameter(java.lang.String name,
java.lang.Class<?> type)
Create a pointcut parameter of the given name and type.
|
static java.util.Set<PointcutPrimitive> |
getAllSupportedPointcutPrimitives() |
static PointcutParser |
getPointcutParserSupportingAllPrimitivesAndUsingContextClassloaderForResolution()
Returns a pointcut parser that can parse the full AspectJ pointcut language with the following exceptions:
The
if, cflow, and cflowbelow pointcut designators are not supported
Pointcut expressions must be self-contained :- they cannot contain references to other named pointcuts
The pointcut expression must be anonymous with no formals allowed. |
static PointcutParser |
getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(java.lang.ClassLoader classLoader)
Returns a pointcut parser that can parse the full AspectJ pointcut language with the following exceptions:
The
if, cflow, and cflowbelow pointcut designators are not supported
Pointcut expressions must be self-contained :- they cannot contain references to other named pointcuts
The pointcut expression must be anonymous with no formals allowed. |
static PointcutParser |
getPointcutParserSupportingSpecifiedPrimitivesAndUsingContextClassloaderForResolution(java.util.Set<PointcutPrimitive> supportedPointcutKinds)
Returns a pointcut parser that can parse pointcut expressions built from a user-defined subset of AspectJ's supported
pointcut primitives.
|
static PointcutParser |
getPointcutParserSupportingSpecifiedPrimitivesAndUsingSpecifiedClassLoaderForResolution(java.util.Set<PointcutPrimitive> supportedPointcutKinds,
java.lang.ClassLoader classLoader)
Returns a pointcut parser that can parse pointcut expressions built from a user-defined subset of AspectJ's supported
pointcut primitives.
|
PointcutExpression |
parsePointcutExpression(java.lang.String expression)
Parse the given pointcut expression.
|
PointcutExpression |
parsePointcutExpression(java.lang.String expression,
java.lang.Class<?> inScope,
PointcutParameter[] formalParameters)
Parse the given pointcut expression.
|
TypePatternMatcher |
parseTypePattern(java.lang.String typePattern)
Parse the given aspectj type pattern, and return a matcher that can be used to match types using it.
|
void |
registerPointcutDesignatorHandler(PointcutDesignatorHandler designatorHandler)
Register a new pointcut designator handler with this parser.
|
protected Pointcut |
resolvePointcutExpression(java.lang.String expression,
java.lang.Class<?> inScope,
PointcutParameter[] formalParameters) |
protected void |
setClassLoader(java.lang.ClassLoader aLoader)
Set the classloader that this parser should use for type resolution.
|
protected void |
setClassLoader(java.lang.ClassLoader aLoader,
boolean shareWorlds)
Set the classloader that this parser should use for type resolution.
|
void |
setLintProperties(java.util.Properties properties)
Set the lint properties for this parser from the given properties set.
|
void |
setLintProperties(java.lang.String resourcePath)
Set the lint properties for this parser from the given resource on the classpath.
|
protected void |
setWorld(ReflectionWorld aWorld) |
protected PointcutParser()
if, cflow, and cflowbelow
pointcut designators are not supported
public static java.util.Set<PointcutPrimitive> getAllSupportedPointcutPrimitives()
public static PointcutParser getPointcutParserSupportingAllPrimitivesAndUsingContextClassloaderForResolution()
if, cflow, and cflowbelow
pointcut designators are not supported
When resolving types in pointcut expressions, the context classloader is used to find types.
public static PointcutParser getPointcutParserSupportingSpecifiedPrimitivesAndUsingContextClassloaderForResolution(java.util.Set<PointcutPrimitive> supportedPointcutKinds)
if, cflow, and cflowbelow
pointcut designators are not supported
When resolving types in pointcut expressions, the context classloader is used to find types.
supportedPointcutKinds
- a set of PointcutPrimitives this parser should supportjava.lang.UnsupportedOperationException
- if the set contains if, cflow, or cflow belowpublic static PointcutParser getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(java.lang.ClassLoader classLoader)
if, cflow, and cflowbelow
pointcut designators are not supported
When resolving types in pointcut expressions, the given classloader is used to find types.
public static PointcutParser getPointcutParserSupportingSpecifiedPrimitivesAndUsingSpecifiedClassLoaderForResolution(java.util.Set<PointcutPrimitive> supportedPointcutKinds, java.lang.ClassLoader classLoader)
if, cflow, and cflowbelow
pointcut designators are not supported
When resolving types in pointcut expressions, the given classloader is used to find types.
supportedPointcutKinds
- a set of PointcutPrimitives this parser should supportjava.lang.UnsupportedOperationException
- if the set contains if, cflow, or cflow belowprotected void setWorld(ReflectionWorld aWorld)
protected void setClassLoader(java.lang.ClassLoader aLoader)
aLoader
- protected void setClassLoader(java.lang.ClassLoader aLoader, boolean shareWorlds)
aLoader
- shareWorlds
- if true then two PointcutParsers operating using the same classloader will share a ReflectionWorldpublic void setLintProperties(java.lang.String resourcePath) throws java.io.IOException
resourcePath
- path to a file containing aspectj lint propertiesjava.io.IOException
public void setLintProperties(java.util.Properties properties)
properties
- public void registerPointcutDesignatorHandler(PointcutDesignatorHandler designatorHandler)
designatorHandler
- public PointcutParameter createPointcutParameter(java.lang.String name, java.lang.Class<?> type)
name
- type
- public PointcutExpression parsePointcutExpression(java.lang.String expression) throws UnsupportedPointcutPrimitiveException, java.lang.IllegalArgumentException
UnsupportedPointcutPrimitiveException
- if the parser encounters a primitive pointcut expression of a kind not
supported by this PointcutParser.java.lang.IllegalArgumentException
- if the expression is not a well-formed pointcut expressionpublic PointcutExpression parsePointcutExpression(java.lang.String expression, java.lang.Class<?> inScope, PointcutParameter[] formalParameters) throws UnsupportedPointcutPrimitiveException, java.lang.IllegalArgumentException
UnsupportedPointcutPrimitiveException
- if the parser encounters a primitive pointcut expression of a kind not
supported by this PointcutParser.java.lang.IllegalArgumentException
- if the expression is not a well-formed pointcut expressionprotected Pointcut resolvePointcutExpression(java.lang.String expression, java.lang.Class<?> inScope, PointcutParameter[] formalParameters)
protected Pointcut concretizePointcutExpression(Pointcut pc, java.lang.Class<?> inScope, PointcutParameter[] formalParameters)
public TypePatternMatcher parseTypePattern(java.lang.String typePattern) throws java.lang.IllegalArgumentException
typePattern
- an aspectj type patternjava.lang.IllegalArgumentException
- if the type pattern cannot be successfully parsed.