Interface GraphElements<M,F,S,P>

Type Parameters:
M - type representing methods
F - type representing fields
S - type representing signature
P - type representing source code location

public interface GraphElements<M,F,S,P>
Representation of methods, fields, their signatures and code locations.
  • Method Details

    • method

      M method(Object obj)
      Recognize method. Can the object be seen as a method?
      Parameters:
      obj - the object to check
      Returns:
      null if the object isn't a method, non-null value otherwise
    • methodCode

      byte[] methodCode(M method)
      Bytecode for a method.
      Parameters:
      method - the method
      Returns:
      bytecode of the method
    • methodModifiers

      int methodModifiers(M method)
      Method modifiers.
      Parameters:
      method - the method
      Returns:
      its modifiers
    • methodSignature

      S methodSignature(M method)
      Method's signature.
      Parameters:
      method - the method
      Returns:
      signature of the method
    • methodName

      String methodName(M method)
      Method name.
      Parameters:
      method - the method
      Returns:
      name of the method
    • methodDeclaringClass

      Object methodDeclaringClass(M method)
      Method's declaring class. The returned object shall be a Class or be recognizable by GraphTypes.typeName(java.lang.Object) method.
      Parameters:
      method - the method
      Returns:
      object representing class that defined the method
    • field

      F field(Object object)
      Recognizes a field. Can the object be seen as a field?
      Parameters:
      object - the object to check
      Returns:
      null if the object isn't a field, non-null value otherwise
    • fieldModifiers

      int fieldModifiers(F field)
      Field modifiers.
      Parameters:
      field - the field
      Returns:
      field modifiers
    • fieldTypeName

      String fieldTypeName(F field)
      Type name of the field.
      Parameters:
      field - the field
      Returns:
      the name of the field's type
    • fieldName

      String fieldName(F field)
      Name of a field.
      Parameters:
      field - the field
      Returns:
      the name of the field
    • fieldDeclaringClass

      Object fieldDeclaringClass(F field)
      Field's declaring class. The returned object shall be a Class or be recognizable by GraphTypes.typeName(java.lang.Object) method.
      Parameters:
      field - the field
      Returns:
      object representing class that defined the field
    • signature

      S signature(Object object)
      Recognizes signature. Can the object be seen as a signature?
      Parameters:
      object - the object to check
      Returns:
      null if the object isn't a signature, non-null value otherwise
    • signatureParameterCount

      int signatureParameterCount(S signature)
      Number of parameters of a signature.
      Parameters:
      signature - the signature
      Returns:
      number of parameters
    • signatureParameterTypeName

      String signatureParameterTypeName(S signature, int index)
      Type name of a signature parameter.
      Parameters:
      signature - the signature
      index - index from 0 to signatureParameterCount(java.lang.Object) - 1
      Returns:
      the type name
    • signatureReturnTypeName

      String signatureReturnTypeName(S signature)
      Type name of a return type.
      Parameters:
      signature - the signature
      Returns:
      the type name
    • nodeSourcePosition

      P nodeSourcePosition(Object object)
      Recognize a source position. Can the object be seen as a position?
      Parameters:
      object - the object to check
      Returns:
      null if the object isn't a position, non-null otherwise
    • nodeSourcePositionMethod

      M nodeSourcePositionMethod(P pos)
      Method for a position.
      Parameters:
      pos - the position
      Returns:
      the method at the position
    • nodeSourcePositionCaller

      P nodeSourcePositionCaller(P pos)
      Caller of a position.
      Parameters:
      pos - the position
      Returns:
      null or another position
    • nodeSourcePositionBCI

      int nodeSourcePositionBCI(P pos)
      Byte code index of a position.
      Parameters:
      pos - the position
      Returns:
      the BCI of the position
    • methodStackTraceElement

      StackTraceElement methodStackTraceElement(M method, int bci, P pos)
      Stack trace element for a method, index and position. This is the basic version of the method that works with StackTraceElement and is suitable for Java-like languages. Should you need to provide more details about the location of multiple strata, see GraphLocations interface that gives more control over the provided location data.
      Parameters:
      method - the method
      bci - the index
      pos - the position
      Returns:
      stack trace element for the method, index and position