org.aspectj.weaver
Class Checker

java.lang.Object
  extended by org.aspectj.weaver.ShadowMunger
      extended by org.aspectj.weaver.Checker
All Implemented Interfaces:
PartialOrder.PartialComparable, IHasPosition

public class Checker
extends ShadowMunger

Representation of a shadow munger for a declare error or warning declaration.


Field Summary
 
Fields inherited from class org.aspectj.weaver.ShadowMunger
end, handle, NONE, pointcut, ShadowMungerAdvice, ShadowMungerDeow, sourceContext, start
 
Constructor Summary
Checker(DeclareErrorOrWarning deow)
          Create a Checker for a declare error or declare warning.
 
Method Summary
 int compareTo(java.lang.Object other)
           
 ShadowMunger concretize(ResolvedType theAspect, World world, PerClause clause)
          Concretize this Checker by concretizing the pointcut
 boolean equals(java.lang.Object other)
           
 ResolvedType getConcreteAspect()
           
 java.lang.String getMessage(Shadow shadow)
           
 java.util.Collection<ResolvedType> getThrownExceptions()
           
 int hashCode()
           
 boolean implementOn(Shadow shadow)
          Implement this munger at the specified shadow, returning a boolean to indicate success.
 boolean isError()
           
 boolean match(Shadow shadow, World world)
          Determine if the Checker matches at a shadow.
 boolean mustCheckExceptions()
          Does 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.
 ShadowMunger parameterizeWith(ResolvedType declaringType, java.util.Map<java.lang.String,UnresolvedType> typeVariableMap)
          Parameterize the Checker by parameterizing the pointcut
 void specializeOn(Shadow shadow)
           
 
Methods inherited from class org.aspectj.weaver.ShadowMunger
fallbackCompareTo, getBinarySourceLocation, getDeclaringType, getEnd, getPointcut, getSourceLocation, getStart, isBinary, setDeclaringType, setPointcut, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Checker

public Checker(DeclareErrorOrWarning deow)
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 Detail

isError

public boolean isError()

getMessage

public java.lang.String getMessage(Shadow shadow)

specializeOn

public void specializeOn(Shadow shadow)
Specified by:
specializeOn in class ShadowMunger

implementOn

public boolean implementOn(Shadow shadow)
Description copied from class: ShadowMunger
Implement this munger at the specified shadow, returning a boolean to indicate success.

Specified by:
implementOn in class ShadowMunger
Parameters:
shadow - the shadow where this munger should be applied
Returns:
true if the implement was successful

match

public boolean match(Shadow shadow,
                     World world)
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:
match in class ShadowMunger
Parameters:
shadow - the shadow which to match against
world - the world through which to access message handlers

compareTo

public int compareTo(java.lang.Object other)

mustCheckExceptions

public boolean mustCheckExceptions()
Description copied from class: ShadowMunger
Does 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:
mustCheckExceptions in class ShadowMunger
Returns:
true if munger has to check that its exceptions can be thrown based on the shadow

getThrownExceptions

public java.util.Collection<ResolvedType> getThrownExceptions()
Specified by:
getThrownExceptions in class ShadowMunger
Returns:
a Collection of ResolvedTypes for all checked exceptions that might be thrown by this munger

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

parameterizeWith

public ShadowMunger parameterizeWith(ResolvedType declaringType,
                                     java.util.Map<java.lang.String,UnresolvedType> typeVariableMap)
Parameterize the Checker by parameterizing the pointcut

Specified by:
parameterizeWith in class ShadowMunger

concretize

public ShadowMunger concretize(ResolvedType theAspect,
                               World world,
                               PerClause clause)
Concretize this Checker by concretizing the pointcut

Specified by:
concretize in class ShadowMunger

getConcreteAspect

public ResolvedType getConcreteAspect()
Specified by:
getConcreteAspect in class ShadowMunger