Top Description Fields Constructors Methods
org.aspectj.weaver

public Class Checker

extends ShadowMunger
Class Inheritance
Imports
java.util.Collection, .Collections, .Map, org.aspectj.bridge.ISourceLocation, org.aspectj.weaver.patterns.DeclareErrorOrWarning, .PerClause, .Pointcut

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

Field Summary

Modifier and TypeField and Description
private volatile int
private boolean
private String
Inherited from org.aspectj.weaver.ShadowMunger:
endhandleNONEpointcutShadowMungerAdviceShadowMungerDeowsourceContextstart

Constructor Summary

AccessConstructor and Description
private
public
Checker(DeclareErrorOrWarning
the declare error or declare warning for which to create the checker munger
deow
)

Create a Checker for a declare error or declare warning.

private
Checker(Pointcut pointcut, int start, int end, ISourceContext context, String message, boolean isError)

Only used when filling in a parameterized Checker

Method Summary

Modifier and TypeMethod and Description
public int
public ShadowMunger
concretize(ResolvedType theAspect, World world, PerClause clause)

Implements abstract org.aspectj.weaver.ShadowMunger.concretize.

Concretize this Checker by concretizing the pointcut
public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
private String
format(String msg, Shadow shadow)

public ResolvedType
public String
public Collection<ResolvedType>
private String
getValue(String
the buffer in which to insert the substitution
key
,
Shadow
shadow from which to draw context info
shadow
)

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
implementOn(Shadow
the shadow where this munger should be applied
shadow
)

Implements abstract org.aspectj.weaver.ShadowMunger.implementOn.

Implement this munger at the specified shadow, returning a boolean to indicate success.
public boolean
public boolean
match(Shadow
the shadow which to match against
shadow
,
World
the world through which to access message handlers
world
)

Overrides org.aspectj.weaver.ShadowMunger.match.

Determine if the Checker matches at a shadow.
public boolean
mustCheckExceptions()

Implements abstract org.aspectj.weaver.ShadowMunger.mustCheckExceptions.

Does the munger have to check that its exception are accepted by the shadow ?
private int
nextCurly(String string, int pos)

public ShadowMunger
parameterizeWith(ResolvedType declaringType, Map<String, UnresolvedType> typeVariableMap)

Implements abstract org.aspectj.weaver.ShadowMunger.parameterizeWith.

Parameterize the Checker by parameterizing the pointcut
public void
Inherited from org.aspectj.weaver.ShadowMunger:
bindsProceedingJoinPointfallbackCompareTogetBinarySourceLocationgetDeclaringTypegetEndgetPointcutgetSourceLocationgetStartisAroundAdviceisBinarysetDeclaringTypesetPointcutwrite

Field Detail

hashCodeback to summary
private volatile int hashCode
isErrorback to summary
private boolean isError
messageback to summary
private String message

Constructor Detail

Checkerback to summary
private Checker()
Annotations
@SuppressWarnings:unused
Checkerback to summary
public Checker(DeclareErrorOrWarning deow)

Create a Checker for a declare error or declare warning.

Parameters
deow:DeclareErrorOrWarning

the declare error or declare warning for which to create the checker munger

Checkerback to summary
private Checker(Pointcut pointcut, int start, int end, ISourceContext context, String message, boolean isError)

Only used when filling in a parameterized Checker

Method Detail

compareToback to summary
public int compareTo(Object other)

Implements org.aspectj.util.PartialOrder.PartialComparable.compareTo.

Returns:int

Doc from org.aspectj.util.PartialOrder.PartialComparable.compareTo.

  • +1 if this is greater than other
  • -1 if this is less than other
  • 0 if this is not comparable to other

Note

returning 0 from this method doesn't mean the same thing as returning 0 from java.util.Comparable.compareTo()

concretizeback to summary
public ShadowMunger concretize(ResolvedType theAspect, World world, PerClause clause)

Implements abstract org.aspectj.weaver.ShadowMunger.concretize.

Concretize this Checker by concretizing the pointcut

Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
formatback to summary
private String format(String msg, Shadow shadow)
getConcreteAspectback to summary
public ResolvedType getConcreteAspect()

Implements abstract org.aspectj.weaver.ShadowMunger.getConcreteAspect.

Annotations
@Override
getMessageback to summary
public String getMessage(Shadow shadow)
getThrownExceptionsback to summary
public Collection<ResolvedType> getThrownExceptions()

Implements abstract org.aspectj.weaver.ShadowMunger.getThrownExceptions.

Returns:Collection<ResolvedType>

Doc from org.aspectj.weaver.ShadowMunger.getThrownExceptions.

a Collection of ResolvedTypes for all checked exceptions that might be thrown by this munger

Annotations
@Override
getValueback to summary
private String getValue(String key, Shadow shadow)
Parameters
key:String

the buffer in which to insert the substitution

shadow:Shadow

shadow from which to draw context info

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
implementOnback to summary
public boolean implementOn(Shadow shadow)

Implements abstract org.aspectj.weaver.ShadowMunger.implementOn.

Doc from org.aspectj.weaver.ShadowMunger.implementOn.

Implement this munger at the specified shadow, returning a boolean to indicate success.

Parameters
shadow:Shadow

the shadow where this munger should be applied

Returns:boolean

true if the implement was successful

Annotations
@Override
isErrorback to summary
public boolean isError()
matchback to summary
public boolean match(Shadow shadow, World world)

Overrides org.aspectj.weaver.ShadowMunger.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.

Parameters
shadow:Shadow

the shadow which to match against

world:World

the world through which to access message handlers

Annotations
@Override
mustCheckExceptionsback to summary
public boolean mustCheckExceptions()

Implements abstract org.aspectj.weaver.ShadowMunger.mustCheckExceptions.

Doc from org.aspectj.weaver.ShadowMunger.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.

Returns:boolean

true if munger has to check that its exceptions can be thrown based on the shadow

Annotations
@Override
nextCurlyback to summary
private int nextCurly(String string, int pos)
parameterizeWithback to summary
public ShadowMunger parameterizeWith(ResolvedType declaringType, Map<String, UnresolvedType> typeVariableMap)

Implements abstract org.aspectj.weaver.ShadowMunger.parameterizeWith.

Parameterize the Checker by parameterizing the pointcut

Annotations
@Override
specializeOnback to summary
public void specializeOn(Shadow shadow)

Implements abstract org.aspectj.weaver.ShadowMunger.specializeOn.

Annotations
@Override