Class TypeProxy


  • public class TypeProxy
    extends QualifiableProxy
    A container for information about classes to be used in ASM patching.
    Since:
    0.4.0
    • Field Detail

      • primitive

        public final boolean primitive
        Whether this proxy represents a primitive.
    • 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 class
        descriptor - the descriptor of the class
        modifiers - the modifiers of the class
        parent - the package containing this class
        primitive - 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 class
        descriptor - the descriptor of the element
        modifiers - the modifiers of the class
        primitive - whether the proxy is a primitive
        containerClass - the FQN of the parent class of the class
    • Method Detail

      • from

        public static TypeProxy from​(org.objectweb.asm.Type type,
                                     int modifiers)
        Builds a TypeProxy from a Type and modifiers.
        Parameters:
        type - the Type representing this Class
        modifiers - the modifiers of the class
        Returns:
        the built TypeProxy
      • from

        public static TypeProxy from​(java.lang.String fqn,
                                     int arrayLevel,
                                     int modifiers)
        Builds a TypeProxy given only the fully-qualified name and modifiers. If present, parent classes will be assumed to have public as their only modifier.
        Parameters:
        fqn - the fully qualified name of the desired class
        arrayLevel - the array level for this type
        modifiers - the access modifiers of the desired class
        Returns:
        the built TypeProxy
      • from

        public static TypeProxy from​(java.lang.Class<?> clazz)
        Builds a TypeProxy from a Class object.
        Parameters:
        clazz - the Class 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 class QualifiableProxy
        Parameters:
        obj - the object to perform
        Returns:
        true if it's equal