Class SignatureRegexes


  • public class SignatureRegexes
    extends java.lang.Object
    This class defines regular expressions for types supported by the Signature String Checker.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static @Regex java.lang.String ARRAY
      A regex that matches the nested-class part of a class name.
      static java.util.regex.Pattern ArrayWithoutPackagePattern
      A pattern that matches ArrayWithoutPackage strings.
      static @Regex java.lang.String ArrayWithoutPackageRegex
      A regex that matches ArrayWithoutPackage strings.
      private static @Regex java.lang.String BINARY_NAME
      An unanchored regex that matches BinaryName strings.
      static java.util.regex.Pattern BinaryNameOrPrimitiveTypePattern
      A pattern that matches BinaryNameOrPrimitiveType strings.
      static @Regex java.lang.String BinaryNameOrPrimitiveTypeRegex
      A regex that matches BinaryNameOrPrimitiveType strings.
      static java.util.regex.Pattern BinaryNamePattern
      A pattern that matches BinaryName strings.
      static @Regex java.lang.String BinaryNameRegex
      A regex that matches BinaryName strings.
      static java.util.regex.Pattern BinaryNameWithoutPackagePattern
      A pattern that matches BinaryNameWithoutPackage strings.
      static @Regex java.lang.String BinaryNameWithoutPackageRegex
      A regex that matches BinaryNameWithoutPackage strings.
      private static @Regex java.lang.String CLASS_GET_NAME_NONPRIMITIVE_NONARRAY
      A regex that matches ClassGetName, for non-primitive, non-array types.
      static java.util.regex.Pattern ClassGetNamePattern
      A pattern that matches ClassGetName strings.
      static @Regex java.lang.String ClassGetNameRegex
      A regex that matches ClassGetName strings.
      static java.util.regex.Pattern ClassGetSimpleNamePattern
      A pattern that matches ClassGetSimpleName strings.
      static @Regex java.lang.String ClassGetSimpleNameRegex
      A regex that matches ClassGetSimpleName strings.
      private static @Regex java.lang.String DOT_SEPARATED_IDENTIFIERS
      An unanchored regex that matches DotSeparatedIdentifiers strings.
      static java.util.regex.Pattern DotSeparatedIdentifiersOrPrimitiveTypePattern
      A pattern that matches DotSeparatedIdentifiersOrPrimitiveType strings.
      static @Regex java.lang.String DotSeparatedIdentifiersOrPrimitiveTypeRegex
      A regex that matches DotSeparatedIdentifiersOrPrimitiveType strings.
      static java.util.regex.Pattern DotSeparatedIdentifiersPattern
      A pattern that matches DotSeparatedIdentifiers strings.
      static @Regex java.lang.String DotSeparatedIdentifiersRegex
      A regex that matches DotSeparatedIdentifiers strings.
      private static @Regex java.lang.String FD_PRIMITIVE
      A regex that matches field descriptors for primitive types.
      static java.util.regex.Pattern FieldDescriptorForPrimitivePattern
      A pattern that matches FieldDescriptorForPrimitive strings.
      static @Regex java.lang.String FieldDescriptorForPrimitiveRegex
      A regex that matches FieldDescriptorForPrimitive strings.
      static java.util.regex.Pattern FieldDescriptorPattern
      A pattern that matches FieldDescriptor strings.
      static @Regex java.lang.String FieldDescriptorRegex
      A regex that matches FieldDescriptor strings.
      static java.util.regex.Pattern FieldDescriptorWithoutPackagePattern
      A pattern that matches FieldDescriptorWithoutPackage strings.
      static @Regex java.lang.String FieldDescriptorWithoutPackageRegex
      A regex that matches FieldDescriptorWithoutPackage strings.
      static java.util.regex.Pattern FqBinaryNamePattern
      A pattern that matches FqBinaryName strings.
      static @Regex java.lang.String FqBinaryNameRegex
      A regex that matches FqBinaryName strings.
      static java.util.regex.Pattern FullyQualifiedNamePattern
      A pattern that matches FullyQualifiedName strings.
      static @Regex java.lang.String FullyQualifiedNameRegex
      A regex that matches FullyQualifiedName strings.
      private static @Regex java.lang.String IDENTIFIER
      A grouped regex that matches identifiers.
      static @Regex java.lang.String IDENTIFIER_OR_PRIMITIVE_TYPE
      An anchored regex that matches Identifier strings.
      private static @Regex java.lang.String IDENTIFIER_TOKEN
      A regex that matches Java identifier tokens, as defined by the Java grammar.
      static java.util.regex.Pattern IdentifierOrPrimitiveTypePattern
      A pattern that matches IdentifierOrPrimitiveType strings.
      static @Regex java.lang.String IdentifierOrPrimitiveTypeRegex
      A regex that matches IdentifierOrPrimitiveType strings.
      static java.util.regex.Pattern IdentifierPattern
      A pattern that matches Identifier strings.
      static @Regex java.lang.String IdentifierRegex
      A regex that matches Identifier strings.
      static @Regex java.lang.String INTERNAL_FORM
      A regex that matches InternalForm strings.
      static java.util.regex.Pattern InternalFormPattern
      A pattern that matches InternalForm strings.
      static @Regex java.lang.String InternalFormRegex
      A regex that matches InternalForm strings.
      private static @Regex java.lang.String KEYWORD
      An unanchored regex that matches keywords.
      private static @Regex java.lang.String KEYWORD_NON_PRIMITIVE_TYPE
      An unanchored regex that matches keywords, except primitive types.
      private static @Regex java.lang.String KEYWORD_OR_LITERAL
      A regex that matches identifier tokens that are not identifiers (keywords, boolean literals, and the null literal).
      private static @Regex java.lang.String NESTED
      A regex that matches the nested-class part of a class name.
      private static @Regex java.lang.String NESTED_ONE
      A regex that matches the nested-class part of a class name, for one nested class.
      private static @Regex java.lang.String PRIMITIVE_TYPE
      An unanchored regex that matches primitive types.
      static java.util.regex.Pattern PrimitiveTypePattern
      A pattern that matches PrimitiveType strings.
      static @Regex java.lang.String PrimitiveTypeRegex
      A regex that matches PrimitiveType strings.
      private static @Regex java.lang.String SLASH_SEPARATED_IDENTIFIERS
      An unanchored regex that matches slash-separated identifiers.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SignatureRegexes()
      Do not instantiate this class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static @Regex java.lang.String ALTERNATE​(@Regex java.lang.String... args)
      An ungrouped alternation.
      private static @Regex java.lang.String ANCHORED​(@Regex java.lang.String arg)
      Create a regex that must match the entire string.
      private static @Regex java.lang.String ANY​(@Regex java.lang.String arg)
      Create a regex matching zero or more of the given argument (Kleene star).
      private static @Regex java.lang.String GROUPED​(@Regex java.lang.String arg)
      Create a capturing group.
      private static @Regex java.lang.String GROUPED_ALTERNATE​(@Regex java.lang.String... args)
      A grouped alternation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • KEYWORD_NON_PRIMITIVE_TYPE

        private static final @Regex java.lang.String KEYWORD_NON_PRIMITIVE_TYPE
        An unanchored regex that matches keywords, except primitive types.
      • PRIMITIVE_TYPE

        private static final @Regex java.lang.String PRIMITIVE_TYPE
        An unanchored regex that matches primitive types.
      • FD_PRIMITIVE

        private static final @Regex java.lang.String FD_PRIMITIVE
        A regex that matches field descriptors for primitive types.
        See Also:
        Constant Field Values
      • KEYWORD

        private static final @Regex java.lang.String KEYWORD
        An unanchored regex that matches keywords.
      • KEYWORD_OR_LITERAL

        private static final @Regex java.lang.String KEYWORD_OR_LITERAL
        A regex that matches identifier tokens that are not identifiers (keywords, boolean literals, and the null literal).
      • IDENTIFIER_TOKEN

        private static final @Regex java.lang.String IDENTIFIER_TOKEN
        A regex that matches Java identifier tokens, as defined by the Java grammar.
        See Also:
        Constant Field Values
      • IDENTIFIER

        private static final @Regex java.lang.String IDENTIFIER
        A grouped regex that matches identifiers.
      • IDENTIFIER_OR_PRIMITIVE_TYPE

        public static final @Regex java.lang.String IDENTIFIER_OR_PRIMITIVE_TYPE
        An anchored regex that matches Identifier strings.
      • DOT_SEPARATED_IDENTIFIERS

        private static final @Regex java.lang.String DOT_SEPARATED_IDENTIFIERS
        An unanchored regex that matches DotSeparatedIdentifiers strings.
      • SLASH_SEPARATED_IDENTIFIERS

        private static final @Regex java.lang.String SLASH_SEPARATED_IDENTIFIERS
        An unanchored regex that matches slash-separated identifiers.
      • NESTED_ONE

        private static final @Regex java.lang.String NESTED_ONE
        A regex that matches the nested-class part of a class name, for one nested class.
        See Also:
        Constant Field Values
      • NESTED

        private static final @Regex java.lang.String NESTED
        A regex that matches the nested-class part of a class name.
      • BINARY_NAME

        private static final @Regex java.lang.String BINARY_NAME
        An unanchored regex that matches BinaryName strings.
      • ARRAY

        private static final @Regex java.lang.String ARRAY
        A regex that matches the nested-class part of a class name.
        See Also:
        Constant Field Values
      • INTERNAL_FORM

        public static final @Regex java.lang.String INTERNAL_FORM
        A regex that matches InternalForm strings.
      • CLASS_GET_NAME_NONPRIMITIVE_NONARRAY

        private static final @Regex java.lang.String CLASS_GET_NAME_NONPRIMITIVE_NONARRAY
        A regex that matches ClassGetName, for non-primitive, non-array types.
      • ArrayWithoutPackageRegex

        public static final @Regex java.lang.String ArrayWithoutPackageRegex
        A regex that matches ArrayWithoutPackage strings.
      • ArrayWithoutPackagePattern

        public static final java.util.regex.Pattern ArrayWithoutPackagePattern
        A pattern that matches ArrayWithoutPackage strings.
      • BinaryNameRegex

        public static final @Regex java.lang.String BinaryNameRegex
        A regex that matches BinaryName strings.
      • BinaryNamePattern

        public static final java.util.regex.Pattern BinaryNamePattern
        A pattern that matches BinaryName strings.
      • BinaryNameWithoutPackageRegex

        public static final @Regex java.lang.String BinaryNameWithoutPackageRegex
        A regex that matches BinaryNameWithoutPackage strings.
      • BinaryNameWithoutPackagePattern

        public static final java.util.regex.Pattern BinaryNameWithoutPackagePattern
        A pattern that matches BinaryNameWithoutPackage strings.
      • BinaryNameOrPrimitiveTypeRegex

        public static final @Regex java.lang.String BinaryNameOrPrimitiveTypeRegex
        A regex that matches BinaryNameOrPrimitiveType strings.
      • BinaryNameOrPrimitiveTypePattern

        public static final java.util.regex.Pattern BinaryNameOrPrimitiveTypePattern
        A pattern that matches BinaryNameOrPrimitiveType strings.
      • ClassGetNameRegex

        public static final @Regex java.lang.String ClassGetNameRegex
        A regex that matches ClassGetName strings.
      • ClassGetNamePattern

        public static final java.util.regex.Pattern ClassGetNamePattern
        A pattern that matches ClassGetName strings.
      • ClassGetSimpleNameRegex

        public static final @Regex java.lang.String ClassGetSimpleNameRegex
        A regex that matches ClassGetSimpleName strings.
      • ClassGetSimpleNamePattern

        public static final java.util.regex.Pattern ClassGetSimpleNamePattern
        A pattern that matches ClassGetSimpleName strings.
      • DotSeparatedIdentifiersRegex

        public static final @Regex java.lang.String DotSeparatedIdentifiersRegex
        A regex that matches DotSeparatedIdentifiers strings.
      • DotSeparatedIdentifiersPattern

        public static final java.util.regex.Pattern DotSeparatedIdentifiersPattern
        A pattern that matches DotSeparatedIdentifiers strings.
      • DotSeparatedIdentifiersOrPrimitiveTypeRegex

        public static final @Regex java.lang.String DotSeparatedIdentifiersOrPrimitiveTypeRegex
        A regex that matches DotSeparatedIdentifiersOrPrimitiveType strings.
      • DotSeparatedIdentifiersOrPrimitiveTypePattern

        public static final java.util.regex.Pattern DotSeparatedIdentifiersOrPrimitiveTypePattern
        A pattern that matches DotSeparatedIdentifiersOrPrimitiveType strings.
      • FieldDescriptorRegex

        public static final @Regex java.lang.String FieldDescriptorRegex
        A regex that matches FieldDescriptor strings.
      • FieldDescriptorPattern

        public static final java.util.regex.Pattern FieldDescriptorPattern
        A pattern that matches FieldDescriptor strings.
      • FieldDescriptorWithoutPackageRegex

        public static final @Regex java.lang.String FieldDescriptorWithoutPackageRegex
        A regex that matches FieldDescriptorWithoutPackage strings.
      • FieldDescriptorWithoutPackagePattern

        public static final java.util.regex.Pattern FieldDescriptorWithoutPackagePattern
        A pattern that matches FieldDescriptorWithoutPackage strings.
      • FieldDescriptorForPrimitiveRegex

        public static final @Regex java.lang.String FieldDescriptorForPrimitiveRegex
        A regex that matches FieldDescriptorForPrimitive strings.
      • FieldDescriptorForPrimitivePattern

        public static final java.util.regex.Pattern FieldDescriptorForPrimitivePattern
        A pattern that matches FieldDescriptorForPrimitive strings.
      • FqBinaryNameRegex

        public static final @Regex java.lang.String FqBinaryNameRegex
        A regex that matches FqBinaryName strings.
      • FqBinaryNamePattern

        public static final java.util.regex.Pattern FqBinaryNamePattern
        A pattern that matches FqBinaryName strings.
      • FullyQualifiedNameRegex

        public static final @Regex java.lang.String FullyQualifiedNameRegex
        A regex that matches FullyQualifiedName strings.
      • FullyQualifiedNamePattern

        public static final java.util.regex.Pattern FullyQualifiedNamePattern
        A pattern that matches FullyQualifiedName strings.
      • IdentifierRegex

        public static final @Regex java.lang.String IdentifierRegex
        A regex that matches Identifier strings.
      • IdentifierPattern

        public static final java.util.regex.Pattern IdentifierPattern
        A pattern that matches Identifier strings.
      • IdentifierOrPrimitiveTypeRegex

        public static final @Regex java.lang.String IdentifierOrPrimitiveTypeRegex
        A regex that matches IdentifierOrPrimitiveType strings.
      • IdentifierOrPrimitiveTypePattern

        public static final java.util.regex.Pattern IdentifierOrPrimitiveTypePattern
        A pattern that matches IdentifierOrPrimitiveType strings.
      • InternalFormRegex

        public static final @Regex java.lang.String InternalFormRegex
        A regex that matches InternalForm strings.
      • InternalFormPattern

        public static final java.util.regex.Pattern InternalFormPattern
        A pattern that matches InternalForm strings.
      • PrimitiveTypeRegex

        public static final @Regex java.lang.String PrimitiveTypeRegex
        A regex that matches PrimitiveType strings.
      • PrimitiveTypePattern

        public static final java.util.regex.Pattern PrimitiveTypePattern
        A pattern that matches PrimitiveType strings.
    • Constructor Detail

      • SignatureRegexes

        private SignatureRegexes()
        Do not instantiate this class.
    • Method Detail

      • GROUPED

        private static final @Regex java.lang.String GROUPED​(@Regex java.lang.String arg)
        Create a capturing group.
        Parameters:
        arg - a regular expression
        Returns:
        the argument wrapped in a capturing group
      • ANY

        private static final @Regex java.lang.String ANY​(@Regex java.lang.String arg)
        Create a regex matching zero or more of the given argument (Kleene star).
        Parameters:
        arg - a regular expression
        Returns:
        the argument, repeated zero or more times
      • ANCHORED

        private static final @Regex java.lang.String ANCHORED​(@Regex java.lang.String arg)
        Create a regex that must match the entire string.
        Parameters:
        arg - a regular expression
        Returns:
        the argument, made to match the entire string
      • ALTERNATE

        private static final @Regex java.lang.String ALTERNATE​(@Regex java.lang.String... args)
        An ungrouped alternation.
        Parameters:
        args - regular expressions
        Returns:
        a regex that matches any one of the arguments
      • GROUPED_ALTERNATE

        private static final @Regex java.lang.String GROUPED_ALTERNATE​(@Regex java.lang.String... args)
        A grouped alternation.
        Parameters:
        args - regular expressions
        Returns:
        a regex that matches any one of the arguments, wrapped in a capturing group