Class Checker

All Implemented Interfaces:
PartialOrder.PartialComparable, IHasPosition

public class Checker extends ShadowMunger
Representation of a shadow munger for a declare error or warning declaration.
Author:
Andy Clement
  • Constructor Details

    • 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 Details

    • isError

      public boolean isError()
    • getMessage

      public 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(Object other)
      Returns:
      • +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()
    • 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 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(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • parameterizeWith

      public ShadowMunger parameterizeWith(ResolvedType declaringType, Map<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