Class XMLChar
java.lang.Object
org.eclipse.lemminx.extensions.generators.XMLChar
This class is a copy/paste from some methods of Xerces
org.apache.xerces.util.XMLChar.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intContent character mask.static final intName character mask.static final intName start character mask.static final intNCName character mask.static final intNCName start character mask.static final intPubid character mask.static final intSpace character mask.static final intValid character mask. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisName(int c) Returns true if the specified character is a valid name character as defined by production [4] in the XML 1.0 specification.static booleanisNameStart(int c) Returns true if the specified character is a valid name start character as defined by production [5] in the XML 1.0 specification.static booleanisValidName(String name) Check to see if a string is a valid Name according to [5] in the XML 1.0 Recommendationstatic booleanisValidNmtoken(String nmtoken) Check to see if a string is a valid Nmtoken according to [7] in the XML 1.0 Recommendation
-
Field Details
-
MASK_VALID
public static final int MASK_VALIDValid character mask.- See Also:
-
MASK_SPACE
public static final int MASK_SPACESpace character mask.- See Also:
-
MASK_NAME_START
public static final int MASK_NAME_STARTName start character mask.- See Also:
-
MASK_NAME
public static final int MASK_NAMEName character mask.- See Also:
-
MASK_PUBID
public static final int MASK_PUBIDPubid character mask.- See Also:
-
MASK_CONTENT
public static final int MASK_CONTENTContent character mask. Special characters are those that can be considered the start of markup, such as '<' and '&'. The various newline characters are considered special as well. All other valid XML characters can be considered content.This is an optimization for the inner loop of character scanning.
- See Also:
-
MASK_NCNAME_START
public static final int MASK_NCNAME_STARTNCName start character mask.- See Also:
-
MASK_NCNAME
public static final int MASK_NCNAMENCName character mask.- See Also:
-
-
Constructor Details
-
XMLChar
public XMLChar()
-
-
Method Details
-
isValidNmtoken
Check to see if a string is a valid Nmtoken according to [7] in the XML 1.0 Recommendation- Parameters:
nmtoken- string to check- Returns:
- true if nmtoken is a valid Nmtoken
-
isValidName
Check to see if a string is a valid Name according to [5] in the XML 1.0 Recommendation- Parameters:
name- string to check- Returns:
- true if name is a valid Name
-
isNameStart
public static boolean isNameStart(int c) Returns true if the specified character is a valid name start character as defined by production [5] in the XML 1.0 specification.- Parameters:
c- The character to check.
-
isName
public static boolean isName(int c) Returns true if the specified character is a valid name character as defined by production [4] in the XML 1.0 specification.- Parameters:
c- The character to check.
-