jodd-proxetta/src/main/java/jodd/asm7/signature/SignatureReader.java
public void accept(final SignatureVisitor signatureVistor) {
    String signature = this.signatureValue;
    int length = signature.length();
    int offset; // Current offset in the parsed signature (parsed from left to right).
    char currentChar; // The signature character at 'offset', or just before.

    // If the signature starts with '<', it starts with TypeParameters, i.e. a formal type parameter
    // identifier, followed by one or more pair ':',ReferenceTypeSignature (for its class bound and
    // interface bounds).
    if (signature.charAt(0) == '<') {
      // Invariant: offset points to the second character of a formal type parameter name at the
      // beginning of each iteration of the loop below.
      offset = 2;
      do {
        // The formal type parameter name is everything between offset - 1 and the first ':'.
        int classBoundStartOffset = signature.indexOf(':', offset);
        signatureVistor.visitFormalTypeParameter(
            signature.substring(offset - 1, classBoundStartOffset));

        // If the character after the ':' class bound marker is not the start of a
        // ReferenceTypeSignature, it means the class bound is empty (which is a valid case).
        offset = classBoundStartOffset + 1;
        currentChar = signature.charAt(offset);
        if (currentChar == 'L' || currentChar == '[' || currentChar == 'T') {
          offset = parseType(signature, offset, signatureVistor.visitClassBound());
        }

        // While the character after the class bound or after the last parsed interface bound
        // is ':', we need to parse another interface bound.
        while ((currentChar = signature.charAt(offset++)) == ':') {
          offset = parseType(signature, offset, signatureVistor.visitInterfaceBound());
        }

        // At this point a TypeParameter has been fully parsed, and we need to parse the next one
        // (note that currentChar is now the first character of the next TypeParameter, and that
        // offset points to the second character), unless the character just after this
        // TypeParameter signals the end of the TypeParameters.
      } while (currentChar != '>');
    } else {
      offset = 0;
    }

    // If the (optional) TypeParameters is followed by '(' this means we are parsing a
    // MethodSignature, which has JavaTypeSignature type inside parentheses, followed by a Result
    // type and optional ThrowsSignature types.
    if (signature.charAt(offset) == '(') {
      offset++;
      while (signature.charAt(offset) != ')') {
        offset = parseType(signature, offset, signatureVistor.visitParameterType());
      }
      // Use offset + 1 to skip ')'.
      offset = parseType(signature, offset + 1, signatureVistor.visitReturnType());
      while (offset < length) {
        // Use offset + 1 to skip the first character of a ThrowsSignature, i.e. '^'.
        offset = parseType(signature, offset + 1, signatureVistor.visitExceptionType());
      }
    } else {
      // Otherwise we are parsing a ClassSignature (by hypothesis on the method input), which has
      // one or more ClassTypeSignature for the super class and the implemented interfaces.
      offset = parseType(signature, offset, signatureVistor.visitSuperclass());
      while (offset < length) {
        offset = parseType(signature, offset, signatureVistor.visitInterface());
      }
    }
  }
public void accept(final SignatureVisitor signatureVistor) {
    String signature = this.signatureValue;
    int length = signature.length();
    int offset; // Current offset in the parsed signature (parsed from left to right).
    char currentChar; // The signature character at 'offset', or just before.

    // If the signature starts with '<', it starts with TypeParameters, i.e. a formal type parameter
    // identifier, followed by one or more pair ':',ReferenceTypeSignature (for its class bound and
    // interface bounds).
    if (signature.charAt(0) == '<') {
      // Invariant: offset points to the second character of a formal type parameter name at the
      // beginning of each iteration of the loop below.
      offset = 2;
      do {
        // The formal type parameter name is everything between offset - 1 and the first ':'.
        int classBoundStartOffset = signature.indexOf(':', offset);
        signatureVistor.visitFormalTypeParameter(
            signature.substring(offset - 1, classBoundStartOffset));

        // If the character after the ':' class bound marker is not the start of a
        // ReferenceTypeSignature, it means the class bound is empty (which is a valid case).
        offset = classBoundStartOffset + 1;
        currentChar = signature.charAt(offset);
        if (currentChar == 'L' || currentChar == '[' || currentChar == 'T') {
          offset = parseType(signature, offset, signatureVistor.visitClassBound());
        }

        // While the character after the class bound or after the last parsed interface bound
        // is ':', we need to parse another interface bound.
        while ((currentChar = signature.charAt(offset++)) == ':') {
          offset = parseType(signature, offset, signatureVistor.visitInterfaceBound());
        }

        // At this point a TypeParameter has been fully parsed, and we need to parse the next one
        // (note that currentChar is now the first character of the next TypeParameter, and that
        // offset points to the second character), unless the character just after this
        // TypeParameter signals the end of the TypeParameters.
      } while (currentChar != '>');
    } else {
      offset = 0;
    }

    // If the (optional) TypeParameters is followed by '(' this means we are parsing a
    // MethodSignature, which has JavaTypeSignature type inside parentheses, followed by a Result
    // type and optional ThrowsSignature types.
    if (signature.charAt(offset) == '(') {
      offset++;
      while (signature.charAt(offset) != ')') {
        offset = parseType(signature, offset, signatureVistor.visitParameterType());
      }
      // Use offset + 1 to skip ')'.
      offset = parseType(signature, offset + 1, signatureVistor.visitReturnType());
      while (offset < length) {
        // Use offset + 1 to skip the first character of a ThrowsSignature, i.e. '^'.
        offset = parseType(signature, offset + 1, signatureVistor.visitExceptionType());
      }
    } else {
      // Otherwise we are parsing a ClassSignature (by hypothesis on the method input), which has
      // one or more ClassTypeSignature for the super class and the implemented interfaces.
      offset = parseType(signature, offset, signatureVistor.visitSuperclass());
      while (offset < length) {
        offset = parseType(signature, offset, signatureVistor.visitInterface());
      }
    }
  }
