/** * Checks a type variable signature. * * @param signature a string containing the signature that must be checked. * @param startPos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeVariableSignature(final String signature, final int startPos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // TypeVariableSignature: // T Identifier ; int pos = startPos; pos = checkChar('T', signature, pos); pos = checkSignatureIdentifier(signature, pos); return checkChar(';', signature, pos); }
/** * Checks a type variable signature. * * @param signature a string containing the signature that must be checked. * @param startPos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeVariableSignature(final String signature, final int startPos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // TypeVariableSignature: // T Identifier ; int pos = startPos; pos = checkChar('T', signature, pos); pos = checkSignatureIdentifier(signature, pos); return checkChar(';', signature, pos); }
/** * Checks a type variable signature. * * @param signature * a string containing the signature that must be checked. * @param pos * index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeVariableSignature(final String signature, int pos) { // TypeVariableSignature: // T Identifier ; pos = checkChar('T', signature, pos); pos = checkIdentifier(signature, pos); return checkChar(';', signature, pos); }
/** * Checks the formal type parameters of a class or method signature. * * @param signature * a string containing the signature that must be checked. * @param pos * index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkFormalTypeParameters(final String signature, int pos) { // FormalTypeParameters: // < FormalTypeParameter+ > pos = checkChar('<', signature, pos); pos = checkFormalTypeParameter(signature, pos); while (getChar(signature, pos) != '>') { pos = checkFormalTypeParameter(signature, pos); } return pos + 1; }
/** * Checks the type arguments in a class type signature. * * @param signature a string containing the signature that must be checked. * @param startPos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeArguments(final String signature, final int startPos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // TypeArguments: // < TypeArgument TypeArgument* > int pos = startPos; pos = checkChar('<', signature, pos); pos = checkTypeArgument(signature, pos); while (getChar(signature, pos) != '>') { pos = checkTypeArgument(signature, pos); } return pos + 1; }
/** * Checks the type parameters of a class or method signature. * * @param signature a string containing the signature that must be checked. * @param startPos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeParameters(final String signature, final int startPos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // TypeParameters: // < TypeParameter TypeParameter* > int pos = startPos; pos = checkChar('<', signature, pos); pos = checkTypeParameter(signature, pos); while (getChar(signature, pos) != '>') { pos = checkTypeParameter(signature, pos); } return pos + 1; }
/** * Checks the type arguments in a class type signature. * * @param signature a string containing the signature that must be checked. * @param startPos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeArguments(final String signature, final int startPos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // TypeArguments: // < TypeArgument TypeArgument* > int pos = startPos; pos = checkChar('<', signature, pos); pos = checkTypeArgument(signature, pos); while (getChar(signature, pos) != '>') { pos = checkTypeArgument(signature, pos); } return pos + 1; }
/** * Checks the type arguments in a class type signature. * * @param signature * a string containing the signature that must be checked. * @param pos * index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeArguments(final String signature, int pos) { // TypeArguments: // < TypeArgument+ > pos = checkChar('<', signature, pos); pos = checkTypeArgument(signature, pos); while (getChar(signature, pos) != '>') { pos = checkTypeArgument(signature, pos); } return pos + 1; }
/** * Checks the type parameters of a class or method signature. * * @param signature a string containing the signature that must be checked. * @param startPos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeParameters(final String signature, final int startPos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // TypeParameters: // < TypeParameter TypeParameter* > int pos = startPos; pos = checkChar('<', signature, pos); pos = checkTypeParameter(signature, pos); while (getChar(signature, pos) != '>') { pos = checkTypeParameter(signature, pos); } return pos + 1; }
/** * Checks a formal type parameter of a class or method signature. * * @param signature * a string containing the signature that must be checked. * @param pos * index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkFormalTypeParameter(final String signature, int pos) { // FormalTypeParameter: // Identifier : FieldTypeSignature? (: FieldTypeSignature)* pos = checkIdentifier(signature, pos); pos = checkChar(':', signature, pos); if ("L[T".indexOf(getChar(signature, pos)) != -1) { pos = checkFieldTypeSignature(signature, pos); } while (getChar(signature, pos) == ':') { pos = checkFieldTypeSignature(signature, pos + 1); } return pos; }
/** * Checks a type parameter of a class or method signature. * * @param signature a string containing the signature that must be checked. * @param startPos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeParameter(final String signature, final int startPos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // TypeParameter: // Identifier ClassBound InterfaceBound* // ClassBound: // : [ReferenceTypeSignature] // InterfaceBound: // : ReferenceTypeSignature int pos = startPos; pos = checkSignatureIdentifier(signature, pos); pos = checkChar(':', signature, pos); if ("L[T".indexOf(getChar(signature, pos)) != -1) { pos = checkReferenceTypeSignature(signature, pos); } while (getChar(signature, pos) == ':') { pos = checkReferenceTypeSignature(signature, pos + 1); } return pos; }
/** * Checks a type parameter of a class or method signature. * * @param signature a string containing the signature that must be checked. * @param startPos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeParameter(final String signature, final int startPos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // TypeParameter: // Identifier ClassBound InterfaceBound* // ClassBound: // : [ReferenceTypeSignature] // InterfaceBound: // : ReferenceTypeSignature int pos = startPos; pos = checkSignatureIdentifier(signature, pos); pos = checkChar(':', signature, pos); if ("L[T".indexOf(getChar(signature, pos)) != -1) { pos = checkReferenceTypeSignature(signature, pos); } while (getChar(signature, pos) == ':') { pos = checkReferenceTypeSignature(signature, pos + 1); } return pos; }
/** * Checks a class type signature. * * @param signature * a string containing the signature that must be checked. * @param pos * index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkClassTypeSignature(final String signature, int pos) { // ClassTypeSignature: // L Identifier ( / Identifier )* TypeArguments? ( . Identifier // TypeArguments? )* ; pos = checkChar('L', signature, pos); pos = checkIdentifier(signature, pos); while (getChar(signature, pos) == '/') { pos = checkIdentifier(signature, pos + 1); } if (getChar(signature, pos) == '<') { pos = checkTypeArguments(signature, pos); } while (getChar(signature, pos) == '.') { pos = checkIdentifier(signature, pos + 1); if (getChar(signature, pos) == '<') { pos = checkTypeArguments(signature, pos); } } return checkChar(';', signature, pos); }