Interface JoinPoint.StaticPart

All Known Subinterfaces:
JoinPoint.EnclosingStaticPart
Enclosing interface:
JoinPoint

public static interface JoinPoint.StaticPart

This helper object contains only the static information about a join point. It is available from the JoinPoint.getStaticPart() method, and can be accessed separately within advice using the special form thisJoinPointStaticPart.

If you are only interested in the static information about a join point, you should access it through this type for the best performance. This is particularly useful for library methods that want to do serious manipulations of this information, i.e.

 public class LoggingUtils {
     public static void prettyPrint(JoinPoint.StaticPart jp) {
         ...
     }
 }

 aspect Logging {
     before(): ... { LoggingUtils.prettyPrint(thisJoinPointStaticPart); }
 }
 
See Also:
  • Method Details

    • getSignature

      Signature getSignature()
      Returns:
      the signature at the join point.
    • getSourceLocation

      SourceLocation getSourceLocation()
      Returns the source location corresponding to the join point. If there is no source location available, returns null.
      Returns:
      the SourceLocation of the defining class for default constructors
    • getKind

      String getKind()
      Returns:
      a string representing the kind of join point. This String is guaranteed to be interned
    • getId

      int getId()
      Return the id for this JoinPoint.StaticPart. All JoinPoint.StaticPart instances are assigned an id number upon creation. For each advised type the id numbers start at 0.
      The id is guaranteed to remain constant across repeated executions of a program but may change if the code is recompiled.
      The benefit of having an id is that it can be used for array index purposes which can be quicker than using the JoinPoint.StaticPart object itself in a map lookup.
      Since two JoinPoint.StaticPart instances in different advised types may have the same id, then if the id is being used to index some joinpoint specific state then that state must be maintained on a pertype basis - either by using pertypewithin() or an ITD.
      Returns:
      the id of this joinpoint
    • toString

      String toString()
      Overrides:
      toString in class Object
    • toShortString

      String toShortString()
      Returns:
      an abbreviated string representation of the join point
    • toLongString

      String toLongString()
      Returns:
      an extended string representation of the join point