java.lang.Object
org.apache.xerces.readers.XMLDeclRecognizer
- Direct Known Subclasses:
- EBCDICRecognizer, UCSRecognizer, UTF8Recognizer
- public abstract class XMLDeclRecognizer
- extends java.lang.Object
Abstract base class for encoding recognizers.
When we encounter an external entity, including the document entity,
and do not know what the encoding of the underlying byte stream is,
we need to look at the contents of the stream to find out. We do this
by asking a set of "recognizers" to look at the stream data and if
the recognizer can understand the encoding it will try to read an
XML or text declaration, if present, and construct the appropriate
reader for that encoding. The recognizer subclasses will typically
use the prescanXMLDeclOrTextDecl() method if the stream looks like
it does begin with such a declaration using a temporary reader that
can support the calls needed to scan through the encoding declaration.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
xml_string
private static final char[] xml_string
version_string
private static final char[] version_string
encoding_string
private static final char[] encoding_string
XMLDeclRecognizer
public XMLDeclRecognizer()
registerDefaultRecognizers
public static void registerDefaultRecognizers(java.util.Stack recognizerStack)
- Register the standard recognizers.
recognize
public abstract XMLEntityHandler.EntityReader recognize(XMLEntityReaderFactory readerFactory,
XMLEntityHandler entityHandler,
org.apache.xerces.framework.XMLErrorReporter errorReporter,
boolean sendCharDataAsCharArray,
org.apache.xerces.utils.StringPool stringPool,
org.apache.xerces.utils.ChunkyByteArray data,
boolean xmlDecl,
boolean allowJavaEncodingName)
throws java.lang.Exception
- Subclasses override this method to support recognizing their encodings.
prescanXMLDeclOrTextDecl
protected int prescanXMLDeclOrTextDecl(XMLEntityHandler.EntityReader entityReader,
boolean xmlDecl)
throws java.lang.Exception
- Support for getting the value of an EncodingDecl using an XMLReader.
This is the minimal logic from the scanner to recognize an XMLDecl or TextDecl using
the XMLReader interface.