Class ClassInfo
- java.lang.Object
-
- org.spongepowered.asm.mixin.transformer.ClassInfo
-
public final class ClassInfo extends java.lang.ObjectInformation about a class, used as a way of keeping track of class hierarchy information needed to support more complex mixin behaviour such as detached superclass and mixin inheritance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classClassInfo.FieldA fieldstatic classClassInfo.FrameDataInformation about frames in a methodclassClassInfo.InterfaceMethodA method resolved in an interface via a class, return the member wrapped so that the implementing class can be retrieved.classClassInfo.MethodA methodstatic classClassInfo.SearchTypeSearch type for the findInHierarchy methods, replaces a boolean flag which made calling code difficult to readstatic classClassInfo.TraversalTo all intents and purposes, the "real" class hierarchy and the mixin class hierarchy exist in parallel, this means that for some hierarchy validation operations we need to walk across to the other hierarchy in order to allow meaningful validation to occur.static classClassInfo.TypeLookupWhen usingClassInfo.forType, determines whether an array type should be returned as declared (eg.
-
Field Summary
Fields Modifier and Type Field Description static intINCLUDE_ALLInclude private and static members when running a member searchstatic intINCLUDE_INITIALISERSInclude instance and class initialisers when running a method searchstatic intINCLUDE_PRIVATEInclude private members when running a member searchstatic intINCLUDE_STATICInclude static members when running a member search
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)ClassInfo.FieldfindField(java.lang.String name, java.lang.String desc, int flags)Finds the specified field in this classClassInfo.FieldfindField(org.objectweb.asm.tree.FieldInsnNode field, int flags)Finds the specified public or protected method in this classClassInfo.FieldfindField(org.objectweb.asm.tree.FieldNode field)Finds the specified field in this classClassInfo.FieldfindFieldInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType)Finds the specified public or protected field in this class's hierarchyClassInfo.FieldfindFieldInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType, int flags)Finds the specified public or protected field in this class's hierarchyClassInfo.FieldfindFieldInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType, ClassInfo.Traversal traversal)Finds the specified public or protected field in this class's hierarchyClassInfo.FieldfindFieldInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType, ClassInfo.Traversal traversal, int flags)Finds the specified public or protected field in this class's hierarchyClassInfo.FieldfindFieldInHierarchy(org.objectweb.asm.tree.FieldInsnNode field, ClassInfo.SearchType searchType)Finds the specified public or protected field in this class's hierarchyClassInfo.FieldfindFieldInHierarchy(org.objectweb.asm.tree.FieldInsnNode field, ClassInfo.SearchType searchType, int flags)Finds the specified public or protected field in this class's hierarchyClassInfo.FieldfindFieldInHierarchy(org.objectweb.asm.tree.FieldNode field, ClassInfo.SearchType searchType)Finds the specified private or protected field in this class's hierarchyClassInfo.FieldfindFieldInHierarchy(org.objectweb.asm.tree.FieldNode field, ClassInfo.SearchType searchType, int flags)Finds the specified private or protected field in this class's hierarchyClassInfo.MethodfindMethod(java.lang.String name, java.lang.String desc, int flags)Finds the specified public or protected method in this classClassInfo.MethodfindMethod(org.objectweb.asm.tree.MethodInsnNode method)Finds the specified public or protected method in this classClassInfo.MethodfindMethod(org.objectweb.asm.tree.MethodInsnNode method, int flags)Finds the specified public or protected method in this classClassInfo.MethodfindMethod(org.objectweb.asm.tree.MethodNode method)Finds the specified public or protected method in this classClassInfo.MethodfindMethod(org.objectweb.asm.tree.MethodNode method, int flags)Finds the specified public or protected method in this classClassInfo.MethodfindMethodInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType, int flags)Finds the specified public or protected method in this class's hierarchyClassInfo.MethodfindMethodInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType, ClassInfo.Traversal traversal)Finds the specified public or protected method in this class's hierarchyClassInfo.MethodfindMethodInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType, ClassInfo.Traversal traversal, int flags)Finds the specified public or protected method in this class's hierarchyClassInfo.MethodfindMethodInHierarchy(org.objectweb.asm.tree.MethodInsnNode method, ClassInfo.SearchType searchType)Finds the specified public or protected method in this class's hierarchyClassInfo.MethodfindMethodInHierarchy(org.objectweb.asm.tree.MethodInsnNode method, ClassInfo.SearchType searchType, int flags)Finds the specified public or protected method in this class's hierarchyClassInfo.MethodfindMethodInHierarchy(org.objectweb.asm.tree.MethodNode method, ClassInfo.SearchType searchType)Finds the specified private or protected method in this class's hierarchyClassInfo.MethodfindMethodInHierarchy(org.objectweb.asm.tree.MethodNode method, ClassInfo.SearchType searchType, int flags)Finds the specified private or protected method in this class's hierarchyClassInfo.MethodfindMethodInHierarchy(org.objectweb.asm.tree.MethodNode method, ClassInfo.SearchType searchType, ClassInfo.Traversal traversal)Finds the specified private or protected method in this class's hierarchyClassInfo.MethodfindMethodInHierarchy(org.objectweb.asm.tree.MethodNode method, ClassInfo.SearchType searchType, ClassInfo.Traversal traversal, int flags)Finds the specified private or protected method in this class's hierarchyClassInfofindSuperClass(java.lang.String superClass)Search for the specified superclass in this class's hierarchy.ClassInfofindSuperClass(java.lang.String superClass, ClassInfo.Traversal traversal)Search for the specified superclass in this class's hierarchy.ClassInfofindSuperClass(java.lang.String superClass, ClassInfo.Traversal traversal, boolean includeInterfaces)Search for the specified superclass in this class's hierarchy.static ClassInfoforDescriptor(java.lang.String descriptor, ClassInfo.TypeLookup lookup)Return a ClassInfo for the specified type descriptor, fetches the ClassInfo from the cache where possible.static ClassInfoforName(java.lang.String className)Return a ClassInfo for the specified class name, fetches the ClassInfo from the cache where possible.static ClassInfoforType(org.objectweb.asm.Type type, ClassInfo.TypeLookup lookup)Return a ClassInfo for the specified class type, fetches the ClassInfo from the cache where possible and generates the class meta if not.static ClassInfofromCache(java.lang.String className)Return a ClassInfo for the specified class name, but only if the class information already exists in the cache.static ClassInfofromCache(org.objectweb.asm.Type type, ClassInfo.TypeLookup lookup)Return a ClassInfo for the specified class type, but only if the class information already exists in the cache.intgetAccess()java.util.Set<IMixinInfo>getAppliedMixins()Get all mixins which have been successfully applied to this classjava.lang.StringgetClassName()Get the class name (java format)static ClassInfogetCommonSuperClass(java.lang.String type1, java.lang.String type2)ASM logic applied via ClassInfo, returns first common superclass of classes specified by type1 and type2.static ClassInfogetCommonSuperClass(org.objectweb.asm.Type type1, org.objectweb.asm.Type type2)ASM logic applied via ClassInfo, returns first common superclass of classes specified by type1 and type2.static ClassInfogetCommonSuperClassOrInterface(java.lang.String type1, java.lang.String type2)ASM logic applied via ClassInfo, returns first common superclass of classes specified by type1 and type2.static ClassInfogetCommonSuperClassOrInterface(org.objectweb.asm.Type type1, org.objectweb.asm.Type type2)ASM logic applied via ClassInfo, returns first common superclass of classes specified by type1 and type2.static ClassInfogetCommonSuperClassOrInterface(ClassInfo type1, ClassInfo type2)ASM logic applied via ClassInfo, returns first common superclass or interface of classes specified by type1 and type2.java.util.Set<ClassInfo.Method>getInterfaceMethods(boolean includeMixins)If this is an interface, returns a set containing all methods in this interface and all super interfaces.java.util.Set<java.lang.String>getInterfaces()Returns the answer to life, the universe and everythingjava.util.Set<ClassInfo.Method>getMethods()Get class/interface methodsjava.lang.StringgetName()Get the class name (binary name)java.lang.StringgetNestHost()Return the nest host declared in the classjava.util.Set<java.lang.String>getNestMembers()Get nest members declared in the classClassInfogetOuterClass()Get the outer class info, can return null if the outer class cannot be resolved or if this is not an inner classjava.lang.StringgetOuterName()Get the name of the outer class, or null if this is not an inner classClassSignaturegetSignature()Return the class signaturejava.lang.StringgetSimpleName()Get the class name (simple name, java format)ClassInfogetSuperClass()Get the superclass info, can return null if the superclass cannot be resolvedjava.lang.StringgetSuperName()Get the superclass name (binary name)org.objectweb.asm.TypegetType()Get the object type (ASM type)inthashCode()booleanhasMixinInHierarchy()Find out whether this (mixin) class has another mixin in its superclass hierarchy.booleanhasMixinTargetInHierarchy()Find out whether this (non-mixin) class has a mixin targetting any of its superclasses.booleanhasSuperClass(java.lang.Class<?> superClass)Test whether this class has the specified superclass in its hierarchybooleanhasSuperClass(java.lang.Class<?> superClass, ClassInfo.Traversal traversal)Test whether this class has the specified superclass in its hierarchybooleanhasSuperClass(java.lang.Class<?> superClass, ClassInfo.Traversal traversal, boolean includeInterfaces)Test whether this class has the specified superclass in its hierarchybooleanhasSuperClass(java.lang.String superClass)Test whether this class has the specified superclass in its hierarchybooleanhasSuperClass(java.lang.String superClass, ClassInfo.Traversal traversal)Test whether this class has the specified superclass in its hierarchybooleanhasSuperClass(java.lang.String superClass, ClassInfo.Traversal traversal, boolean includeInterfaces)Test whether this class has the specified superclass in its hierarchybooleanhasSuperClass(ClassInfo superClass)Test whether this class has the specified superclass in its hierarchybooleanhasSuperClass(ClassInfo superClass, ClassInfo.Traversal traversal)Test whether this class has the specified superclass in its hierarchybooleanhasSuperClass(ClassInfo superClass, ClassInfo.Traversal traversal, boolean includeInterfaces)Test whether this class has the specified superclass in its hierarchybooleanisAbstract()Get whether this class has ACC_ABSTRACTbooleanisInner()Get whether this class is an inner classbooleanisInterface()Get whether this is an interface or notbooleanisLoadable()Get whether this class is loadable mixinbooleanisMixin()Get whether this class is a mixinstatic booleanisMixin(java.lang.String className)booleanisPrivate()Get whether this class has ACC_PRIVATE (only valid for inner classes)booleanisProbablyStatic()Get whether this class is probably static (or is not an inner class)booleanisProtected()Get whether this class has ACC_PROTECTED (only valid for inner classes)booleanisPublic()Get whether this class has ACC_PUBLICbooleanisReallyPublic()Get whether this class is really public (only valid for inner classes which may be "public" themselves but aren't actually visible because their enclosing type is package-private for example.booleanisSynthetic()Get whether this class has ACC_SYNTHETICClassInforesolveNestHost()Resolve the nest host for inner classes of this class.java.lang.StringtoString()
-
-
-
Field Detail
-
INCLUDE_PRIVATE
public static final int INCLUDE_PRIVATE
Include private members when running a member search- See Also:
- Constant Field Values
-
INCLUDE_STATIC
public static final int INCLUDE_STATIC
Include static members when running a member search- See Also:
- Constant Field Values
-
INCLUDE_ALL
public static final int INCLUDE_ALL
Include private and static members when running a member search- See Also:
- Constant Field Values
-
INCLUDE_INITIALISERS
public static final int INCLUDE_INITIALISERS
Include instance and class initialisers when running a method search- See Also:
- Constant Field Values
-
-
Method Detail
-
getAppliedMixins
public java.util.Set<IMixinInfo> getAppliedMixins()
Get all mixins which have been successfully applied to this class
-
isMixin
public boolean isMixin()
Get whether this class is a mixin
-
isLoadable
public boolean isLoadable()
Get whether this class is loadable mixin
-
isPublic
public boolean isPublic()
Get whether this class has ACC_PUBLIC
-
isReallyPublic
public boolean isReallyPublic()
Get whether this class is really public (only valid for inner classes which may be "public" themselves but aren't actually visible because their enclosing type is package-private for example.
-
isProtected
public boolean isProtected()
Get whether this class has ACC_PROTECTED (only valid for inner classes)
-
isPrivate
public boolean isPrivate()
Get whether this class has ACC_PRIVATE (only valid for inner classes)
-
isAbstract
public boolean isAbstract()
Get whether this class has ACC_ABSTRACT
-
isSynthetic
public boolean isSynthetic()
Get whether this class has ACC_SYNTHETIC
-
isProbablyStatic
public boolean isProbablyStatic()
Get whether this class is probably static (or is not an inner class)
-
isInner
public boolean isInner()
Get whether this class is an inner class
-
isInterface
public boolean isInterface()
Get whether this is an interface or not
-
getInterfaces
public java.util.Set<java.lang.String> getInterfaces()
Returns the answer to life, the universe and everything
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getAccess
public int getAccess()
-
getName
public java.lang.String getName()
Get the class name (binary name)
-
getClassName
public java.lang.String getClassName()
Get the class name (java format)
-
getSimpleName
public java.lang.String getSimpleName()
Get the class name (simple name, java format)
-
getType
public org.objectweb.asm.Type getType()
Get the object type (ASM type)
-
getSuperName
public java.lang.String getSuperName()
Get the superclass name (binary name)
-
getSuperClass
public ClassInfo getSuperClass()
Get the superclass info, can return null if the superclass cannot be resolved
-
getOuterName
public java.lang.String getOuterName()
Get the name of the outer class, or null if this is not an inner class
-
getOuterClass
public ClassInfo getOuterClass()
Get the outer class info, can return null if the outer class cannot be resolved or if this is not an inner class
-
getSignature
public ClassSignature getSignature()
Return the class signature- Returns:
- signature as a
ClassSignatureinstance
-
getNestHost
public java.lang.String getNestHost()
Return the nest host declared in the class
-
getNestMembers
public java.util.Set<java.lang.String> getNestMembers()
Get nest members declared in the class
-
resolveNestHost
public ClassInfo resolveNestHost()
Resolve the nest host for inner classes of this class. If the class itself has a nest host, the host is returned so that members can be added to it. If the class itself is a nest host (already has nest members) or is neither a nest host or member (eg. per the specification is already a nest host with itself as the sole member) then this method simply returns this ClassInfo.
-
getMethods
public java.util.Set<ClassInfo.Method> getMethods()
Get class/interface methods- Returns:
- read-only view of class methods
-
getInterfaceMethods
public java.util.Set<ClassInfo.Method> getInterfaceMethods(boolean includeMixins)
If this is an interface, returns a set containing all methods in this interface and all super interfaces. If this is a class, returns a set containing all methods for all interfaces implemented by this class and all super interfaces of those interfaces.- Parameters:
includeMixins- Whether to include methods from mixins targeting this class info- Returns:
- read-only view of class methods
-
hasSuperClass
public boolean hasSuperClass(java.lang.Class<?> superClass)
Test whether this class has the specified superclass in its hierarchy- Parameters:
superClass- Superclass to search for in the hierarchy- Returns:
- true if the specified class appears in the class's hierarchy anywhere
-
hasSuperClass
public boolean hasSuperClass(java.lang.Class<?> superClass, ClassInfo.Traversal traversal)Test whether this class has the specified superclass in its hierarchy- Parameters:
superClass- Superclass to search for in the hierarchytraversal- Traversal type to allow during this lookup- Returns:
- true if the specified class appears in the class's hierarchy anywhere
-
hasSuperClass
public boolean hasSuperClass(java.lang.Class<?> superClass, ClassInfo.Traversal traversal, boolean includeInterfaces)Test whether this class has the specified superclass in its hierarchy- Parameters:
superClass- Superclass to search for in the hierarchytraversal- Traversal type to allow during this lookupincludeInterfaces- True to include interfaces in the lookup- Returns:
- true if the specified class appears in the class's hierarchy anywhere
-
hasSuperClass
public boolean hasSuperClass(java.lang.String superClass)
Test whether this class has the specified superclass in its hierarchy- Parameters:
superClass- Name of the superclass to search for in the hierarchy- Returns:
- true if the specified class appears in the class's hierarchy anywhere
-
hasSuperClass
public boolean hasSuperClass(java.lang.String superClass, ClassInfo.Traversal traversal)Test whether this class has the specified superclass in its hierarchy- Parameters:
superClass- Name of the superclass to search for in the hierarchytraversal- Traversal type to allow during this lookup- Returns:
- true if the specified class appears in the class's hierarchy anywhere
-
hasSuperClass
public boolean hasSuperClass(java.lang.String superClass, ClassInfo.Traversal traversal, boolean includeInterfaces)Test whether this class has the specified superclass in its hierarchy- Parameters:
superClass- Name of the superclass to search for in the hierarchytraversal- Traversal type to allow during this lookupincludeInterfaces- True to include interfaces in the lookup- Returns:
- true if the specified class appears in the class's hierarchy anywhere
-
hasSuperClass
public boolean hasSuperClass(ClassInfo superClass)
Test whether this class has the specified superclass in its hierarchy- Parameters:
superClass- Superclass to search for in the hierarchy- Returns:
- true if the specified class appears in the class's hierarchy anywhere
-
hasSuperClass
public boolean hasSuperClass(ClassInfo superClass, ClassInfo.Traversal traversal)
Test whether this class has the specified superclass in its hierarchy- Parameters:
superClass- Superclass to search for in the hierarchytraversal- Traversal type to allow during this lookup- Returns:
- true if the specified class appears in the class's hierarchy anywhere
-
hasSuperClass
public boolean hasSuperClass(ClassInfo superClass, ClassInfo.Traversal traversal, boolean includeInterfaces)
Test whether this class has the specified superclass in its hierarchy- Parameters:
superClass- Superclass to search for in the hierarchytraversal- Traversal type to allow during this lookupincludeInterfaces- True to include interfaces in the lookup- Returns:
- true if the specified class appears in the class's hierarchy anywhere
-
findSuperClass
public ClassInfo findSuperClass(java.lang.String superClass)
Search for the specified superclass in this class's hierarchy. If found returns the ClassInfo, otherwise returns null- Parameters:
superClass- Superclass name to search for- Returns:
- Matched superclass or null if not found
-
findSuperClass
public ClassInfo findSuperClass(java.lang.String superClass, ClassInfo.Traversal traversal)
Search for the specified superclass in this class's hierarchy. If found returns the ClassInfo, otherwise returns null- Parameters:
superClass- Superclass name to search fortraversal- Traversal type to allow during this lookup- Returns:
- Matched superclass or null if not found
-
findSuperClass
public ClassInfo findSuperClass(java.lang.String superClass, ClassInfo.Traversal traversal, boolean includeInterfaces)
Search for the specified superclass in this class's hierarchy. If found returns the ClassInfo, otherwise returns null- Parameters:
superClass- Superclass name to search fortraversal- Traversal type to allow during this lookupincludeInterfaces- True to include interfaces in the lookup- Returns:
- Matched superclass or null if not found
-
hasMixinInHierarchy
public boolean hasMixinInHierarchy()
Find out whether this (mixin) class has another mixin in its superclass hierarchy. This method always returns false for non-mixin classes.- Returns:
- true if and only if one or more mixins are found in the hierarchy of this mixin
-
hasMixinTargetInHierarchy
public boolean hasMixinTargetInHierarchy()
Find out whether this (non-mixin) class has a mixin targetting any of its superclasses. This method always returns false for mixin classes.- Returns:
- true if and only if one or more classes in this class's hierarchy are targetted by a mixin
-
findMethodInHierarchy
public ClassInfo.Method findMethodInHierarchy(org.objectweb.asm.tree.MethodNode method, ClassInfo.SearchType searchType)
Finds the specified private or protected method in this class's hierarchy- Parameters:
method- Method to search forsearchType- Search strategy to use- Returns:
- the method object or null if the method could not be resolved
-
findMethodInHierarchy
public ClassInfo.Method findMethodInHierarchy(org.objectweb.asm.tree.MethodNode method, ClassInfo.SearchType searchType, ClassInfo.Traversal traversal)
Finds the specified private or protected method in this class's hierarchy- Parameters:
method- Method to search forsearchType- Search strategy to usetraversal- Traversal type to allow during this lookup- Returns:
- the method object or null if the method could not be resolved
-
findMethodInHierarchy
public ClassInfo.Method findMethodInHierarchy(org.objectweb.asm.tree.MethodNode method, ClassInfo.SearchType searchType, int flags)
Finds the specified private or protected method in this class's hierarchy- Parameters:
method- Method to search forsearchType- Search strategy to useflags- search flags- Returns:
- the method object or null if the method could not be resolved
-
findMethodInHierarchy
public ClassInfo.Method findMethodInHierarchy(org.objectweb.asm.tree.MethodNode method, ClassInfo.SearchType searchType, ClassInfo.Traversal traversal, int flags)
Finds the specified private or protected method in this class's hierarchy- Parameters:
method- Method to search forsearchType- Search strategy to usetraversal- Traversal type to allow during this lookupflags- search flags- Returns:
- the method object or null if the method could not be resolved
-
findMethodInHierarchy
public ClassInfo.Method findMethodInHierarchy(org.objectweb.asm.tree.MethodInsnNode method, ClassInfo.SearchType searchType)
Finds the specified public or protected method in this class's hierarchy- Parameters:
method- Method to search forsearchType- Search strategy to use- Returns:
- the method object or null if the method could not be resolved
-
findMethodInHierarchy
public ClassInfo.Method findMethodInHierarchy(org.objectweb.asm.tree.MethodInsnNode method, ClassInfo.SearchType searchType, int flags)
Finds the specified public or protected method in this class's hierarchy- Parameters:
method- Method to search forsearchType- Search strategy to useflags- search flags- Returns:
- the method object or null if the method could not be resolved
-
findMethodInHierarchy
public ClassInfo.Method findMethodInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType, int flags)
Finds the specified public or protected method in this class's hierarchy- Parameters:
name- Method name to search fordesc- Method descriptorsearchType- Search strategy to useflags- search flags- Returns:
- the method object or null if the method could not be resolved
-
findMethodInHierarchy
public ClassInfo.Method findMethodInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType, ClassInfo.Traversal traversal)
Finds the specified public or protected method in this class's hierarchy- Parameters:
name- Method name to search fordesc- Method descriptorsearchType- Search strategy to usetraversal- Traversal type to allow during this lookup- Returns:
- the method object or null if the method could not be resolved
-
findMethodInHierarchy
public ClassInfo.Method findMethodInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType, ClassInfo.Traversal traversal, int flags)
Finds the specified public or protected method in this class's hierarchy- Parameters:
name- Method name to search fordesc- Method descriptorsearchType- Search strategy to usetraversal- Traversal type to allow during this lookupflags- search flags- Returns:
- the method object or null if the method could not be resolved
-
findFieldInHierarchy
public ClassInfo.Field findFieldInHierarchy(org.objectweb.asm.tree.FieldNode field, ClassInfo.SearchType searchType)
Finds the specified private or protected field in this class's hierarchy- Parameters:
field- Field to search forsearchType- Search strategy to use- Returns:
- the field object or null if the field could not be resolved
-
findFieldInHierarchy
public ClassInfo.Field findFieldInHierarchy(org.objectweb.asm.tree.FieldNode field, ClassInfo.SearchType searchType, int flags)
Finds the specified private or protected field in this class's hierarchy- Parameters:
field- Field to search forsearchType- Search strategy to useflags- search flags- Returns:
- the field object or null if the field could not be resolved
-
findFieldInHierarchy
public ClassInfo.Field findFieldInHierarchy(org.objectweb.asm.tree.FieldInsnNode field, ClassInfo.SearchType searchType)
Finds the specified public or protected field in this class's hierarchy- Parameters:
field- Field to search forsearchType- Search strategy to use- Returns:
- the field object or null if the field could not be resolved
-
findFieldInHierarchy
public ClassInfo.Field findFieldInHierarchy(org.objectweb.asm.tree.FieldInsnNode field, ClassInfo.SearchType searchType, int flags)
Finds the specified public or protected field in this class's hierarchy- Parameters:
field- Field to search forsearchType- Search strategy to useflags- search flags- Returns:
- the field object or null if the field could not be resolved
-
findFieldInHierarchy
public ClassInfo.Field findFieldInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType)
Finds the specified public or protected field in this class's hierarchy- Parameters:
name- Field name to search fordesc- Field descriptorsearchType- Search strategy to use- Returns:
- the field object or null if the field could not be resolved
-
findFieldInHierarchy
public ClassInfo.Field findFieldInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType, int flags)
Finds the specified public or protected field in this class's hierarchy- Parameters:
name- Field name to search fordesc- Field descriptorsearchType- Search strategy to useflags- search flags- Returns:
- the field object or null if the field could not be resolved
-
findFieldInHierarchy
public ClassInfo.Field findFieldInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType, ClassInfo.Traversal traversal)
Finds the specified public or protected field in this class's hierarchy- Parameters:
name- Field name to search fordesc- Field descriptorsearchType- Search strategy to usetraversal- Traversal type to allow during this lookup- Returns:
- the field object or null if the field could not be resolved
-
findFieldInHierarchy
public ClassInfo.Field findFieldInHierarchy(java.lang.String name, java.lang.String desc, ClassInfo.SearchType searchType, ClassInfo.Traversal traversal, int flags)
Finds the specified public or protected field in this class's hierarchy- Parameters:
name- Field name to search fordesc- Field descriptorsearchType- Search strategy to usetraversal- Traversal type to allow during this lookupflags- search flags- Returns:
- the field object or null if the field could not be resolved
-
findMethod
public ClassInfo.Method findMethod(org.objectweb.asm.tree.MethodNode method)
Finds the specified public or protected method in this class- Parameters:
method- Method to search for- Returns:
- the method object or null if the method could not be resolved
-
findMethod
public ClassInfo.Method findMethod(org.objectweb.asm.tree.MethodNode method, int flags)
Finds the specified public or protected method in this class- Parameters:
method- Method to search forflags- search flags- Returns:
- the method object or null if the method could not be resolved
-
findMethod
public ClassInfo.Method findMethod(org.objectweb.asm.tree.MethodInsnNode method)
Finds the specified public or protected method in this class- Parameters:
method- Method to search for- Returns:
- the method object or null if the method could not be resolved
-
findMethod
public ClassInfo.Method findMethod(org.objectweb.asm.tree.MethodInsnNode method, int flags)
Finds the specified public or protected method in this class- Parameters:
method- Method to search forflags- search flags- Returns:
- the method object or null if the method could not be resolved
-
findMethod
public ClassInfo.Method findMethod(java.lang.String name, java.lang.String desc, int flags)
Finds the specified public or protected method in this class- Parameters:
name- Method name to search fordesc- Method signature to search forflags- search flags- Returns:
- the method object or null if the method could not be resolved
-
findField
public ClassInfo.Field findField(org.objectweb.asm.tree.FieldNode field)
Finds the specified field in this class- Parameters:
field- Field to search for- Returns:
- the field object or null if the field could not be resolved
-
findField
public ClassInfo.Field findField(org.objectweb.asm.tree.FieldInsnNode field, int flags)
Finds the specified public or protected method in this class- Parameters:
field- Field to search forflags- search flags- Returns:
- the field object or null if the field could not be resolved
-
findField
public ClassInfo.Field findField(java.lang.String name, java.lang.String desc, int flags)
Finds the specified field in this class- Parameters:
name- Field name to search fordesc- Field signature to search forflags- search flags- Returns:
- the field object or null if the field could not be resolved
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
forName
public static ClassInfo forName(java.lang.String className)
Return a ClassInfo for the specified class name, fetches the ClassInfo from the cache where possible.- Parameters:
className- Binary name of the class to look up- Returns:
- ClassInfo for the specified class name or null if the specified name cannot be resolved for some reason
-
forDescriptor
public static ClassInfo forDescriptor(java.lang.String descriptor, ClassInfo.TypeLookup lookup)
Return a ClassInfo for the specified type descriptor, fetches the ClassInfo from the cache where possible.- Parameters:
descriptor- Internal descriptor of the type to inspectlookup- Lookup type to use (literal/element)- Returns:
- ClassInfo for the specified class name or null if the specified name cannot be resolved for some reason
-
forType
public static ClassInfo forType(org.objectweb.asm.Type type, ClassInfo.TypeLookup lookup)
Return a ClassInfo for the specified class type, fetches the ClassInfo from the cache where possible and generates the class meta if not.- Parameters:
type- Type to look uplookup- Lookup type to use (literal/element)- Returns:
- ClassInfo for the supplied type or null if the supplied type cannot be found or is a primitive type
-
fromCache
public static ClassInfo fromCache(java.lang.String className)
Return a ClassInfo for the specified class name, but only if the class information already exists in the cache. This prevents class loads in the instance that a ClassInfo is only being retrieved for a class which should definitely have already been processed but will be missing in case of an error condition.- Parameters:
className- Binary name of the class to look up- Returns:
- ClassInfo for the specified class name or null if the specified class does not have an entry in the cache
-
fromCache
public static ClassInfo fromCache(org.objectweb.asm.Type type, ClassInfo.TypeLookup lookup)
Return a ClassInfo for the specified class type, but only if the class information already exists in the cache. This prevents class loads in the instance that a ClassInfo is only being retrieved for a class which should definitely have already been processed but will be missing in case of an error condition.- Parameters:
type- Type to look uplookup- Lookup type to use (literal/element)- Returns:
- ClassInfo for the supplied type or null if the supplied type does not have an entry in the cache
-
getCommonSuperClass
public static ClassInfo getCommonSuperClass(java.lang.String type1, java.lang.String type2)
ASM logic applied via ClassInfo, returns first common superclass of classes specified by type1 and type2.- Parameters:
type1- First typetype2- Second type- Returns:
- common superclass info
-
getCommonSuperClass
public static ClassInfo getCommonSuperClass(org.objectweb.asm.Type type1, org.objectweb.asm.Type type2)
ASM logic applied via ClassInfo, returns first common superclass of classes specified by type1 and type2.- Parameters:
type1- First typetype2- Second type- Returns:
- common superclass info
-
getCommonSuperClassOrInterface
public static ClassInfo getCommonSuperClassOrInterface(java.lang.String type1, java.lang.String type2)
ASM logic applied via ClassInfo, returns first common superclass of classes specified by type1 and type2.- Parameters:
type1- First typetype2- Second type- Returns:
- common superclass info
-
getCommonSuperClassOrInterface
public static ClassInfo getCommonSuperClassOrInterface(org.objectweb.asm.Type type1, org.objectweb.asm.Type type2)
ASM logic applied via ClassInfo, returns first common superclass of classes specified by type1 and type2.- Parameters:
type1- First typetype2- Second type- Returns:
- common superclass info
-
getCommonSuperClassOrInterface
public static ClassInfo getCommonSuperClassOrInterface(ClassInfo type1, ClassInfo type2)
ASM logic applied via ClassInfo, returns first common superclass or interface of classes specified by type1 and type2.- Parameters:
type1- First typetype2- Second type- Returns:
- common superclass info
-
isMixin
public static boolean isMixin(java.lang.String className)
-
-