Class ABNF


  • @Immutable
    public final class ABNF
    extends Object
    This class contains the ABNF (RFC 5234 https://tools.ietf.org/html/rfc5234) core rules. All checks can be performed for values in the range 0 ≤ x ≤ 127.
    Author:
    Philip Helger
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isAlpha​(int nCP)
      Check if the passed code point matches the following rules: %x41-5A / %x61-7A ; A-Z / a-z
      static boolean isBit​(int nCP)
      Check if the passed code point matches the following rules: "0" / "1"
      static boolean isChar​(int nCP)
      Check if the passed code point matches the following rules: %x01-7F → any 7-bit US-ASCII character, excluding NUL
      static boolean isCR​(int nCP)
      Check if the passed code point matches the following rules: %x0D → carriage return
      static boolean isCtl​(int nCP)
      Check if the passed code point matches the following rules: %x00-1F / %x7F → controls
      static boolean isDigit​(int nCP)
      Check if the passed code point matches the following rules: %x30-39 → 0-9
      static boolean isDQuote​(int nCP)
      Check if the passed code point matches the following rules: %x22 → " (Double Quote)
      static boolean isHexDigit​(int nCP)
      Check if the passed code point matches the following rules: DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
      static boolean isHexDigitCaseInsensitive​(int nCP)
      Check if the passed code point matches the following rules: DIGIT / "A" / "B" / "C" / "D" / "E" / "F" / "a" / "b" / "c" / "d" / "e" / "f"
      Note: this is a non-standard extension!
      static boolean isHTab​(int nCP)
      Check if the passed code point matches the following rules: %x09 → horizontal tab
      static boolean isLF​(int nCP)
      Check if the passed code point matches the following rules: %x0A → linefeed
      static boolean isOctet​(int nCP)
      Check if the passed code point matches the following rules: %x00-FF → 8 bits of data
      static boolean isSP​(int nCP)
      Check if the passed code point matches the following rules: %x20
      static boolean isVChar​(int nCP)
      Check if the passed code point matches the following rules: %x21-7E → visible (printing) characters
      static boolean isWSP​(int nCP)
      Check if the passed code point matches the following rules: SP / HTAB → white space
    • Method Detail

      • isAlpha

        public static boolean isAlpha​(int nCP)
        Check if the passed code point matches the following rules: %x41-5A / %x61-7A ; A-Z / a-z
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
      • isBit

        public static boolean isBit​(int nCP)
        Check if the passed code point matches the following rules: "0" / "1"
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
      • isChar

        public static boolean isChar​(int nCP)
        Check if the passed code point matches the following rules: %x01-7F → any 7-bit US-ASCII character, excluding NUL
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
      • isCR

        public static boolean isCR​(int nCP)
        Check if the passed code point matches the following rules: %x0D → carriage return
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
      • isCtl

        public static boolean isCtl​(int nCP)
        Check if the passed code point matches the following rules: %x00-1F / %x7F → controls
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
      • isDigit

        public static boolean isDigit​(int nCP)
        Check if the passed code point matches the following rules: %x30-39 → 0-9
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
      • isDQuote

        public static boolean isDQuote​(int nCP)
        Check if the passed code point matches the following rules: %x22 → " (Double Quote)
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
      • isHexDigit

        public static boolean isHexDigit​(int nCP)
        Check if the passed code point matches the following rules: DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
        See Also:
        isHexDigitCaseInsensitive(int)
      • isHexDigitCaseInsensitive

        public static boolean isHexDigitCaseInsensitive​(int nCP)
        Check if the passed code point matches the following rules: DIGIT / "A" / "B" / "C" / "D" / "E" / "F" / "a" / "b" / "c" / "d" / "e" / "f"
        Note: this is a non-standard extension!
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
        See Also:
        isHexDigit(int)
      • isHTab

        public static boolean isHTab​(int nCP)
        Check if the passed code point matches the following rules: %x09 → horizontal tab
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
      • isLF

        public static boolean isLF​(int nCP)
        Check if the passed code point matches the following rules: %x0A → linefeed
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
      • isOctet

        public static boolean isOctet​(int nCP)
        Check if the passed code point matches the following rules: %x00-FF → 8 bits of data
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
      • isSP

        public static boolean isSP​(int nCP)
        Check if the passed code point matches the following rules: %x20
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
      • isVChar

        public static boolean isVChar​(int nCP)
        Check if the passed code point matches the following rules: %x21-7E → visible (printing) characters
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules
      • isWSP

        public static boolean isWSP​(int nCP)
        Check if the passed code point matches the following rules: SP / HTAB → white space
        Parameters:
        nCP - Code point to check.
        Returns:
        true if it matches the rules