public class XMLUtilities extends XMLCharacters
Modifier and Type | Field and Description |
---|---|
static int |
IS_XML_10_NAME |
static int |
IS_XML_10_QNAME |
ALPHABETIC_CHARACTER, NAME_CHARACTER, NAME_FIRST_CHARACTER, NAME11_CHARACTER, NAME11_FIRST_CHARACTER, PUBLIC_ID_CHARACTER, VERSION_CHARACTER, XML_CHARACTER
Modifier | Constructor and Description |
---|---|
protected |
XMLUtilities()
This class does not need to be instantiated.
|
Modifier and Type | Method and Description |
---|---|
protected static java.io.Reader |
createXMLDeclarationReader(java.io.PushbackInputStream pbis,
java.lang.String enc)
Creates a reader from the given input stream and encoding.
|
static java.io.Reader |
createXMLDocumentReader(java.io.InputStream is)
Creates a Reader initialized to scan the characters in the given
XML document's InputStream.
|
static java.lang.String |
encodingToJavaEncoding(java.lang.String e,
java.lang.String de)
Converts the given standard encoding representation to the
corresponding Java encoding string.
|
protected static java.lang.String |
getXMLDeclarationEncoding(java.io.Reader r,
java.lang.String e)
Reads an XML declaration to get the encoding declaration value.
|
static boolean |
isXML11Character(int c)
Tests whether the given 32 bit character is a valid XML 1.1 character.
|
static boolean |
isXML11NameCharacter(char c)
Tests whether the given character is a valid XML 1.1 name character.
|
static boolean |
isXML11NameFirstCharacter(char c)
Tests whether the given character is usable as the
first character of an XML 1.1 name.
|
static boolean |
isXMLAlphabeticCharacter(char c)
Tests whether the given character is a valid aphabetic character.
|
static boolean |
isXMLCharacter(int c)
Tests whether the given 32 bits character is valid in XML documents.
|
static boolean |
isXMLNameCharacter(char c)
Tests whether the given character is a valid XML name character.
|
static boolean |
isXMLNameFirstCharacter(char c)
Tests whether the given character is usable as the
first character of an XML name.
|
static boolean |
isXMLPublicIdCharacter(char c)
Tests whether the given character is a valid XML public ID character.
|
static boolean |
isXMLSpace(char c)
Tests whether the given character is a valid space.
|
static boolean |
isXMLVersionCharacter(char c)
Tests whether the given character is a valid XML version character.
|
static int |
testXMLQName(java.lang.String s)
Test whether the given string is an XML 1.0 Name and/or QName.
|
public static final int IS_XML_10_NAME
public static final int IS_XML_10_QNAME
protected XMLUtilities()
public static boolean isXMLSpace(char c)
public static boolean isXMLNameFirstCharacter(char c)
public static boolean isXML11NameFirstCharacter(char c)
public static boolean isXMLNameCharacter(char c)
public static boolean isXML11NameCharacter(char c)
public static boolean isXMLCharacter(int c)
public static boolean isXML11Character(int c)
public static boolean isXMLPublicIdCharacter(char c)
public static boolean isXMLVersionCharacter(char c)
public static boolean isXMLAlphabeticCharacter(char c)
public static int testXMLQName(java.lang.String s)
IS_XML_10_NAME
and
IS_XML_10_QNAME
.public static java.io.Reader createXMLDocumentReader(java.io.InputStream is) throws java.io.IOException
is
- The input stream positionned at the beginning of an
XML document.java.io.IOException
protected static java.io.Reader createXMLDeclarationReader(java.io.PushbackInputStream pbis, java.lang.String enc) throws java.io.IOException
java.io.IOException
protected static java.lang.String getXMLDeclarationEncoding(java.io.Reader r, java.lang.String e) throws java.io.IOException
r
- a reader positioned just after '<?xm'.e
- the encoding to return by default or on error.java.io.IOException
public static java.lang.String encodingToJavaEncoding(java.lang.String e, java.lang.String de)
e
- the encoding string to convert.de
- the encoding string if no corresponding encoding was found.Copyright © 2022 Apache Software Foundation. All Rights Reserved.