Class CachedClassNode

java.lang.Object
net.covers1624.coffeegrinder.util.resolver.CachedClassNode

public class CachedClassNode extends Object
Represents a ClassNode that may only be a ClassReader, a ClassNode without any instructions parsed, or a full ClassNode with frames expanded.

Created by covers1624 on 8/4/21.

  • Method Summary

    Modifier and Type
    Method
    Description
    org.objectweb.asm.tree.FieldNode
    findField(String name, String desc)
    Tries to find a field in this class for the given name and descriptor.
    org.objectweb.asm.tree.MethodNode
    Tries to find a full method node in this class for the given name and descriptor.
    org.objectweb.asm.tree.MethodNode
    findMethod(String name, String desc)
    Tries to find a partial method node in this class for the given name and descriptor.
    int
    The class's access flags as returned by ClassReader.getAccess().
    Gets the Type.getInternalName() for this class.
    Gets the list of Type.getInternalName()s for the declared interfaces.
    org.objectweb.asm.tree.ClassNode
    Gets the full ClassNode.
    org.objectweb.asm.tree.ClassNode
    Gets a partial ClassNode without any method instructions being parsed.
    @Nullable String
    Gets the Type.getInternalName() for the declared superclass.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getAccess

      public int getAccess()
      The class's access flags as returned by ClassReader.getAccess().
      Returns:
      The access flags.
    • getClassName

      public String getClassName()
      Gets the Type.getInternalName() for this class.
      Returns:
      The name.
    • getSuperName

      @Nullable public @Nullable String getSuperName()
      Gets the Type.getInternalName() for the declared superclass.
      Returns:
      The name.
    • getInterfaces

      public List<String> getInterfaces()
      Gets the list of Type.getInternalName()s for the declared interfaces.
      Returns:
      The interface names.
    • getPartialNode

      public org.objectweb.asm.tree.ClassNode getPartialNode()
      Gets a partial ClassNode without any method instructions being parsed. This is preferable when the Class is only needed as reference.

      This method will return the full expanded ClassNode if this class has had getNode() called. Callers should not be sensitive to this.

      The returned ClassNode is modifiable. Please do not modify it.

      Returns:
      The partial ClassNode.
    • getNode

      public org.objectweb.asm.tree.ClassNode getNode()
      Gets the full ClassNode.

      Calling this method will cause the getPartialNode() to be replaced with the full class node.

      The returned ClassNode is modifiable. Please do not modify it.

      Returns:
      The full ClassNode.
    • findField

      public org.objectweb.asm.tree.FieldNode findField(String name, String desc)
      Tries to find a field in this class for the given name and descriptor.
      Parameters:
      name - The name of the field.
      desc - The descriptor of the field.
      Returns:
      The FieldNode if it exists. Literal null otherwise.
    • findMethod

      public org.objectweb.asm.tree.MethodNode findMethod(String name, String desc)
      Tries to find a partial method node in this class for the given name and descriptor. In the case of this ClassNode being resolved into a Full ClassNode this method will return a Full MethodNode with expanded frames.
      Parameters:
      name - The name of the method.
      desc - The descriptor of the method.
      Returns:
      The MethodNode if it exists. Literal null otherwise.
    • findFullMethod

      public org.objectweb.asm.tree.MethodNode findFullMethod(String name, String desc)
      Tries to find a full method node in this class for the given name and descriptor. This method is guaranteed to return a Full MethodNode with expanded frames.
      Parameters:
      name - The name of the method.
      desc - The descriptor of the method.
      Returns:
      The MethodNode if it exists. Literal null otherwise.