Package io.debezium.text
Class XmlCharacters
java.lang.Object
io.debezium.text.XmlCharacters
A utility class for determining the validity of various XML names, per the XML 1.0
Specification.
- Author:
- Randall Hauch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final char[]This implementation uses an array that captures for each character the XML classifications.private static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisValid(int c) Determine whether the supplied character is a valid character in XML.static booleanisValidContent(int c) Determine whether the supplied character is a valid character in XML contentstatic booleanisValidName(int c) Determine whether the supplied character is a valid non-first character in an XML Name.static booleanisValidName(String name) Determine if the supplied name is a valid XML Name.static booleanisValidNameStart(int c) Determine whether the supplied character is a valid first character in an XML Name.static booleanisValidNcName(int c) Determine whether the supplied character is a valid non-first character in an XML NCName.static booleanisValidNcName(String name) Determine if the supplied name is a valid XML NCName.static booleanisValidNcNameStart(int c) Determine whether the supplied character is a valid first character in an XML NCName.static booleanisValidPubid(int c) Determine whether the supplied character is a valid character in an XML Pubid.static booleanisValidSpace(int c) Determine whether the supplied character is a valid whitespace character in XML
-
Field Details
-
NUMBER_OF_CHARACTERS
private static final int NUMBER_OF_CHARACTERS- See Also:
-
MASKS
private static final char[] MASKSThis implementation uses an array that captures for each character the XML classifications. An array is used because it is a fast way of looking up each character. -
VALID_CHARACTER
private static final int VALID_CHARACTER- See Also:
-
CONTENT_CHARACTER
private static final int CONTENT_CHARACTER- See Also:
-
SPACE_CHARACTER
private static final int SPACE_CHARACTER- See Also:
-
NAME_START_CHARACTER
private static final int NAME_START_CHARACTER- See Also:
-
NAME_CHARACTER
private static final int NAME_CHARACTER- See Also:
-
NCNAME_START_CHARACTER
private static final int NCNAME_START_CHARACTER- See Also:
-
NCNAME_CHARACTER
private static final int NCNAME_CHARACTER- See Also:
-
PUBID_CHARACTER
private static final int PUBID_CHARACTER- See Also:
-
-
Constructor Details
-
XmlCharacters
private XmlCharacters()
-
-
Method Details
-
isValidNameStart
public static boolean isValidNameStart(int c) Determine whether the supplied character is a valid first character in an XML Name. The first character in an XML name is more restrictive than theremaining characters.- Parameters:
c- the character- Returns:
- true if the character is valid for an XML Name's first character
-
isValidNcNameStart
public static boolean isValidNcNameStart(int c) Determine whether the supplied character is a valid first character in an XML NCName. The first character in an XML NCName is more restrictive than theremaining characters.- Parameters:
c- the character- Returns:
- true if the character is valid for an XML NCName's first character
-
isValidName
public static boolean isValidName(int c) Determine whether the supplied character is a valid non-first character in an XML Name. Thefirst characterin an XML name is more restrictive than the remaining characters.- Parameters:
c- the character- Returns:
- true if the character is valid character in an XML Name
-
isValidNcName
public static boolean isValidNcName(int c) Determine whether the supplied character is a valid non-first character in an XML NCName. Thefirst characterin an XML NCName is more restrictive than the remaining characters.- Parameters:
c- the character- Returns:
- true if the character is valid character in an XML NCName
-
isValidPubid
public static boolean isValidPubid(int c) Determine whether the supplied character is a valid character in an XML Pubid.- Parameters:
c- the character- Returns:
- true if the character is valid character in an XML Pubid
-
isValid
public static boolean isValid(int c) Determine whether the supplied character is a valid character in XML.- Parameters:
c- the character- Returns:
- true if the character is valid character in XML
-
isValidContent
public static boolean isValidContent(int c) Determine whether the supplied character is a valid character in XML content- Parameters:
c- the character- Returns:
- true if the character is valid character in XML content
-
isValidSpace
public static boolean isValidSpace(int c) Determine whether the supplied character is a valid whitespace character in XML- Parameters:
c- the character- Returns:
- true if the character is valid whitespace character in XML
-
isValidName
Determine if the supplied name is a valid XML Name.- Parameters:
name- the string being checked- Returns:
- true if the supplied name is indeed a valid XML Name, or false otherwise
-
isValidNcName
Determine if the supplied name is a valid XML NCName.- Parameters:
name- the string being checked- Returns:
- true if the supplied name is indeed a valid XML NCName, or false otherwise
-