public class XMLEntityReaderImpl extends XMLEntityReader
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
ALLOW_JAVA_ENCODINGS
Feature identifier: allow Java encodings.
|
protected static java.lang.String |
ERROR_REPORTER
Property identifier: error reporter.
|
protected boolean |
fAllowJavaEncodings
Allow Java encoding names.
|
protected Entity.ScannedEntity |
fCurrentEntity |
protected XMLEntityManager |
fEntityManager |
protected XMLErrorReporter |
fErrorReporter |
protected PropertyManager |
fPropertyManager |
protected org.apache.xerces.util.SymbolTable |
fSymbolTable |
protected static java.lang.String |
SYMBOL_TABLE
Property identifier: symbol table.
|
static boolean[] |
validContent |
static boolean[] |
validNames |
Constructor and Description |
---|
XMLEntityReaderImpl(PropertyManager propertyManager,
XMLEntityManager entityManager)
private constructor, this class can only be instantiated within this class.
|
XMLEntityReaderImpl(XMLEntityManager entityManager)
private constructor, this class can only be instantiated within this class.
|
Modifier and Type | Method and Description |
---|---|
boolean |
arrangeCapacity(int length) |
boolean |
arrangeCapacity(int length,
boolean changeEntity) |
protected java.io.Reader |
createReader(java.io.InputStream inputStream,
java.lang.String encoding,
java.lang.Boolean isBigEndian)
Creates a reader capable of reading the given input stream in
the specified encoding.
|
java.lang.String |
getBaseSystemId()
Returns the base system identifier of the currently scanned
entity, or null if none is available.
|
int |
getChar(int relative) |
int |
getCharacterOffset() |
int |
getColumnNumber()
Returns the column number.
|
Entity.ScannedEntity |
getCurrentEntity() |
java.lang.String |
getEncoding() |
protected java.lang.Object[] |
getEncodingName(byte[] b4,
int count)
Returns the IANA encoding name that is auto-detected from
the bytes specified, with the endian-ness of that encoding where appropriate.
|
java.lang.String |
getExpandedSystemId()
Returns the expanded system identifier.
|
int |
getLineNumber()
Returns the line number.
|
java.lang.String |
getLiteralSystemId()
Returns the literal system identifier.
|
java.lang.String |
getPublicId()
Returns the public identifier.
|
java.lang.String |
getVersion()
get the version of the entity on which reader is operating
|
boolean |
isExternal()
Returns true if the current entity being scanned is external.
|
boolean |
isSpace(char ch) |
int |
peekChar()
Returns the next character on the input.
|
void |
registerListener(XMLBufferListener listener)
Registers the listener object and provides callback.
|
void |
reset(PropertyManager propertyManager)
Resets the components.
|
void |
reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
Resets the component.
|
int |
scanChar()
Returns the next character on the input.
|
int |
scanContent(org.apache.xerces.xni.XMLString content)
CHANGED:
Scans a range of parsed character data, This function appends the character data to
the supplied buffer.
|
boolean |
scanData(java.lang.String delimiter,
org.apache.xerces.util.XMLStringBuffer buffer)
Scans a range of character data up to the specified delimiter,
setting the fields of the XMLString structure, appropriately.
|
int |
scanLiteral(int quote,
org.apache.xerces.xni.XMLString content)
Scans a range of attribute value data, setting the fields of the
XMLString structure, appropriately.
|
java.lang.String |
scanName()
Returns a string matching the Name production appearing immediately
on the input as a symbol, or null if no Name string is present.
|
java.lang.String |
scanNmtoken()
Returns a string matching the NMTOKEN production appearing immediately
on the input as a symbol, or null if NMTOKEN Name string is present.
|
boolean |
scanQName(org.apache.xerces.xni.QName qname)
Scans a qualified name from the input, setting the fields of the
QName structure appropriately.
|
void |
setCurrentEntity(Entity.ScannedEntity scannedEntity)
set the instance of current scanned entity.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding of the scanner.
|
void |
setVersion(java.lang.String version)
the version of the current entity being scanned
|
boolean |
skipChar(int c)
Skips a character appearing immediately on the input.
|
boolean |
skipSpaces()
Skips space characters appearing immediately on the input.
|
boolean |
skipString(char[] s) |
boolean |
skipString(java.lang.String s)
Skips the specified string appearing immediately on the input.
|
protected Entity.ScannedEntity fCurrentEntity
protected XMLEntityManager fEntityManager
public static final boolean[] validContent
public static final boolean[] validNames
protected org.apache.xerces.util.SymbolTable fSymbolTable
protected XMLErrorReporter fErrorReporter
protected boolean fAllowJavaEncodings
protected static final java.lang.String SYMBOL_TABLE
protected static final java.lang.String ERROR_REPORTER
protected static final java.lang.String ALLOW_JAVA_ENCODINGS
protected PropertyManager fPropertyManager
public XMLEntityReaderImpl(XMLEntityManager entityManager)
getEntityScanner()
,
getEntityScanner(ScannedEntity)
public XMLEntityReaderImpl(PropertyManager propertyManager, XMLEntityManager entityManager)
getEntityScanner()
,
getEntityScanner(ScannedEntity)
public void reset(PropertyManager propertyManager)
public void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager) throws org.apache.xerces.xni.parser.XMLConfigurationException
componentManager
- The component manager.SAXException
- Thrown by component on initialization error.
For example, if a feature or property is
required for the operation of the component, the
component manager may throw a
SAXNotRecognizedException or a
SAXNotSupportedException.org.apache.xerces.xni.parser.XMLConfigurationException
public void setCurrentEntity(Entity.ScannedEntity scannedEntity)
ScannedEntity
- public Entity.ScannedEntity getCurrentEntity()
public java.lang.String getBaseSystemId()
public int getLineNumber()
org.apache.xerces.xni.XMLLocator
public int getColumnNumber()
org.apache.xerces.xni.XMLLocator
public int getCharacterOffset()
getCharacterOffset
in interface org.apache.xerces.xni.XMLLocator
getCharacterOffset
in class XMLEntityReader
public java.lang.String getExpandedSystemId()
public java.lang.String getLiteralSystemId()
public java.lang.String getPublicId()
public void setVersion(java.lang.String version)
setVersion
in class XMLEntityReader
public java.lang.String getVersion()
XMLEntityReader
getVersion
in class XMLEntityReader
public java.lang.String getEncoding()
getEncoding
in interface org.apache.xerces.xni.XMLLocator
getEncoding
in class XMLEntityReader
public void setEncoding(java.lang.String encoding) throws java.io.IOException
Note: The underlying character reader on the current entity will be changed to accomodate the new encoding. However, the new encoding is ignored if the current reader was not constructed from an input stream (e.g. an external entity that is resolved directly to the appropriate java.io.Reader object).
setEncoding
in class XMLEntityReader
encoding
- The IANA encoding name of the new encoding.java.io.IOException
- Thrown if the new encoding is not supported.EncodingMap
public boolean isExternal()
isExternal
in class XMLEntityReader
public int getChar(int relative) throws java.io.IOException
java.io.IOException
public int peekChar() throws java.io.IOException
Note: The character is not consumed.
peekChar
in class XMLEntityReader
java.io.IOException
- Thrown if i/o error occurs.EOFException
- Thrown on end of file.public int scanChar() throws java.io.IOException
Note: The character is consumed.
scanChar
in class XMLEntityReader
java.io.IOException
- Thrown if i/o error occurs.EOFException
- Thrown on end of file.public java.lang.String scanNmtoken() throws java.io.IOException
Note: The NMTOKEN characters are consumed.
Note: The string returned must be a symbol. The SymbolTable can be used for this purpose.
scanNmtoken
in class XMLEntityReader
java.io.IOException
- Thrown if i/o error occurs.EOFException
- Thrown on end of file.SymbolTable
,
XMLChar.isName(int)
public java.lang.String scanName() throws java.io.IOException
Note: The Name characters are consumed.
Note: The string returned must be a symbol. The SymbolTable can be used for this purpose.
scanName
in class XMLEntityReader
java.io.IOException
- Thrown if i/o error occurs.EOFException
- Thrown on end of file.SymbolTable
,
XMLChar.isName(int)
,
XMLChar.isNameStart(int)
public boolean scanQName(org.apache.xerces.xni.QName qname) throws java.io.IOException
Note: The qualified name characters are consumed.
Note: The strings used to set the values of the QName structure must be symbols. The SymbolTable can be used for this purpose.
scanQName
in class XMLEntityReader
qname
- The qualified name structure to fill.java.io.IOException
- Thrown if i/o error occurs.EOFException
- Thrown on end of file.SymbolTable
,
XMLChar.isName(int)
,
XMLChar.isNameStart(int)
public int scanContent(org.apache.xerces.xni.XMLString content) throws java.io.IOException
Note: The characters are consumed.
Note: This method does not guarantee to return the longest run of parsed character data. This method may return before markup due to reaching the end of the input buffer or any other reason.
scanContent
in class XMLEntityReader
content
- The content structure to fill.java.io.IOException
- Thrown if i/o error occurs.EOFException
- Thrown on end of file.public int scanLiteral(int quote, org.apache.xerces.xni.XMLString content) throws java.io.IOException
Note: The characters are consumed.
Note: This method does not guarantee to return the longest run of attribute value data. This method may return before the quote character due to reaching the end of the input buffer or any other reason.
Note: The fields contained in the XMLString structure are not guaranteed to remain valid upon subsequent calls to the entity scanner. Therefore, the caller is responsible for immediately using the returned character data or making a copy of the character data.
scanLiteral
in class XMLEntityReader
quote
- The quote character that signifies the end of the
attribute value data.content
- The content structure to fill.java.io.IOException
- Thrown if i/o error occurs.EOFException
- Thrown on end of file.public boolean scanData(java.lang.String delimiter, org.apache.xerces.util.XMLStringBuffer buffer) throws java.io.IOException
Note: The characters are consumed.
Note: This assumes that the length of the delimiter and that the delimiter contains at least one character.
Note: This method does not guarantee to return the longest run of character data. This method may return before the delimiter due to reaching the end of the input buffer or any other reason.
scanData
in class XMLEntityReader
delimiter
- The string that signifies the end of the character
data to be scanned.data
- The data structure to fill. Data will be appendd to the current buffer.java.io.IOException
- Thrown if i/o error occurs.EOFException
- Thrown on end of file.public boolean skipChar(int c) throws java.io.IOException
Note: The character is consumed only if it matches the specified character.
skipChar
in class XMLEntityReader
c
- The character to skip.java.io.IOException
- Thrown if i/o error occurs.EOFException
- Thrown on end of file.public boolean isSpace(char ch)
public boolean skipSpaces() throws java.io.IOException
Note: The characters are consumed only if they are space characters.
skipSpaces
in class XMLEntityReader
java.io.IOException
- Thrown if i/o error occurs.EOFException
- Thrown on end of file.XMLChar.isSpace(int)
public boolean arrangeCapacity(int length) throws java.io.IOException
legnth
- This function checks that following number of characters are available.
to the underlying buffer.java.io.IOException
public boolean arrangeCapacity(int length, boolean changeEntity) throws java.io.IOException
legnth
- This function checks that following number of characters are available.
to the underlying buffer.if
- the underlying function should change the entityjava.io.IOException
public boolean skipString(java.lang.String s) throws java.io.IOException
Note: The characters are consumed only if all the characters are skipped.
skipString
in class XMLEntityReader
s
- The string to skip.java.io.IOException
- Thrown if i/o error occurs.EOFException
- Thrown on end of file.public boolean skipString(char[] s) throws java.io.IOException
java.io.IOException
protected java.io.Reader createReader(java.io.InputStream inputStream, java.lang.String encoding, java.lang.Boolean isBigEndian) throws java.io.IOException
inputStream
- The input stream.encoding
- The encoding name that the input stream is
encoded using. If the user has specified that
Java encoding names are allowed, then the
encoding name may be a Java encoding name;
otherwise, it is an ianaEncoding name.isBigEndian
- For encodings (like uCS-4), whose names cannot
specify a byte order, this tells whether the order is bigEndian. null menas
unknown or not relevant.java.io.IOException
protected java.lang.Object[] getEncodingName(byte[] b4, int count)
b4
- The first four bytes of the input.count
- The number of bytes actually read.public void registerListener(XMLBufferListener listener)
registerListener
in class XMLEntityReader
listener
- listener to which call back should be provided when scanner buffer
is being changed.Copyright ? 2002-2003 Apache XML Project. All Rights Reserved.