Class DecompiledClassNode

All Implemented Interfaces:
GroovydocHolder<AnnotatedNode>, NodeMetaDataHandler

public class DecompiledClassNode extends ClassNode
A ClassNode kind representing the classes coming from *.class files decompiled using ASM.
See Also:
  • Constructor Details

  • Method Details

    • getCompilationTimeStamp

      public long getCompilationTimeStamp()
    • getTypeClass

      public Class getTypeClass()
      Description copied from class: ClassNode
      Returns the concrete class this classnode relates to. However, this method is inherently unsafe as it may return null depending on the compile phase you are using. AST transformations should never use this method directly, but rather obtain a new class node using ClassNode.getPlainNodeReference().
      Overrides:
      getTypeClass in class ClassNode
      Returns:
      the class this classnode relates to. May return null.
    • resolveClassNullable

      public ClassNode resolveClassNullable(String className)
      Resolves a class in the same way as the types referenced from this class's bytecode: classes of the current compilation unit first, then the class path, where a class file is read rather than loaded.
      Parameters:
      className - the fully qualified class name
      Returns:
      the resolved class node, or null if the class cannot be found
    • visitInnerClassEntries

      public void visitInnerClassEntries(org.objectweb.asm.ClassVisitor cv)
      Writes the INNERCLASS entries (JVMS 4.7.6) recorded in this class's bytecode for itself and its enclosing classes, outermost first. Nothing is written for a top-level, local or anonymous class.
      Parameters:
      cv - the visitor of the class that refers to this class
    • isParameterized

      public boolean isParameterized()
    • isResolved

      public boolean isResolved()
      Overrides:
      isResolved in class ClassNode
    • isSealed

      public boolean isSealed()
      Overrides:
      isSealed in class ClassNode
      Returns:
      true for native and emulated (annotation based) sealed classes
    • setName

      public String setName(String name)
      Overrides:
      setName in class ClassNode
    • setRedirect

      public void setRedirect(ClassNode cn)
      Description copied from class: ClassNode
      Sets this instance as proxy for the given ClassNode.
      Overrides:
      setRedirect in class ClassNode
      Parameters:
      cn - the class to redirect to; if null the redirect is removed
    • setUsingGenerics

      public void setUsingGenerics(boolean b)
      Overrides:
      setUsingGenerics in class ClassNode
    • setGenericsPlaceHolder

      public void setGenericsPlaceHolder(boolean b)
      Overrides:
      setGenericsPlaceHolder in class ClassNode
    • getAnnotations

      public List<AnnotationNode> getAnnotations()
      Overrides:
      getAnnotations in class ClassNode
    • getAnnotations

      public List<AnnotationNode> getAnnotations(ClassNode type)
      Overrides:
      getAnnotations in class ClassNode
    • getGenericsTypes

      public GenericsType[] getGenericsTypes()
      Overrides:
      getGenericsTypes in class ClassNode
    • getInterfaces

      public ClassNode[] getInterfaces()
      Overrides:
      getInterfaces in class ClassNode
      Returns:
      the interfaces implemented by this ClassNode
    • getRecordComponents

      public List<RecordComponentNode> getRecordComponents()
      Description copied from class: ClassNode
      Gets the record components of record type.
      Overrides:
      getRecordComponents in class ClassNode
      Returns:
      RecordComponentNode instances
    • getUnresolvedInterfaces

      public ClassNode[] getUnresolvedInterfaces(boolean useRedirect)
      Overrides:
      getUnresolvedInterfaces in class ClassNode
    • getUnresolvedSuperClass

      public ClassNode getUnresolvedSuperClass(boolean useRedirect)
      Overrides:
      getUnresolvedSuperClass in class ClassNode
    • isUsingGenerics

      public boolean isUsingGenerics()
      Overrides:
      isUsingGenerics in class ClassNode
    • getDeclaredConstructors

      public List<ConstructorNode> getDeclaredConstructors()
      Overrides:
      getDeclaredConstructors in class ClassNode
    • getDeclaredField

      public FieldNode getDeclaredField(String name)
      Description copied from class: ClassNode
      Finds a field matching the given name in this class.
      Overrides:
      getDeclaredField in class ClassNode
      Parameters:
      name - the name of the field of interest
      Returns:
      the method matching the given name and parameters or null
    • getDeclaredMethods

      public List<MethodNode> getDeclaredMethods(String name)
      Description copied from class: ClassNode
      Returns a list of all methods with the given name from this class.
      Overrides:
      getDeclaredMethods in class ClassNode
      Returns:
      method list (possibly empty)
      See Also:
    • getFields

      public List<FieldNode> getFields()
      Overrides:
      getFields in class ClassNode
      Returns:
      the fields associated with this ClassNode
    • getMethods

      public List<MethodNode> getMethods()
      Overrides:
      getMethods in class ClassNode
      Returns:
      the methods associated with this ClassNode