Package com.helger.commons.text.util
Class ABNF
java.lang.Object
com.helger.commons.text.util.ABNF
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisAlpha(int nCP) Check if the passed code point matches the following rules:%x41-5A / %x61-7A ; A-Z / a-zstatic booleanisBit(int nCP) Check if the passed code point matches the following rules:"0" / "1"static booleanisChar(int nCP) Check if the passed code point matches the following rules:%x01-7F → any 7-bit US-ASCII character, excluding NULstatic booleanisCR(int nCP) Check if the passed code point matches the following rules:%x0D → carriage returnstatic booleanisCtl(int nCP) Check if the passed code point matches the following rules:%x00-1F / %x7F → controlsstatic booleanisDigit(int nCP) Check if the passed code point matches the following rules:%x30-39 → 0-9static booleanisDQuote(int nCP) Check if the passed code point matches the following rules:%x22 → " (Double Quote)static booleanisHexDigit(int nCP) Check if the passed code point matches the following rules:DIGIT / "A" / "B" / "C" / "D" / "E" / "F"static booleanisHexDigitCaseInsensitive(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 booleanisHTab(int nCP) Check if the passed code point matches the following rules:%x09 → horizontal tabstatic booleanisLF(int nCP) Check if the passed code point matches the following rules:%x0A → linefeedstatic booleanisOctet(int nCP) Check if the passed code point matches the following rules:%x00-FF → 8 bits of datastatic booleanisSP(int nCP) Check if the passed code point matches the following rules:%x20static booleanisVChar(int nCP) Check if the passed code point matches the following rules:%x21-7E → visible (printing) charactersstatic booleanisWSP(int nCP) Check if the passed code point matches the following rules:SP / HTAB → white space
-
Field Details
-
CHECK_RANGE_MIN_INCL
public static final int CHECK_RANGE_MIN_INCL- See Also:
-
CHECK_RANGE_MAX_INCL
public static final int CHECK_RANGE_MAX_INCL- See Also:
-
-
Method Details
-
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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif it matches the rules- See Also:
-
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:
trueif it matches the rules- See Also:
-
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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif it matches the rules
-