Class ReferenceChain


  • public final class ReferenceChain
    extends java.lang.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 Detail

      • callerClass

        private final java.lang.Class<?> callerClass
    • Constructor Detail

      • ReferenceChain

        public ReferenceChain​(java.lang.Class<?> callerClass)
        Parameters:
        callerClass - the caller class making this reference
    • Method Detail

      • getCallerClass

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

        public java.util.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