Class Advice

All Implemented Interfaces:
PartialOrder.PartialComparable, IHasPosition

public abstract class Advice extends ShadowMunger
  • Field Details

  • Constructor Details

  • Method Details

    • makeCflowEntry

      public static Advice makeCflowEntry(World world, Pointcut entry, boolean isBelow, Member stackField, int nFreeVars, List<ShadowMunger> innerCflowEntries, ResolvedType inAspect)
    • makePerCflowEntry

      public static Advice makePerCflowEntry(World world, Pointcut entry, boolean isBelow, Member stackField, ResolvedType inAspect, List<ShadowMunger> innerCflowEntries)
    • makePerObjectEntry

      public static Advice makePerObjectEntry(World world, Pointcut entry, boolean isThis, ResolvedType inAspect)
    • makePerTypeWithinEntry

      public static Advice makePerTypeWithinEntry(World world, Pointcut p, ResolvedType inAspect)
    • isAroundAdvice

      public boolean isAroundAdvice()
      Overrides:
      isAroundAdvice in class ShadowMunger
    • makeSoftener

      public static Advice makeSoftener(World world, Pointcut entry, TypePattern exceptionType, ResolvedType inAspect, IHasSourceLocation loc)
    • match

      public boolean match(Shadow shadow, World world)
      Description copied from class: ShadowMunger
      All overriding methods should call super
      Overrides:
      match in class ShadowMunger
    • getKind

      public AdviceKind getKind()
    • getSignature

      public Member getSignature()
    • hasExtraParameter

      public boolean hasExtraParameter()
    • getExtraParameterFlags

      protected int getExtraParameterFlags()
    • getExtraParameterCount

      protected int getExtraParameterCount()
    • getBindingParameterTypes

      public UnresolvedType[] getBindingParameterTypes()
    • setBindingParameterTypes

      public void setBindingParameterTypes(UnresolvedType[] types)
    • countOnes

      public static int countOnes(int bits)
    • getBaseParameterCount

      public int getBaseParameterCount()
    • getBaseParameterNames

      public String[] getBaseParameterNames(World world)
    • getExtraParameterType

      public UnresolvedType getExtraParameterType()
      Return the type of the 'extra argument'. For either after returning or after throwing advice, the extra argument will be the returned value or the thrown exception respectively. With annotation style the user may declare the parameters in any order, whereas for code style they are in a well defined order. So there is some extra complexity in here for annotation style that looks up the correct parameter in the advice signature by name, based on the name specified in the annotation. If this fails then we 'fallback' to guessing at positions, where the extra argument is presumed to come at the end.
      Returns:
      the type of the extraParameter
    • getDeclaringAspect

      public UnresolvedType getDeclaringAspect()
    • getOriginalSignature

      protected Member getOriginalSignature()
    • extraParametersToString

      protected String extraParametersToString()
    • getPointcut

      public Pointcut getPointcut()
      Overrides:
      getPointcut in class ShadowMunger
    • concretize

      public ShadowMunger concretize(ResolvedType fromType, World world, PerClause clause)
      Specified by:
      concretize in class ShadowMunger
      Parameters:
      fromType - is guaranteed to be a non-abstract aspect
      clause - has been concretized at a higher level
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

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

      public void setLexicalPosition(int lexicalPosition)
    • isAnnotationStyle

      public boolean isAnnotationStyle()
    • getConcreteAspect

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

      public boolean hasMatchedSomething()
    • setHasMatchedSomething

      public void setHasMatchedSomething(boolean hasMatchedSomething)
    • hasDynamicTests

      public abstract boolean hasDynamicTests()