Class CachedClassNode
java.lang.Object
net.covers1624.coffeegrinder.util.resolver.CachedClassNode
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 TypeMethodDescriptionorg.objectweb.asm.tree.FieldNodeTries to find a field in this class for the given name and descriptor.org.objectweb.asm.tree.MethodNodefindFullMethod(String name, String desc) Tries to find a full method node in this class for the given name and descriptor.org.objectweb.asm.tree.MethodNodefindMethod(String name, String desc) Tries to find a partial method node in this class for the given name and descriptor.intThe class's access flags as returned byClassReader.getAccess().Gets theType.getInternalName()for this class.Gets the list ofType.getInternalName()s for the declared interfaces.org.objectweb.asm.tree.ClassNodegetNode()Gets the fullClassNode.org.objectweb.asm.tree.ClassNodeGets a partialClassNodewithout any method instructions being parsed.@Nullable StringGets theType.getInternalName()for the declared superclass.
-
Method Details
-
getAccess
public int getAccess()The class's access flags as returned byClassReader.getAccess().- Returns:
- The access flags.
-
getClassName
Gets theType.getInternalName()for this class.- Returns:
- The name.
-
getSuperName
Gets theType.getInternalName()for the declared superclass.- Returns:
- The name.
-
getInterfaces
Gets the list ofType.getInternalName()s for the declared interfaces.- Returns:
- The interface names.
-
getPartialNode
public org.objectweb.asm.tree.ClassNode getPartialNode()Gets a partialClassNodewithout any method instructions being parsed. This is preferable when the Class is only needed as reference.This method will return the full expanded
ClassNodeif this class has hadgetNode()called. Callers should not be sensitive to this.The returned
ClassNodeis modifiable. Please do not modify it.- Returns:
- The partial
ClassNode.
-
getNode
public org.objectweb.asm.tree.ClassNode getNode()Gets the fullClassNode.Calling this method will cause the
getPartialNode()to be replaced with the full class node.The returned
ClassNodeis modifiable. Please do not modify it.- Returns:
- The full
ClassNode.
-
findField
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
FieldNodeif it exists. Literalnullotherwise.
-
findMethod
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 FullClassNodethis method will return a FullMethodNodewith expanded frames.- Parameters:
name- The name of the method.desc- The descriptor of the method.- Returns:
- The
MethodNodeif it exists. Literalnullotherwise.
-
findFullMethod
Tries to find a full method node in this class for the given name and descriptor. This method is guaranteed to return a FullMethodNodewith expanded frames.- Parameters:
name- The name of the method.desc- The descriptor of the method.- Returns:
- The
MethodNodeif it exists. Literalnullotherwise.
-