Package ftbsc.lll.proxies.impl
Class TypeProxy
- java.lang.Object
-
- ftbsc.lll.proxies.AbstractProxy
-
- ftbsc.lll.proxies.QualifiableProxy
-
- ftbsc.lll.proxies.impl.TypeProxy
-
public class TypeProxy extends QualifiableProxy
A container for information about classes to be used in ASM patching.- Since:
- 0.4.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ftbsc.lll.proxies.AbstractProxy
AbstractProxy.Builder<T extends AbstractProxy>
-
-
Field Summary
Fields Modifier and Type Field Description boolean
primitive
Whether this proxy represents a primitive.-
Fields inherited from class ftbsc.lll.proxies.QualifiableProxy
fullyQualifiedName, internalName
-
Fields inherited from class ftbsc.lll.proxies.AbstractProxy
descriptor, modifiers, name, parent, proxyType
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TypeProxy(java.lang.String name, java.lang.String descriptor, int modifiers, TypeProxy containerClass, boolean primitive)
Protected constructor, called only from the builders.protected
TypeProxy(java.lang.String name, java.lang.String descriptor, int modifiers, java.lang.String parent, boolean primitive)
Protected constructor, called only from the builders.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Indicates whether the given object is a proxy for the same element as this.static TypeProxy
from(java.lang.Class<?> clazz)
Builds aTypeProxy
from aClass
object.static TypeProxy
from(java.lang.String fqn, int arrayLevel, int modifiers)
Builds aTypeProxy
given only the fully-qualified name and modifiers.static TypeProxy
from(org.objectweb.asm.Type type, int modifiers)
Builds aTypeProxy
from aType
and modifiers.-
Methods inherited from class ftbsc.lll.proxies.QualifiableProxy
extractParentFromFQN, extractSimpleNameFromFQN
-
-
-
-
Constructor Detail
-
TypeProxy
protected TypeProxy(java.lang.String name, java.lang.String descriptor, int modifiers, java.lang.String parent, boolean primitive)
Protected constructor, called only from the builders.- Parameters:
name
- the name of the classdescriptor
- the descriptor of the classmodifiers
- the modifiers of the classparent
- the package containing this classprimitive
- whether the proxy is a primitive
-
TypeProxy
protected TypeProxy(java.lang.String name, java.lang.String descriptor, int modifiers, TypeProxy containerClass, boolean primitive)
Protected constructor, called only from the builders.- Parameters:
name
- the name of the classdescriptor
- the descriptor of the elementmodifiers
- the modifiers of the classprimitive
- whether the proxy is a primitivecontainerClass
- the FQN of the parent class of the class
-
-
Method Detail
-
from
public static TypeProxy from(org.objectweb.asm.Type type, int modifiers)
Builds aTypeProxy
from aType
and modifiers.- Parameters:
type
- theType
representing this Classmodifiers
- the modifiers of the class- Returns:
- the built
TypeProxy
-
from
public static TypeProxy from(java.lang.String fqn, int arrayLevel, int modifiers)
Builds aTypeProxy
given only the fully-qualified name and modifiers. If present, parent classes will be assumed to havepublic
as their only modifier.- Parameters:
fqn
- the fully qualified name of the desired classarrayLevel
- the array level for this typemodifiers
- the access modifiers of the desired class- Returns:
- the built
TypeProxy
-
from
public static TypeProxy from(java.lang.Class<?> clazz)
Builds aTypeProxy
from aClass
object.- Parameters:
clazz
- theClass
object representing the target class- Returns:
- the built
TypeProxy
-
equals
public boolean equals(java.lang.Object obj)
Indicates whether the given object is a proxy for the same element as this.- Overrides:
equals
in classQualifiableProxy
- Parameters:
obj
- the object to perform- Returns:
- true if it's equal
-
-