Class Signature


  • public class Signature
    extends AttributeInfo
    The Signature attribute is an optional fixed-length attribute in the attribute table of the ClassFile, field_info and method_info structures.

    WARNING: This code is a complete mess.

    Version:
    1.0
    • Field Detail

      • signature

        private java.lang.String signature
    • Constructor Detail

      • Signature

        public Signature​(ClassFile cf,
                         java.lang.String signature)
    • Method Detail

      • getClassParamTypes

        public java.util.List<java.lang.String> getClassParamTypes()
        Returns the class-param types of this method.
        Returns:
        The class-param types.
      • skipLtGt

        private int skipLtGt​(java.lang.String str,
                             int start)
      • getMethodParamTypes

        public java.util.List<java.lang.String> getMethodParamTypes​(MethodInfo mi,
                                                                    ClassFile cf,
                                                                    boolean qualified)
        Returns the parameter types for parameters of this method.
        Parameters:
        mi - The method information.
        cf - The class file being parsed.
        qualified - Whether the results should be fully-qualified.
        Returns:
        The return types.
      • getMethodReturnType

        public java.lang.String getMethodReturnType​(MethodInfo mi,
                                                    ClassFile cf,
                                                    boolean qualified)
        Returns the return type of this method.
        Parameters:
        mi - The method information.
        cf - The class file being parsed.
        qualified - Whether the result should be fully-qualified.
        Returns:
        The return type.
      • getSignature

        public java.lang.String getSignature()
      • getTypeArgument

        private java.lang.String getTypeArgument​(java.lang.String typeVar,
                                                 ClassFile cf,
                                                 java.util.Map<java.lang.String,​java.lang.String> additionalTypeArgs)
        Returns the type argument specified for a given type parameter.
        Parameters:
        typeVar - The type parameter name.
        cf - The class file with generic methods.
        additionalTypeArgs - Additional type arguments for a method (such as for "<T> T[] toArray(T[] a)", where the "T" type parameter is the type of an argument passed to it).
        Returns:
        The type argument, or null if the given type parameter isn't defined.
      • parseAdditionalTypeArgs

        private java.util.Map<java.lang.String,​java.lang.String> parseAdditionalTypeArgs​(java.lang.String typeParams)
      • toString

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