Class RFC5892
java.lang.Object
com.networknt.schema.utils.RFC5892
Encapsulates the rules determining whether a label conforms to the RFC 5892 specification.
In the context of RFC 5892. a label is a subcomponent of a DNS entry. For example, schema.networknt.com has three sub-components or labels: com, networknt and schema.
Each component (or label) must satisfy the constraints identified in RFC 5892.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final intprivate static final BiPredicate<String, Integer> private static final BitSetprivate static final BitSetprivate static final BitSetprivate static final intprivate static final intprivate static final intprivate static final BiPredicate<String, Integer> private static final intprivate static final BiPredicate<String, Integer> private static final intprivate static final BiPredicate<String, Integer> private static final BiPredicate<String, Integer> private static final BiPredicate<String, Integer> private static final BiPredicate<String, Integer> private static final BiPredicate<String, Integer> private static final BiPredicate<String, Integer> private static final BiPredicate<String, Integer> private static final BiPredicate<String, Integer> private static final BiPredicate<String, Integer> private static final BitSetprivate static final intprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanprivate static booleanisCombiningMark(int codepoint) private static booleanisContextJ(int codepoint) private static booleanisContextO(int codepoint) private static booleanisDisallowed(int codepoint) private static booleanisUnassigned(int codepoint) static booleanprivate static voidprivate static booleantestAllowedCharacter(String s, int i) private static booleantestArabicIndicDigit(String s, int i) private static booleantesteMiddleDotRule(String s, int i) Determines whether the MIDDLE DOT conforms to the RFC 5892 specification.private static booleantestExtendedArabicIndicDigit(String s, int i) private static booleantestGreekLowerNumeralSign(String s, int i) Determines whether the GREEK LOWER NUMERAL SIGN (KERAIA) conforms to the RFC 5892 specification.private static booleantestHebrewPuncuation(String s, int i) Determines whether the HEBREW PUNCTUATION (GERESH or GERSHAYIM) conforms to the RFC 5892 specification.private static booleantestKatakanaMiddleDot(String s, int i) Determines whether the KATAKANA MIDDLE DOT conforms to the RFC 5892 specification.private static booleanprivate static booleanprivate static booleantestZeroWidthJoiner(String s, int i) Determines whether the ZERO WIDTH JOINER conforms to the RFC 5892 specification.private static booleantestZeroWidthNonJoiner(String s, int i) Determines whether the ZERO WIDTH NON-OINER conforms to the RFC 5892 specification.
-
Field Details
-
ACE_PREFIX
- See Also:
-
ACE_PREFIX_LENGTH
private static final int ACE_PREFIX_LENGTH -
GREEK_LOWER_NUMERAL_SIGN
private static final int GREEK_LOWER_NUMERAL_SIGN- See Also:
-
HEBREW_GERESH
private static final int HEBREW_GERESH- See Also:
-
HEBREW_GERSHAYIM
private static final int HEBREW_GERSHAYIM- See Also:
-
KATAKANA_MIDDLE_DOT
private static final int KATAKANA_MIDDLE_DOT- See Also:
-
MIDDLE_DOT
private static final int MIDDLE_DOT- See Also:
-
VIRAMA
private static final int VIRAMA- See Also:
-
ZERO_WIDTH_JOINER
private static final int ZERO_WIDTH_JOINER- See Also:
-
ZERO_WIDTH_NON_JOINER
private static final int ZERO_WIDTH_NON_JOINER- See Also:
-
CONTEXTJ
-
CONTEXTO
-
DISALLOWED
-
UNASSIGNED
-
RULE_ARABIC_INDIC_DIGITS_RULE
-
RULE_EXTENDED_ARABIC_INDIC_DIGITS_RULE
-
RULE_GREEK_LOWER_NUMERAL_SIGN
-
RULE_HEBREW_GERESH_GERSHAYIM
-
RULE_KATAKANA_MIDDLE_DOT
-
RULE_MIDDLE_DOT
-
RULE_ZERO_WIDTH_JOINER
-
RULE_ZERO_WIDTH_NON_JOINER
-
ALLOWED_CHARACTER
-
LTR
-
RTL
-
IDNA_RULES
-
-
Constructor Details
-
RFC5892
public RFC5892()
-
-
Method Details
-
isContextJ
private static boolean isContextJ(int codepoint) -
isContextO
private static boolean isContextO(int codepoint) -
isDisallowed
private static boolean isDisallowed(int codepoint) -
isUnassigned
private static boolean isUnassigned(int codepoint) -
testAllowedCharacter
-
isValid
-
isACE
-
isCombiningMark
private static boolean isCombiningMark(int codepoint) -
testLTR
-
testRTL
-
testGreekLowerNumeralSign
Determines whether the GREEK LOWER NUMERAL SIGN (KERAIA) conforms to the RFC 5892 specification.- Parameters:
s- Must be a simple Unicode string; i.e., not ACE encodedi- the location of the KERAIA within the source label- Returns:
trueif the KERAIA rule is valid at the given location or the character at the given position is not the KERAIA character.
-
testHebrewPuncuation
Determines whether the HEBREW PUNCTUATION (GERESH or GERSHAYIM) conforms to the RFC 5892 specification.- Parameters:
s- Must be a simple Unicode string; i.e., not ACE encodedi- the location of the character within the source label- Returns:
trueif the rule is valid at the given location or the character at the given position is not a GERESH or GERSHAYIM character.
-
testKatakanaMiddleDot
Determines whether the KATAKANA MIDDLE DOT conforms to the RFC 5892 specification.- Parameters:
s- Must be a simple Unicode string; i.e., not ACE encodedi- the location of the character within the source label- Returns:
trueif the rule is valid at the given location or the character at the given position is not a KATAKANA MIDDLE DOT character.
-
testeMiddleDotRule
Determines whether the MIDDLE DOT conforms to the RFC 5892 specification.- Parameters:
s- Must be a simple Unicode string; i.e., not ACE encodedi- the location of the MIDDLE DOT within the source label- Returns:
trueif the MIDDLE DOT rule is valid at the given location or the character at the given position is not the MIDDLE DOT character.
-
testZeroWidthJoiner
Determines whether the ZERO WIDTH JOINER conforms to the RFC 5892 specification.- Parameters:
s- Must be a simple Unicode string; i.e., not ACE encodedi- the location of the character within the source label- Returns:
trueif the rule is valid at the given location or the character at the given position is not a ZERO WIDTH JOINER character.
-
testZeroWidthNonJoiner
Determines whether the ZERO WIDTH NON-OINER conforms to the RFC 5892 specification.- Parameters:
s- Must be a simple Unicode string; i.e., not ACE encodedi- the location of the character within the source label- Returns:
trueif the rule is valid at the given location or the character at the given position is not a ZERO WIDTH NON-JOINER character.
-
testArabicIndicDigit
-
testExtendedArabicIndicDigit
-
loadDerivedProperties
private static void loadDerivedProperties()
-