| java.lang.Object org.apache.xerces.readers.XMLDeclRecognizer
All known Subclasses: org.apache.xerces.readers.EBCDICRecognizer, org.apache.xerces.readers.UCSRecognizer, org.apache.xerces.readers.UTF8Recognizer,
XMLDeclRecognizer | abstract public class XMLDeclRecognizer (Code) | | 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.
|
Method Summary | |
protected int | prescanXMLDeclOrTextDecl(XMLEntityHandler.EntityReader entityReader, boolean xmlDecl) 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.
Parameters: entityReader - data source for prescan Parameters: xmlDecl - true if attempting to recognize from an XMLDecl, false if trying to recognize from a TextDecl. | abstract public XMLEntityHandler.EntityReader | recognize(XMLEntityReaderFactory readerFactory, XMLEntityHandler entityHandler, XMLErrorReporter errorReporter, boolean sendCharDataAsCharArray, StringPool stringPool, ChunkyByteArray data, boolean xmlDecl, boolean allowJavaEncodingName) Subclasses override this method to support recognizing their encodings.
Parameters: readerFactory - the factory object to use when constructing the entity reader. Parameters: entityHandler - the entity handler to get entity readers from Parameters: errorReporter - where to report errors Parameters: sendCharDataAsCharArray - true if the reader should use char arrays, not string handles. Parameters: stringPool - the StringPool to put strings in Parameters: data - initial bytes to perform recognition on Parameters: xmlDecl - true if attempting to recognize fron an XMLDecl, false if trying to recognize from a TextDecl. Parameters: allowJavaEncodingName - true if Java's encoding names are allowed, false if they are not. | public static void | registerDefaultRecognizers(Stack recognizerStack) Register the standard recognizers. |
prescanXMLDeclOrTextDecl | protected int prescanXMLDeclOrTextDecl(XMLEntityHandler.EntityReader entityReader, boolean xmlDecl) throws Exception(Code) | | 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.
Parameters: entityReader - data source for prescan Parameters: xmlDecl - true if attempting to recognize from an XMLDecl, false if trying to recognize from a TextDecl. StringPool handle to the name of the encoding recognized exception: java.lang.Exception - |
recognize | abstract public XMLEntityHandler.EntityReader recognize(XMLEntityReaderFactory readerFactory, XMLEntityHandler entityHandler, XMLErrorReporter errorReporter, boolean sendCharDataAsCharArray, StringPool stringPool, ChunkyByteArray data, boolean xmlDecl, boolean allowJavaEncodingName) throws Exception(Code) | | Subclasses override this method to support recognizing their encodings.
Parameters: readerFactory - the factory object to use when constructing the entity reader. Parameters: entityHandler - the entity handler to get entity readers from Parameters: errorReporter - where to report errors Parameters: sendCharDataAsCharArray - true if the reader should use char arrays, not string handles. Parameters: stringPool - the StringPool to put strings in Parameters: data - initial bytes to perform recognition on Parameters: xmlDecl - true if attempting to recognize fron an XMLDecl, false if trying to recognize from a TextDecl. Parameters: allowJavaEncodingName - true if Java's encoding names are allowed, false if they are not. The reader that will be used to process the contents of the data stream. exception: java.lang.Exception - |
registerDefaultRecognizers | public static void registerDefaultRecognizers(Stack recognizerStack)(Code) | | Register the standard recognizers.
Parameters: recognizerStack - The stack of recognizers used by the parser. |
|
|