|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.aspectwerkz.definition.AspectWerkzDefinition
Implements the AspectWerkz
definition.
Field Summary | |
static java.lang.String |
CALLER_SIDE_DELIMITER
|
static java.lang.String |
DEFAULT_DEFINITION_FILE_NAME
The default name for the definition file. |
static java.lang.String |
DEFINITION_FILE
The path to the definition file. |
static java.lang.String |
PER_CLASS
|
static java.lang.String |
PER_INSTANCE
|
static java.lang.String |
PER_JVM
|
static java.lang.String |
PER_THREAD
|
static java.lang.String |
SYSTEM_ASPECT
The name of the system aspect. |
static java.lang.String |
THROWS_DELIMITER
|
Constructor Summary | |
AspectWerkzDefinition()
Creates a new instance, creates and sets the system aspect. |
Method Summary | |
void |
addAbstractAspect(AspectDefinition aspect)
Adds an abstract aspect definition. |
void |
addAdvice(AdviceDefinition advice)
Adds an advice definition. |
void |
addAdviceStack(AdviceStackDefinition adviceStackDef)
Adds an advice stack definition. |
void |
addAspect(AspectDefinition aspect)
Adds an aspect definition. |
void |
addAspectToUse(java.lang.String className)
Adds a new aspect to use. |
void |
addIntroduction(IntroductionDefinition introduction)
Adds a new introductions definition. |
void |
addTransformationScope(java.lang.String transformationScope)
Adds a new transformation scope. |
static void |
createCallerSidePattern(java.lang.String pattern,
PointcutDefinition pointcutDef,
java.lang.String packageName)
Creates a caller side pattern and adds it to the pointcut definition. |
static void |
createClassPattern(java.lang.String pattern,
PointcutDefinition pointcutDef,
java.lang.String packageName)
Creates a class pattern and adds it to the pointcut definition. |
static AspectWerkzDefinition |
createDefinition(org.dom4j.Document document)
Creates, caches and returns new definition. |
static void |
createFieldPattern(java.lang.String pattern,
PointcutDefinition pointcutDef,
java.lang.String packageName)
Creates a field pattern and adds it to the pointcut definition. |
static void |
createMethodPattern(java.lang.String pattern,
PointcutDefinition pointcutDef,
java.lang.String packageName)
Creates a method pattern and adds it to the pointcut definition. |
static void |
createThrowsPattern(java.lang.String pattern,
PointcutDefinition pointcutDef,
java.lang.String packageName)
Creates a throws pattern and adds it to the pointcut definition. |
AspectDefinition |
getAbstractAspectDefinition(java.lang.String name)
Returns a specific abstract aspect definition. |
java.util.Collection |
getAbstractAspectDefinitions()
Returns a collection with the abstract aspect definitions registered. |
AdviceDefinition |
getAdviceDefinition(java.lang.String name)
Returns a specific advice definition. |
java.util.Collection |
getAdviceDefinitions()
Returns a collection with the advice definitions registered. |
java.lang.String |
getAdviceNameByAttribute(java.lang.String attribute)
Finds the name of an advice by its attribute. |
AdviceStackDefinition |
getAdviceStackDefinition(java.lang.String adviceStackName)
Finds an advice stack definition by its name. |
AspectDefinition |
getAspectDefinition(java.lang.String name)
Returns a specific aspect definition. |
java.util.Collection |
getAspectDefinitions()
Returns a collection with the aspect definitions registered. |
java.util.Set |
getAspectsToUse()
Returns a set with the aspects to use. |
java.lang.String[] |
getAspectTargetClassNames()
Returns the names of the target classes. |
static AspectWerkzDefinition |
getDefinition(java.lang.String uuid)
Loads the aspectwerkz definition from disk based on a specific UUID. |
static AspectWerkzDefinition |
getDefinitionForTransformation()
Loads the aspectwerkz definition from disk. |
static java.io.InputStream |
getDefinitionInputStream()
Returns an input stream to the definition if found on classpath. |
IntroductionDefinition |
getIntroductionDefinition(java.lang.String introductionName)
Returns a specific introduction definition. |
java.util.Collection |
getIntroductionDefinitions()
Returns a collection with the introduction definitions registered. |
java.lang.String |
getIntroductionImplName(java.lang.String introductionName)
Returns the name of the implementation for an introduction. |
int |
getIntroductionIndex(java.lang.String introductionName)
Returns the index for a specific introduction. |
gnu.trove.TObjectIntHashMap |
getIntroductionIndexes()
Returns the indexes for the introductions. |
java.lang.String |
getIntroductionInterfaceName(java.lang.String introductionName)
Returns the name of the interface for an introduction. |
java.lang.String |
getIntroductionNameByAttribute(java.lang.String attribute)
Finds the name of an introduction by its attribute. |
java.util.List |
getIntroductionNames(java.lang.String className)
Returns the names of the introductions for a certain class. |
java.lang.String |
getJoinPointController(ClassMetaData classMetaData,
MethodMetaData methodMetaData)
Returns the class name for the join point controller, if there is a match. |
java.util.Set |
getTransformationScopes()
Returns the transformation scopes. |
java.lang.String |
getUuid()
Returns the UUID for the definition. |
boolean |
hasAdvice(java.lang.String name)
Checks if there exists an advice with the name specified. |
boolean |
hasCallerSidePointcut(ClassMetaData classMetaData)
Checks if a class should care about advising caller side method invocations. |
boolean |
hasGetFieldPointcut(ClassMetaData classMetaData)
Checks if a class has a GetFieldPointcut. |
boolean |
hasGetFieldPointcut(ClassMetaData classMetaData,
FieldMetaData fieldMetaData)
Checks if a class and field has a GetFieldPointcut. |
boolean |
hasIntroduction(java.lang.String name)
Checks if there exists an introduction with the name specified. |
boolean |
hasIntroductions(java.lang.String className)
Checks if a class has an Introduction. |
boolean |
hasMethodPointcut(ClassMetaData classMetaData)
Checks if a method has a MethodPointcut. |
boolean |
hasMethodPointcut(ClassMetaData classMetaData,
MethodMetaData methodMetaData)
Checks if a method has a MethodPointcut. |
boolean |
hasSetFieldPointcut(ClassMetaData classMetaData)
Checks if a class has a SetFieldPointcut. |
boolean |
hasSetFieldPointcut(ClassMetaData classMetaData,
FieldMetaData fieldMetaData)
Checks if a class and field has a SetFieldPointcut. |
boolean |
hasThrowsPointcut(ClassMetaData classMetaData)
Checks if a class and method has a ThrowsPointcut. |
boolean |
hasThrowsPointcut(ClassMetaData classMetaData,
MethodMetaData methodMetaData)
Checks if a class and method has a ThrowsPointcut. |
boolean |
inTransformationScope(java.lang.String className)
Checks if a class has an Aspect. |
boolean |
isCallerSideMethod(ClassMetaData classMetaData,
MethodMetaData methodMetaData)
Checks if a method is a defined as a caller side method. |
static AspectWerkzDefinition |
loadDefaultDefinitionAsFile(boolean isDirty)
Returns the definition. |
static AspectWerkzDefinition |
loadDefinitionAsDocument(org.dom4j.Document document)
Returns the definition. |
static AspectWerkzDefinition |
loadDefinitionAsFile(java.lang.String definitionFile)
Returns the definition. |
static AspectWerkzDefinition |
loadDefinitionAsFile(java.lang.String definitionFile,
boolean isDirty)
Returns the definition. |
static AspectWerkzDefinition |
loadDefinitionAsResource()
Loads a definition from disk. |
static AspectWerkzDefinition |
loadDefinitionAsStream(java.io.InputStream stream)
Returns the definition. |
void |
setUuid(java.lang.String uuid)
Sets the UUID for the definition. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PER_JVM
public static final java.lang.String PER_CLASS
public static final java.lang.String PER_INSTANCE
public static final java.lang.String PER_THREAD
public static final java.lang.String THROWS_DELIMITER
public static final java.lang.String CALLER_SIDE_DELIMITER
public static final java.lang.String DEFINITION_FILE
public static final java.lang.String DEFAULT_DEFINITION_FILE_NAME
public static final java.lang.String SYSTEM_ASPECT
Constructor Detail |
public AspectWerkzDefinition()
Method Detail |
public static AspectWerkzDefinition createDefinition(org.dom4j.Document document)
document
- the DOM document containing the definition
public static AspectWerkzDefinition getDefinitionForTransformation()
public static AspectWerkzDefinition getDefinition(java.lang.String uuid)
uuid
- the uuid for the weave model to load (null is allowed if only XML definition is used)
public static AspectWerkzDefinition loadDefinitionAsResource()
public static AspectWerkzDefinition loadDefaultDefinitionAsFile(boolean isDirty)
isDirty
- flag to mark the the defintion as updated or not
public static AspectWerkzDefinition loadDefinitionAsFile(java.lang.String definitionFile)
definitionFile
- the definition file
public static AspectWerkzDefinition loadDefinitionAsFile(java.lang.String definitionFile, boolean isDirty)
definitionFile
- the definition fileisDirty
- flag to mark the the defintion as updated or not
public static AspectWerkzDefinition loadDefinitionAsStream(java.io.InputStream stream)
stream
- the stream containing the definition file
public static AspectWerkzDefinition loadDefinitionAsDocument(org.dom4j.Document document)
document
- the DOM document containing the definition file
public static java.io.InputStream getDefinitionInputStream()
public static void createClassPattern(java.lang.String pattern, PointcutDefinition pointcutDef, java.lang.String packageName)
pattern
- the patternpointcutDef
- the pointcut definitionpackageName
- the name of the packagepublic static void createMethodPattern(java.lang.String pattern, PointcutDefinition pointcutDef, java.lang.String packageName)
pattern
- the patternpointcutDef
- the pointcut definitionpackageName
- the name of the packagepublic static void createFieldPattern(java.lang.String pattern, PointcutDefinition pointcutDef, java.lang.String packageName)
pattern
- the patternpointcutDef
- the pointcut definitionpackageName
- the name of the packagepublic static void createThrowsPattern(java.lang.String pattern, PointcutDefinition pointcutDef, java.lang.String packageName)
pattern
- the patternpointcutDef
- the pointcut definitionpackageName
- the name of the packagepublic static void createCallerSidePattern(java.lang.String pattern, PointcutDefinition pointcutDef, java.lang.String packageName)
pattern
- the patternpointcutDef
- the pointcut definitionpackageName
- the name of the packagepublic void setUuid(java.lang.String uuid)
uuid
- the UUIDpublic java.lang.String getUuid()
public java.util.Set getTransformationScopes()
public java.util.Collection getAbstractAspectDefinitions()
public java.util.Collection getAspectDefinitions()
public java.util.Collection getIntroductionDefinitions()
public java.util.Collection getAdviceDefinitions()
public AdviceStackDefinition getAdviceStackDefinition(java.lang.String adviceStackName)
adviceStackName
- the advice stack name
public AspectDefinition getAbstractAspectDefinition(java.lang.String name)
name
- the name of the abstract aspect definition
public AspectDefinition getAspectDefinition(java.lang.String name)
name
- the name of the aspect definition
public java.lang.String[] getAspectTargetClassNames()
public AdviceDefinition getAdviceDefinition(java.lang.String name)
name
- the name of the advice definition
public java.lang.String getAdviceNameByAttribute(java.lang.String attribute)
attribute
- the attribute
public java.lang.String getIntroductionNameByAttribute(java.lang.String attribute)
attribute
- the attribute
public java.lang.String getIntroductionInterfaceName(java.lang.String introductionName)
introductionName
- the name of the introduction
public java.lang.String getIntroductionImplName(java.lang.String introductionName)
introductionName
- the name of the introduction
public IntroductionDefinition getIntroductionDefinition(java.lang.String introductionName)
introductionName
- the name of the introduction
public int getIntroductionIndex(java.lang.String introductionName)
introductionName
- the name of the introduction
public gnu.trove.TObjectIntHashMap getIntroductionIndexes()
public java.lang.String getJoinPointController(ClassMetaData classMetaData, MethodMetaData methodMetaData)
classMetaData
- the class meta-datamethodMetaData
- the method meta-data
public java.util.Set getAspectsToUse()
public void addAspectToUse(java.lang.String className)
className
- the class name of the aspectpublic void addTransformationScope(java.lang.String transformationScope)
transformationScope
- the new scopepublic void addAbstractAspect(AspectDefinition aspect)
aspect
- a new abstract aspect definitionpublic void addAspect(AspectDefinition aspect)
aspect
- a new aspect definitionpublic void addAdviceStack(AdviceStackDefinition adviceStackDef)
adviceStackDef
- the advice stack definitionpublic void addAdvice(AdviceDefinition advice)
advice
- the advice definitionpublic void addIntroduction(IntroductionDefinition introduction)
introduction
- the introduction definitionpublic boolean hasAdvice(java.lang.String name)
name
- the name of the advice
public boolean hasIntroduction(java.lang.String name)
name
- the name of the introduction
public boolean inTransformationScope(java.lang.String className)
className
- the name or the class
public boolean hasIntroductions(java.lang.String className)
className
- the name or the class
public boolean hasMethodPointcut(ClassMetaData classMetaData)
classMetaData
- the class meta-data
public boolean hasMethodPointcut(ClassMetaData classMetaData, MethodMetaData methodMetaData)
classMetaData
- the class meta-datamethodMetaData
- the method meta-data
public boolean hasGetFieldPointcut(ClassMetaData classMetaData)
classMetaData
- the class meta-data
public boolean hasGetFieldPointcut(ClassMetaData classMetaData, FieldMetaData fieldMetaData)
classMetaData
- the class meta-datafieldMetaData
- the name or the field
public boolean hasSetFieldPointcut(ClassMetaData classMetaData)
classMetaData
- the class meta-data
public boolean hasSetFieldPointcut(ClassMetaData classMetaData, FieldMetaData fieldMetaData)
classMetaData
- the class meta-datafieldMetaData
- the name or the field
public boolean hasThrowsPointcut(ClassMetaData classMetaData)
classMetaData
- the class meta-data
public boolean hasThrowsPointcut(ClassMetaData classMetaData, MethodMetaData methodMetaData)
classMetaData
- the class meta-datamethodMetaData
- the name or the method
public boolean hasCallerSidePointcut(ClassMetaData classMetaData)
classMetaData
- the class meta-data
public boolean isCallerSideMethod(ClassMetaData classMetaData, MethodMetaData methodMetaData)
classMetaData
- the class meta-datamethodMetaData
- the name or the method
public java.util.List getIntroductionNames(java.lang.String className)
className
- the name of the class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |