Class MethodDescriptor

    • Constructor Detail

      • MethodDescriptor

        protected MethodDescriptor​(java.lang.String name,
                                   int access,
                                   java.lang.String desc,
                                   java.lang.String[] exceptions,
                                   java.io.File sourceJar)
        Instantiates a new Method descriptor.
        Parameters:
        name - the name
        access - the access
        desc - the desc
        exceptions - the exceptions
        sourceJar - the source jar
    • Method Detail

      • getName

        public java.lang.String getName()
        Gets name.
        Returns:
        the name
      • getDesc

        public java.lang.String getDesc()
        Gets desc.
        Returns:
        the desc
      • getArgumentTypes

        public org.objectweb.asm.Type[] getArgumentTypes()
        Get argument types type [ ].
        Returns:
        the type [ ]
      • getArgumentsString

        public java.lang.String getArgumentsString()
        Gets arguments string.
        Returns:
        the arguments string
      • getReturnType

        public org.objectweb.asm.Type getReturnType()
        Gets return type.
        Returns:
        the return type
      • getInvocations

        public java.util.List<Invocation> getInvocations()
        Gets invocations.
        Returns:
        the invocations
      • addInvocation

        public void addInvocation​(int opcode,
                                  java.lang.String type,
                                  java.lang.String name,
                                  java.lang.String desc)
        Add invocation.
        Parameters:
        opcode - the opcode
        type - the type
        name - the name
        desc - the desc
      • getFieldRefs

        public java.util.List<java.lang.String[]> getFieldRefs()
        Gets field refs.
        Returns:
        the field refs
      • addFieldRef

        public void addFieldRef​(java.lang.String type,
                                java.lang.String name)
        Add field ref.
        Parameters:
        type - the type
        name - the name
      • addTypeInstruction

        public void addTypeInstruction​(int opcode,
                                       java.lang.String desc)
        Add type instruction.
        Parameters:
        opcode - the opcode
        desc - the desc
      • addLocalVar

        public void addLocalVar​(java.lang.String desc)
        Add local var.
        Parameters:
        desc - the desc
      • getTypeInstructions

        public java.util.List<java.util.AbstractMap.SimpleEntry<java.lang.Object,​java.lang.Object>> getTypeInstructions()
        Gets type instructions.
        Returns:
        the type instructions
      • getExceptions

        public java.lang.String[] getExceptions()
        Get exceptions string [ ].
        Returns:
        the string [ ]
      • hasFlag

        public boolean hasFlag​(int code)
        Has flag boolean.
        Parameters:
        code - the code
        Returns:
        the boolean
      • isStatic

        public boolean isStatic()
        Is static boolean.
        Returns:
        the boolean
      • isPrivate

        public boolean isPrivate()
        Is private boolean.
        Returns:
        the boolean
      • overrides

        public boolean overrides​(MethodDescriptor md)
        check wether method md could override this method.
        • same name
        • md has same return type or return type of md is subclass of the return type of this method.
        • same number and type of arguments
        • md throws only the same or subclasses of Exceptions listed in the throws clause of this method
        • access: same or more
        Parameters:
        md - the MethodDescriptor
        Returns:
        true iff all constraints given above are true
      • overrides

        public boolean overrides​(java.lang.reflect.Method m)
        Overrides boolean.
        Parameters:
        m - the m
        Returns:
        the boolean
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isConstructor

        public boolean isConstructor()
        Is constructor boolean.
        Returns:
        the boolean
      • getSignature

        public java.lang.String getSignature()
        Gets signature.
        Returns:
        the signature