Top Description Fields Constructors Methods
com.sun.org.apache.xerces.internal.impl

public Class XMLVersionDetector

extends Object
Class Inheritance
Imports
java.io.CharConversionException, .EOFException, .IOException, com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException, com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter, com.sun.org.apache.xerces.internal.util.SymbolTable, com.sun.org.apache.xerces.internal.xni.XMLString, com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager, .XMLConfigurationException, .XMLInputSource, com.sun.xml.internal.stream.Entity.ScannedEntity

This class scans the version of the document to determine which scanner to use: XML 1.1 or XML 1.0. The version is scanned using XML 1.1. scanner.
Authors
Neil Graham, IBM, Elena Litani, IBM

Field Summary

Modifier and TypeField and Description
protected static final String
ENTITY_MANAGER

Property identifier: entity manager.

protected static final String
ERROR_REPORTER

Property identifier: error reporter.

protected String
protected XMLEntityManager
fEntityManager

Entity manager.

protected XMLErrorReporter
fErrorReporter

Error reporter.

private final char[]
protected SymbolTable
fSymbolTable

Symbol table.

private XMLString
protected static final String
fVersionSymbol

Symbol: "version".

protected static final String
protected static final String
SYMBOL_TABLE

Property identifier: symbol table.

private static final char[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public short

Returns:

short - Constants.XML_VERSION_1_1 if document version 1.1, otherwise Constants.XML_VERSION_1_0
determineDocVersion
(XMLInputSource inputSource)

This methods scans the XML declaration to find out the version (and provisional encoding) of the document.

private void
fixupCurrentEntity(XMLEntityManager manager, char[] scannedChars, int length)

public void
reset(XMLComponentManager
The component manager.
componentManager
)

public void
startDocumentParsing(XMLEntityHandler
- the scanner to use
scanner
,
short
- the version of the document (XML 1.1 or XML 1.0).
version
)

Reset the reference to the appropriate scanner given the version of the document and start document scanning.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ENTITY_MANAGERback to summary
protected static final String ENTITY_MANAGER

Property identifier: entity manager.

ERROR_REPORTERback to summary
protected static final String ERROR_REPORTER

Property identifier: error reporter.

fEncodingback to summary
protected String fEncoding
fEntityManagerback to summary
protected XMLEntityManager fEntityManager

Entity manager.

fErrorReporterback to summary
protected XMLErrorReporter fErrorReporter

Error reporter.

fExpectedVersionStringback to summary
private final char[] fExpectedVersionString
fSymbolTableback to summary
protected SymbolTable fSymbolTable

Symbol table.

fVersionNumback to summary
private XMLString fVersionNum
fVersionSymbolback to summary
protected static final String fVersionSymbol

Symbol: "version".

fXMLSymbolback to summary
protected static final String fXMLSymbol
SYMBOL_TABLEback to summary
protected static final String SYMBOL_TABLE

Property identifier: symbol table.

XML11_VERSIONback to summary
private static final char[] XML11_VERSION

Constructor Detail

XMLVersionDetectorback to summary
public XMLVersionDetector()

Method Detail

determineDocVersionback to summary
public short determineDocVersion(XMLInputSource inputSource) throws IOException

This methods scans the XML declaration to find out the version (and provisional encoding) of the document. The scanning is doing using XML 1.1 scanner.

Returns:short

short - Constants.XML_VERSION_1_1 if document version 1.1, otherwise Constants.XML_VERSION_1_0

fixupCurrentEntityback to summary
private void fixupCurrentEntity(XMLEntityManager manager, char[] scannedChars, int length)
resetback to summary
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException
Parameters
componentManager:XMLComponentManager

The component manager.

Exceptions
SAXException:
Throws exception if required features and properties cannot be found.
startDocumentParsingback to summary
public void startDocumentParsing(XMLEntityHandler scanner, short version)

Reset the reference to the appropriate scanner given the version of the document and start document scanning.

Parameters
scanner:XMLEntityHandler

- the scanner to use

version:short

- the version of the document (XML 1.1 or XML 1.0).