public void accept ( final SignatureVisitor signatureVistor ) { String signature = this . signatureValue ; int length = signature . length ( ) ; int offset ; // Current offset in the parsed signature (parsed from left to right). char currentChar ; // The signature character at 'offset', or just before. // If the signature starts with '<', it starts with TypeParameters, i.e. a formal type parameter // identifier, followed by one or more pair ':',ReferenceTypeSignature (for its class bound and // interface bounds). if ( signature . charAt ( 0 ) == ' ' ) { // Invariant: offset points to the second character of a formal type parameter name at the // beginning of each iteration of the loop below. offset = 2 ; do { // The formal type parameter name is everything between offset - 1 and the first ':'. int classBoundStartOffset = signature . indexOf ( ' ' , offset ) ; signatureVistor . visitFormalTypeParameter ( signature . substring ( offset - 1 , classBoundStartOffset ) ) ; // If the character after the ':' class bound marker is not the start of a // ReferenceTypeSignature, it means the class bound is empty (which is a valid case). offset = classBoundStartOffset + 1 ; currentChar = signature . charAt ( offset ) ; if ( currentChar == ' ' || currentChar == ' ' || currentChar == ' ' ) { offset = parseType ( signature , offset , signatureVistor . visitClassBound ( ) ) ; } // While the character after the class bound or after the last parsed interface bound // is ':', we need to parse another interface bound. while ( ( currentChar = signature . charAt ( offset ++ ) ) == ' ' ) { offset = parseType ( signature , offset , signatureVistor . visitInterfaceBound ( ) ) ; } // At this point a TypeParameter has been fully parsed, and we need to parse the next one // (note that currentChar is now the first character of the next TypeParameter, and that // offset points to the second character), unless the character just after this // TypeParameter signals the end of the TypeParameters. } while ( currentChar != ' ' ) ; } else { offset = 0 ; } // If the (optional) TypeParameters is followed by '(' this means we are parsing a // MethodSignature, which has JavaTypeSignature type inside parentheses, followed by a Result // type and optional ThrowsSignature types. if ( signature . charAt ( offset ) == ' ' ) { offset ++ ; while ( signature . charAt ( offset ) != ' ' ) { offset = parseType ( signature , offset , signatureVistor . visitParameterType ( ) ) ; } // Use offset + 1 to skip ')'. offset = parseType ( signature , offset + 1 , signatureVistor . visitReturnType ( ) ) ; while ( offset < length ) { // Use offset + 1 to skip the first character of a ThrowsSignature, i.e. '^'. offset = parseType ( signature , offset + 1 , signatureVistor . visitExceptionType ( ) ) ; } } else { // Otherwise we are parsing a ClassSignature (by hypothesis on the method input), which has // one or more ClassTypeSignature for the super class and the implemented interfaces. offset = parseType ( signature , offset , signatureVistor . visitSuperclass ( ) ) ; while ( offset < length ) { offset = parseType ( signature , offset , signatureVistor . visitInterface ( ) ) ; } } }
Makes the given visitor visit the signature of this {@link SignatureReader}. This signature is
the one specified in the constructor (see {@link #SignatureReader}). This method is intended to
be called on a {@link SignatureReader} that was created using a <i>ClassSignature</i> (such as
the <code>signature</code> parameter of the {@link org.objectweb.asm.ClassVisitor#visit}
method) or a <i>MethodSignature</i> (such as the <code>signature</code> parameter of the {@link
org.objectweb.asm.ClassVisitor#visitMethod} method).

@param signatureVistor the visitor that must visit this signature.
Makes the given visitor visit the signature of this { @link SignatureReader } . This signature is the one specified in the constructor ( see { @link #SignatureReader } ) . This method is intended to be called on a { @link SignatureReader } that was created using a <i > ClassSignature< / i > ( such as the <code > signature< / code > parameter of the { @link org . objectweb . asm . ClassVisitor#visit } method ) or a <i > MethodSignature< / i > ( such as the <code > signature< / code > parameter of the { @link org . objectweb . asm . ClassVisitor#visitMethod } method ) .