XML11Char.java revision 286
286N/A * reserved comment block 286N/A * DO NOT REMOVE OR ALTER! 286N/A * Copyright 1999-2004 The Apache Software Foundation. 286N/A * Licensed under the Apache License, Version 2.0 (the "License"); 286N/A * you may not use this file except in compliance with the License. 286N/A * You may obtain a copy of the License at 286N/A * Unless required by applicable law or agreed to in writing, software 286N/A * distributed under the License is distributed on an "AS IS" BASIS, 286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 286N/A * See the License for the specific language governing permissions and 286N/A * limitations under the License. 286N/A * This class defines the basic properties of characters in XML 1.1. The data 286N/A * in this class can be used to verify that a character is a valid 286N/A * XML 1.1 character or if the character is a space, name start, or name 286N/A * A series of convenience methods are supplied to ease the burden 286N/A * of the developer. Using the character as an index into the <code>XML11CHARS</code> 286N/A * array and applying the appropriate mask flag (e.g. 286N/A * <code>MASK_VALID</code>), yields the same results as calling the 286N/A * convenience methods. There is one exception: check the comments 286N/A * for the <code>isValid</code> method for details. 286N/A * @author Glenn Marcy, IBM 286N/A * @author Andy Clark, IBM 286N/A * @author Arnaud Le Hors, IBM 286N/A * @author Neil Graham, IBM 286N/A * @author Michael Glavassevich, IBM 286N/A /** Character flags for XML 1.1. */ 286N/A /** XML 1.1 Valid character mask. */ 286N/A /** XML 1.1 Space character mask. */ 286N/A /** XML 1.1 Name start character mask. */ 286N/A /** XML 1.1 Name character mask. */ 286N/A /** XML 1.1 control character mask */ 286N/A /** XML 1.1 content for external entities (valid - "special" chars - control chars) */ 286N/A /** XML namespaces 1.1 NCNameStart */ 286N/A /** XML namespaces 1.1 NCName */ 286N/A /** XML 1.1 content for internal entities (valid - "special" chars) */ 286N/A // Static initialization 286N/A // Initializing the Character Flag Array 286N/A // Code generated by: XML11CharGenerator. 286N/A // Public static methods 286N/A * Returns true if the specified character is a space character 286N/A * as amdended in the XML 1.1 specification. 286N/A * @param c The character to check. 286N/A }
// isXML11Space(int):boolean 286N/A * Returns true if the specified character is valid. This method 286N/A * also checks the surrogate character range from 0x10000 to 0x10FFFF. 286N/A * If the program chooses to apply the mask directly to the 286N/A * <code>XML11CHARS</code> array, then they are responsible for checking 286N/A * the surrogate character range. 286N/A * @param c The character to check. 286N/A || (
0x10000 <= c && c <=
0x10FFFF);
286N/A }
// isXML11Valid(int):boolean 286N/A * Returns true if the specified character is invalid. 286N/A * @param c The character to check. 286N/A }
// isXML11Invalid(int):boolean 286N/A * Returns true if the specified character is valid and permitted outside 286N/A * of a character reference. 286N/A * That is, this method will return false for the same set as 286N/A * isXML11Valid, except it also reports false for "control characters". 286N/A * @param c The character to check. 286N/A || (
0x10000 <= c && c <=
0x10FFFF));
286N/A }
// isXML11ValidLiteral(int):boolean 286N/A * Returns true if the specified character can be considered 286N/A * content in an external parsed entity. 286N/A * @param c The character to check. 286N/A (
0x10000 <= c && c <=
0x10FFFF);
286N/A }
// isXML11Content(int):boolean 286N/A * Returns true if the specified character can be considered 286N/A * content in an internal parsed entity. 286N/A * @param c The character to check. 286N/A (
0x10000 <= c && c <=
0x10FFFF);
286N/A }
// isXML11InternalEntityContent(int):boolean 286N/A * Returns true if the specified character is a valid name start 286N/A * character as defined by production [4] in the XML 1.1 286N/A * @param c The character to check. 286N/A || (
0x10000 <= c && c <
0xF0000);
286N/A }
// isXML11NameStart(int):boolean 286N/A * Returns true if the specified character is a valid name 286N/A * character as defined by production [4a] in the XML 1.1 286N/A * @param c The character to check. 286N/A || (c >=
0x10000 && c <
0xF0000);
286N/A }
// isXML11Name(int):boolean 286N/A * Returns true if the specified character is a valid NCName start 286N/A * character as defined by production [4] in Namespaces in XML 286N/A * @param c The character to check. 286N/A || (
0x10000 <= c && c <
0xF0000);
286N/A }
// isXML11NCNameStart(int):boolean 286N/A * Returns true if the specified character is a valid NCName 286N/A * character as defined by production [5] in Namespaces in XML 286N/A * @param c The character to check. 286N/A || (
0x10000 <= c && c <
0xF0000);
286N/A }
// isXML11NCName(int):boolean 286N/A * Returns whether the given character is a valid 286N/A * high surrogate for a name character. This includes 286N/A * all high surrogates for characters [0x10000-0xEFFFF]. 286N/A * In other words everything excluding planes 15 and 16. 286N/A * @param c The character to check. 286N/A return (
0xD800 <= c && c <=
0xDB7F);
286N/A * [5] Name ::= NameStartChar NameChar* 286N/A * Check to see if a string is a valid Name according to [5] 286N/A * in the XML 1.1 Recommendation 286N/A * @param name string to check 286N/A * @return true if name is a valid Name 286N/A }
// isXML11ValidName(String):boolean 286N/A * from the namespace 1.1 rec 286N/A * [4] NCName ::= NCNameStartChar NCNameChar* 286N/A * Check to see if a string is a valid NCName according to [4] 286N/A * from the XML Namespaces 1.1 Recommendation 286N/A * @param ncName string to check 286N/A * @return true if name is a valid NCName 286N/A }
// isXML11ValidNCName(String):boolean 286N/A * [7] Nmtoken ::= (NameChar)+ 286N/A * Check to see if a string is a valid Nmtoken according to [7] 286N/A * in the XML 1.1 Recommendation 286N/A * @param nmtoken string to check 286N/A * @return true if nmtoken is a valid Nmtoken 286N/A }
// isXML11ValidName(String):boolean