Class Checker
java.lang.Object
org.aspectj.weaver.ShadowMunger
org.aspectj.weaver.Checker
- All Implemented Interfaces:
PartialOrder.PartialComparable, IHasPosition
Representation of a shadow munger for a declare error or warning declaration.
- Author:
- Andy Clement
-
Field Summary
Fields inherited from class ShadowMunger
end, handle, NONE, pointcut, ShadowMungerAdvice, ShadowMungerDeow, sourceContext, startModifier and TypeFieldDescriptionprotected intstatic final ShadowMunger[]protected Pointcutprotected static final intprotected static final intprotected ISourceContextprotected int -
Constructor Summary
ConstructorsConstructorDescriptionChecker(DeclareErrorOrWarning deow) Create a Checker for a declare error or declare warning. -
Method Summary
Modifier and TypeMethodDescriptionintconcretize(ResolvedType theAspect, World world, PerClause clause) Concretize this Checker by concretizing the pointcutbooleangetMessage(Shadow shadow) inthashCode()booleanimplementOn(Shadow shadow) Implement this munger at the specified shadow, returning a boolean to indicate success.booleanisError()booleanDetermine if the Checker matches at a shadow.booleanDoes the munger have to check that its exception are accepted by the shadow ? It is not the case for annotation style around advice, for example: that can throw Throwable, even if the advised method does not throw any exceptions.parameterizeWith(ResolvedType declaringType, Map<String, UnresolvedType> typeVariableMap) Parameterize the Checker by parameterizing the pointcutvoidspecializeOn(Shadow shadow) Methods inherited from class ShadowMunger
bindsProceedingJoinPoint, fallbackCompareTo, getBinarySourceLocation, getDeclaringType, getEnd, getPointcut, getSourceLocation, getStart, isAroundAdvice, isBinary, setDeclaringType, setPointcut, writeModifier and TypeMethodDescriptionbooleanintfallbackCompareTo(Object other) This method can provide a deterministic ordering for elements that are strictly not comparable.Returns the binarySourceLocation for the given sourcelocation.intgetEnd()The ending index of this location in the character stream This points to the last character in this token.intgetStart()The starting index of this location in the character stream.booleanbooleanisBinary()Returns whether or not this shadow munger came from a binary aspect - keep a record of whether or not we've checked if we're binary otherwise we keep calculating the same thing many timesvoidsetDeclaringType(ResolvedType aType) Invoked when the shadow munger of a resolved type are processed.voidsetPointcut(Pointcut pointcut) voidwrite(CompressingDataOutputStream stream)
-
Constructor Details
-
Checker
Create a Checker for a declare error or declare warning.- Parameters:
deow- the declare error or declare warning for which to create the checker munger
-
-
Method Details
-
isError
public boolean isError() -
getMessage
-
specializeOn
- Specified by:
specializeOnin classShadowMunger
-
implementOn
Description copied from class:ShadowMungerImplement this munger at the specified shadow, returning a boolean to indicate success.- Specified by:
implementOnin classShadowMunger- Parameters:
shadow- the shadow where this munger should be applied- Returns:
- true if the implement was successful
-
match
Determine if the Checker matches at a shadow. If it does then we can immediately report the message. Currently, there can never be a non-statically determinable match.- Overrides:
matchin classShadowMunger- Parameters:
shadow- the shadow which to match againstworld- the world through which to access message handlers
-
compareTo
- Returns:
- +1 if this is greater than other
- -1 if this is less than other
- 0 if this is not comparable to other
-
mustCheckExceptions
public boolean mustCheckExceptions()Description copied from class:ShadowMungerDoes the munger have to check that its exception are accepted by the shadow ? It is not the case for annotation style around advice, for example: that can throw Throwable, even if the advised method does not throw any exceptions.- Specified by:
mustCheckExceptionsin classShadowMunger- Returns:
- true if munger has to check that its exceptions can be thrown based on the shadow
-
getThrownExceptions
- Specified by:
getThrownExceptionsin classShadowMunger- Returns:
- a Collection of ResolvedTypes for all checked exceptions that might be thrown by this munger
-
equals
-
hashCode
-
parameterizeWith
public ShadowMunger parameterizeWith(ResolvedType declaringType, Map<String, UnresolvedType> typeVariableMap) Parameterize the Checker by parameterizing the pointcut- Specified by:
parameterizeWithin classShadowMunger
-
concretize
Concretize this Checker by concretizing the pointcut- Specified by:
concretizein classShadowMunger
-
getConcreteAspect
- Specified by:
getConcreteAspectin classShadowMunger
-