Class ReferenceChain

java.lang.Object
org.openjdk.jmc.agent.util.expression.ReferenceChain

public final class ReferenceChain extends Object
A ReferenceChain instance presents a field reference expression. eg. OuterClass.this.field.STATIC_FIELD is a reference chain consisting elements: a qualified-this reference and two field reference (field and STATIC_FIELD).
  • Field Details

  • Constructor Details

    • ReferenceChain

      public ReferenceChain(Class<?> callerClass)
      Parameters:
      callerClass - the caller class making this reference
  • Method Details

    • getCallerClass

      public Class<?> getCallerClass()
      Returns:
      the caller class making this reference
    • getReferences

      public List<ReferenceChainElement> getReferences()
      Returns:
      all elements on the reference chain
    • normalize

      public ReferenceChain normalize()
      Reduces the reference chain to prepend "this" or qualified-this references if necessary, and short-circuits on static references
      Returns:
      the normalized reference chain
    • getType

      public org.objectweb.asm.Type getType()
      Returns:
      the type of the last reference element
    • append

      public void append(ReferenceChainElement ref)
      Appends a ReferenceChainElement to the chain
      Parameters:
      ref - ReferenceChainElement to be appended
    • isStatic

      public boolean isStatic()
      Returns:
      whether the reference is valid from a static context