Package com.networknt.schema.utils
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 String
private static final int
private static final BiPredicate
<String, Integer> private static final BitSet
private static final BitSet
private static final BitSet
private static final int
private static final int
private static final int
private static final BiPredicate
<String, Integer> private static final int
private static final BiPredicate
<String, Integer> private static final int
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 BiPredicate
<String, Integer> private static final BitSet
private static final int
private static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
private static boolean
isCombiningMark
(int codepoint) private static boolean
isContextJ
(int codepoint) private static boolean
isContextO
(int codepoint) private static boolean
isDisallowed
(int codepoint) private static boolean
isUnassigned
(int codepoint) static boolean
private static void
private static boolean
testAllowedCharacter
(String s, int i) private static boolean
testArabicIndicDigit
(String s, int i) private static boolean
testeMiddleDotRule
(String s, int i) Determines whether the MIDDLE DOT conforms to the RFC 5892 specification.private static boolean
testExtendedArabicIndicDigit
(String s, int i) private static boolean
testGreekLowerNumeralSign
(String s, int i) Determines whether the GREEK LOWER NUMERAL SIGN (KERAIA) conforms to the RFC 5892 specification.private static boolean
testHebrewPuncuation
(String s, int i) Determines whether the HEBREW PUNCTUATION (GERESH or GERSHAYIM) conforms to the RFC 5892 specification.private static boolean
testKatakanaMiddleDot
(String s, int i) Determines whether the KATAKANA MIDDLE DOT conforms to the RFC 5892 specification.private static boolean
private static boolean
private static boolean
testZeroWidthJoiner
(String s, int i) Determines whether the ZERO WIDTH JOINER conforms to the RFC 5892 specification.private static boolean
testZeroWidthNonJoiner
(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:
true
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if 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()
-