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

public Class XMLEntityScanner

extends Object
implements XMLLocator
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xerces.internal.xni.XMLLocator
Known Direct Subclasses
com.sun.org.apache.xerces.internal.impl.XML11EntityScanner
Static Imports
com.sun.org.apache.xerces.internal.impl.Constants.XML_VERSION_1_0, .Constants.XML_VERSION_1_1

Implements the entity scanner methods.
Authors
Neeraj Bajaj, Sun Microsystems, Andy Clark, IBM, Arnaud Le Hors, IBM, K.Venugopal Sun Microsystems

Field Summary

Modifier and TypeField and Description
protected static final String
ALLOW_JAVA_ENCODINGS

Feature identifier: allow Java encodings.

pack-priv boolean
private static final boolean
DEBUG_BUFFER

Debug printing of buffer.

private static final boolean
DEBUG_ENCODINGS

Debug switching readers for encodings.

private static final boolean
pack-priv boolean
private static final EOFException
END_OF_DOCUMENT_ENTITY

To signal the end of the document entity, this exception will be thrown.

protected static final String
ERROR_REPORTER

Property identifier: error reporter.

protected boolean
fAllowJavaEncodings

Allow Java encoding names.

protected int
protected Entity.ScannedEntity
protected XMLEntityManager
protected XMLErrorReporter
protected XMLLimitAnalyzer
fLimitAnalyzer

Limit analyzer.

protected PropertyManager
protected XMLSecurityManager
fSecurityManager

Security manager.

protected SymbolTable
pack-priv boolean
private ArrayList<XMLBufferListener>
listeners

Listeners which should know when load is being called

pack-priv int
pack-priv int
protected static final String
SYMBOL_TABLE

Property identifier: symbol table.

private static final boolean[]
pack-priv boolean
pack-priv int
pack-priv int[]
protected boolean

Constructor Summary

AccessConstructor and Description
public
XMLEntityScanner()

Default constructor.

public
XMLEntityScanner(PropertyManager propertyManager, XMLEntityManager entityManager)

private constructor, this class can only be instantiated within this class.

Method Summary

Modifier and TypeMethod and Description
public boolean
arrangeCapacity(int
This function checks that following number of characters are available. to the underlying buffer.
length
)

Returns: This function returns true if capacity asked is available.

public boolean
arrangeCapacity(int
This function checks that following number of characters are available. to the underlying buffer.
length
,
boolean
a flag to indicate that the underlying function should change the entity
changeEntity
)

Returns: This function returns true if capacity asked is available.

protected int

Returns:

the length of characters scanned before the end of the buffer, zero if there is more to be read in the buffer
checkBeforeLoad
(Entity.ScannedEntity
the current entity
entity
,
int
the offset from which the current read was started
offset
,
int
the offset from which the current name starts
nameOffset
)

Checks whether the end of the entity buffer has been reached.

protected void
checkEntityLimit(XMLScanner.NameType
type of name (element, attribute or entity)
nt
,
Entity.ScannedEntity
The current entity
entity
,
int
The index of the first byte
offset
,
int
The length of the entity scanned
length
)

If the current entity is an Entity reference, check the accumulated size against the limit.

protected void
checkLimit(XMLSecurityManager.Limit
The Limit to be checked
limit
,
Entity.ScannedEntity
The current entity
entity
,
int
The index of the first byte
offset
,
int
The length of the entity scanned
length
)

Checks whether the value of the specified Limit exceeds its limit

protected void
checkNodeCount(Entity.ScannedEntity
The current entity
entity
)

If the current entity is an Entity reference, counts the total nodes in the entity and checks the accumulated value against the limit.

protected Reader

Returns:

Returns a reader.
createReader
(InputStream
The input stream.
inputStream
,
String
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.
encoding
,
Boolean
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.
isBigEndian
)

Creates a reader capable of reading the given input stream in the specified encoding.

public final String
getBaseSystemId()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getBaseSystemId.

Returns the base system identifier of the currently scanned entity, or null if none is available.

public int
getChar(int relative)

public final int
getCharacterOffset()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getCharacterOffset.

Returns the character offset, or -1 if no character offset is available.

public final int
getColumnNumber()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getColumnNumber.

Returns the column number, or -1 if no column number is available.

public Entity.ScannedEntity
public final String
getEncoding()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getEncoding.

Returns the encoding of the current entity.

protected Object[]

Returns:

a 2-element array: the first element, an IANA-encoding string, the second element a Boolean which is true iff the document is big endian, false if it's little-endian, and null if the distinction isn't relevant.
getEncodingName
(byte[]
The first four bytes of the input.
b4
,
int
The number of bytes actually read.
count
)

Returns the IANA encoding name that is auto-detected from the bytes specified, with the endian-ness of that encoding where appropriate.

public final String
public final int
getLineNumber()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getLineNumber.

Returns the line number, or -1 if no line number is available.

public final String
public final String
public String
public final String
getXMLVersion()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getXMLVersion.

Returns the XML version of the current entity.

public void
invokeListeners(int
Starting position from which new data is being loaded into scanner buffer.
loadPos
)

public final boolean
isExternal()

Returns true if the current entity being scanned is external.

public boolean
isSpace(char ch)

pack-priv final boolean

Returns:

Returns true if the entity changed as a result of this load operation.
load
(int
The offset into the character buffer to read the next batch of characters.
offset
,
boolean
True if the load should change entities at the end of the entity, otherwise leave the current entity in place and the entity boundary will be signaled by the return value.
changeEntity
,
boolean
Determine whether to notify listeners of the event
notify
)

Loads a chunk of text.

protected boolean

Returns:

true if the cursor is at the end of the current entity, false otherwise.
normalizeNewlines
(short version, XMLString
the current content buffer
buffer
,
boolean
a flag indicating whether to append to the buffer
append
,
boolean
a flag indicating whether the whitespaces need to be stored for later processing
storeWS
,
XMLScanner.NameType
the type of the entity
nt
)

Normalizes newlines.

public int
peekChar()

Returns the next character on the input.

public void
registerListener(XMLBufferListener
listener to which call back should be provided when scanner buffer is being changed.
listener
)

Registers the listener object and provides callback.

public void
reset(PropertyManager propertyManager)

Resets the components.

public void
reset(XMLComponentManager
The component manager.
componentManager
)

Resets the component.

public final void
reset(SymbolTable symbolTable, XMLEntityManager entityManager, XMLErrorReporter reporter)

private void
protected int
scanChar(XMLScanner.NameType
The type of the name (element or attribute)
nt
)

Returns the next character on the input.

protected int

Returns:

Returns the next character on the input, if known. This value may be -1 but this does note designate end of file.
scanContent
(XMLString
The content structure to fill.
content
)

CHANGED: Scans a range of parsed character data, This function appends the character data to the supplied buffer.

protected boolean

Returns:

Returns true if there is more data to scan, false otherwise.
scanData
(String
The string that signifies the end of the character data to be scanned.
delimiter
,
XMLStringBuffer
The XMLStringBuffer to fill.
buffer
,
int
the size limit of the data to be scanned. Zero by default indicating no limit.
chunkLimit
)

Scans a range of character data up to the specified delimiter, setting the fields of the XMLString structure, appropriately.

protected int

Returns:

Returns the next character on the input, if known. This value may be -1 but this does note designate end of file.
scanLiteral
(int
The quote character that signifies the end of the attribute value data.
quote
,
XMLString
The content structure to fill.
content
,
boolean
a flag indicating whether the content is a Namespace URI
isNSURI
)

Scans a range of attribute value data, setting the fields of the XMLString structure, appropriately.

protected String
scanName(XMLScanner.NameType
The type of the name (element or attribute)
nt
)

Returns a string matching the Name production appearing immediately on the input as a symbol, or null if no Name string is present.

protected 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.

protected boolean

Returns:

Returns true if a qualified name appeared immediately on the input and was scanned, false otherwise.
scanQName
(QName
The qualified name structure to fill.
qname
,
XMLScanner.NameType
The type of the name (element or attribute)
nt
)

Scans a qualified name from the input, setting the fields of the QName structure appropriately.

public void
public final void
setBufferSize(int size)

public void
setColumnNumber(int col)

public final void
setCurrentEntity(Entity.ScannedEntity scannedEntity)

set the instance of current scanned entity.

public final void
setEncoding(String
The IANA encoding name of the new encoding.
encoding
)

Sets the encoding of the scanner.

public void
public void
setLineNumber(int line)

public void
public void
setPublicId(String publicId)

public void
setVersion(String version)

the version of the current entity being scanned

public final void
setXMLVersion(String
the XML version of the current entity
xmlVersion
)

Sets the XML version.

protected boolean

Returns:

Returns true if the character was skipped.
skipChar
(int
The character to skip.
c
,
XMLScanner.NameType
The type of the name (element or attribute)
nt
)

Skips a character appearing immediately on the input.

protected final boolean

Returns:

Returns true if at least one space character was skipped.
skipDeclSpaces
()

Skips space characters appearing immediately on the input that would match non-terminal S (0x09, 0x0A, 0x0D, 0x20) before end of line normalization is performed.

protected boolean

Returns:

Returns true if at least one space character was skipped.
skipSpaces
()

Skips space characters appearing immediately on the input.

protected boolean

Returns:

Returns true if the string was skipped.
skipString
(String
The string to skip.
s
)

Skips the specified string appearing immediately on the input.

protected boolean
skipString(char[] s)

pack-priv void
storeWhiteSpace(int
position of a whitespace in the scanner entity buffer
whiteSpacePos
)

Save whitespace information.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALLOW_JAVA_ENCODINGSback to summary
protected static final String ALLOW_JAVA_ENCODINGS

Feature identifier: allow Java encodings.

countedback to summary
pack-priv boolean counted
DEBUG_BUFFERback to summary
private static final boolean DEBUG_BUFFER

Debug printing of buffer. This debugging flag works best when you resize the DEFAULT_BUFFER_SIZE down to something reasonable like 64 characters.

DEBUG_ENCODINGSback to summary
private static final boolean DEBUG_ENCODINGS

Debug switching readers for encodings.

DEBUG_SKIP_STRINGback to summary
private static final boolean DEBUG_SKIP_STRING
detectingVersionback to summary
pack-priv boolean detectingVersion
END_OF_DOCUMENT_ENTITYback to summary
private static final EOFException END_OF_DOCUMENT_ENTITY

To signal the end of the document entity, this exception will be thrown.

ERROR_REPORTERback to summary
protected static final String ERROR_REPORTER

Property identifier: error reporter.

fAllowJavaEncodingsback to summary
protected boolean fAllowJavaEncodings

Allow Java encoding names. This feature identifier is: http://apache.org/xml/features/allow-java-encodings

fBufferSizeback to summary
protected int fBufferSize
fCurrentEntityback to summary
protected Entity.ScannedEntity fCurrentEntity
fEntityManagerback to summary
protected XMLEntityManager fEntityManager
fErrorReporterback to summary
protected XMLErrorReporter fErrorReporter
fLimitAnalyzerback to summary
protected XMLLimitAnalyzer fLimitAnalyzer

Limit analyzer.

fPropertyManagerback to summary
protected PropertyManager fPropertyManager
fSecurityManagerback to summary
protected XMLSecurityManager fSecurityManager

Security manager.

fSymbolTableback to summary
protected SymbolTable fSymbolTable
isExternalback to summary
pack-priv boolean isExternal
listenersback to summary
private ArrayList<XMLBufferListener> listeners

Listeners which should know when load is being called

newlinesback to summary
pack-priv int newlines
offsetback to summary
pack-priv int offset
SYMBOL_TABLEback to summary
protected static final String SYMBOL_TABLE

Property identifier: symbol table.

VALID_NAMESback to summary
private static final boolean[] VALID_NAMES
whiteSpaceInfoNeededback to summary
pack-priv boolean whiteSpaceInfoNeeded
whiteSpaceLenback to summary
pack-priv int whiteSpaceLen
whiteSpaceLookupback to summary
pack-priv int[] whiteSpaceLookup
xmlVersionSetExplicitlyback to summary
protected boolean xmlVersionSetExplicitly

Constructor Detail

XMLEntityScannerback to summary
public XMLEntityScanner()

Default constructor.

XMLEntityScannerback to summary
public XMLEntityScanner(PropertyManager propertyManager, XMLEntityManager entityManager)

private constructor, this class can only be instantiated within this class. Instance of this class should be obtained using getEntityScanner() or getEntityScanner(ScannedEntity scannedEntity)

See Also
getEntityScanner(), getEntityScanner(ScannedEntity)

Method Detail

arrangeCapacityback to summary
public boolean arrangeCapacity(int length) throws IOException
Parameters
length:int

This function checks that following number of characters are available. to the underlying buffer.

Returns:boolean

This function returns true if capacity asked is available.

arrangeCapacityback to summary
public boolean arrangeCapacity(int length, boolean changeEntity) throws IOException
Parameters
length:int

This function checks that following number of characters are available. to the underlying buffer.

changeEntity:boolean

a flag to indicate that the underlying function should change the entity

Returns:boolean

This function returns true if capacity asked is available.

checkBeforeLoadback to summary
protected int checkBeforeLoad(Entity.ScannedEntity entity, int offset, int nameOffset) throws IOException

Checks whether the end of the entity buffer has been reached. If yes, checks against the limit and buffer size before loading more characters.

Parameters
entity:Entity.ScannedEntity

the current entity

offset:int

the offset from which the current read was started

nameOffset:int

the offset from which the current name starts

Returns:int

the length of characters scanned before the end of the buffer, zero if there is more to be read in the buffer

checkEntityLimitback to summary
protected void checkEntityLimit(XMLScanner.NameType nt, Entity.ScannedEntity entity, int offset, int length)

If the current entity is an Entity reference, check the accumulated size against the limit.

Parameters
nt:XMLScanner.NameType

type of name (element, attribute or entity)

entity:Entity.ScannedEntity

The current entity

offset:int

The index of the first byte

length:int

The length of the entity scanned

checkLimitback to summary
protected void checkLimit(XMLSecurityManager.Limit limit, Entity.ScannedEntity entity, int offset, int length)

Checks whether the value of the specified Limit exceeds its limit

Parameters
limit:XMLSecurityManager.Limit

The Limit to be checked

entity:Entity.ScannedEntity

The current entity

offset:int

The index of the first byte

length:int

The length of the entity scanned

checkNodeCountback to summary
protected void checkNodeCount(Entity.ScannedEntity entity)

If the current entity is an Entity reference, counts the total nodes in the entity and checks the accumulated value against the limit.

Parameters
entity:Entity.ScannedEntity

The current entity

createReaderback to summary
protected Reader createReader(InputStream inputStream, String encoding, Boolean isBigEndian) throws IOException

Creates a reader capable of reading the given input stream in the specified encoding.

Parameters
inputStream:InputStream

The input stream.

encoding:String

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:Boolean

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.

Returns:Reader

Returns a reader.

getBaseSystemIdback to summary
public final String getBaseSystemId()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getBaseSystemId.

Returns the base system identifier of the currently scanned entity, or null if none is available.

getCharback to summary
public int getChar(int relative) throws IOException
getCharacterOffsetback to summary
public final int getCharacterOffset()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getCharacterOffset.

Doc from com.sun.org.apache.xerces.internal.xni.XMLLocator.getCharacterOffset.

Returns the character offset, or -1 if no character offset is available.

getColumnNumberback to summary
public final int getColumnNumber()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getColumnNumber.

Doc from com.sun.org.apache.xerces.internal.xni.XMLLocator.getColumnNumber.

Returns the column number, or -1 if no column number is available.

getCurrentEntityback to summary
public Entity.ScannedEntity getCurrentEntity()
getEncodingback to summary
public final String getEncoding()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getEncoding.

Returns the encoding of the current entity. Note that, for a given entity, this value can only be considered final once the encoding declaration has been read (or once it has been determined that there is no such declaration) since, no encoding having been specified on the XMLInputSource, the parser will make an initial "guess" which could be in error.

getEncodingNameback to summary
protected 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.

Parameters
b4:byte[]

The first four bytes of the input.

count:int

The number of bytes actually read.

Returns:Object[]

a 2-element array: the first element, an IANA-encoding string, the second element a Boolean which is true iff the document is big endian, false if it's little-endian, and null if the distinction isn't relevant.

getExpandedSystemIdback to summary
public final String getExpandedSystemId()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getExpandedSystemId.

Returns the expanded system identifier.

getLineNumberback to summary
public final int getLineNumber()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getLineNumber.

Doc from com.sun.org.apache.xerces.internal.xni.XMLLocator.getLineNumber.

Returns the line number, or -1 if no line number is available.

getLiteralSystemIdback to summary
public final String getLiteralSystemId()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getLiteralSystemId.

Returns the literal system identifier.

getPublicIdback to summary
public final String getPublicId()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getPublicId.

Returns the public identifier.

getVersionback to summary
public String getVersion()
getXMLVersionback to summary
public final String getXMLVersion()

Implements com.sun.org.apache.xerces.internal.xni.XMLLocator.getXMLVersion.

Returns the XML version of the current entity. This will normally be the value from the XML or text declaration or defaulted by the parser. Note that that this value may be different than the version of the processing rules applied to the current entity. For instance, an XML 1.1 document may refer to XML 1.0 entities. In such a case the rules of XML 1.1 are applied to the entire document. Also note that, for a given entity, this value can only be considered final once the XML or text declaration has been read or once it has been determined that there is no such declaration.

invokeListenersback to summary
public void invokeListeners(int loadPos)
Parameters
loadPos:int

Starting position from which new data is being loaded into scanner buffer.

isExternalback to summary
public final boolean isExternal()

Returns true if the current entity being scanned is external.

isSpaceback to summary
public boolean isSpace(char ch)
loadback to summary
pack-priv final boolean load(int offset, boolean changeEntity, boolean notify) throws IOException

Loads a chunk of text.

Parameters
offset:int

The offset into the character buffer to read the next batch of characters.

changeEntity:boolean

True if the load should change entities at the end of the entity, otherwise leave the current entity in place and the entity boundary will be signaled by the return value.

notify:boolean

Determine whether to notify listeners of the event

Returns:boolean

Returns true if the entity changed as a result of this load operation.

normalizeNewlinesback to summary
protected boolean normalizeNewlines(short version, XMLString buffer, boolean append, boolean storeWS, XMLScanner.NameType nt) throws IOException

Normalizes newlines. As specified in XML specification, this method converts newlines, '\n', '\r' and '\r\n' to '\n' as 2.11 End-of-Line Handling. Further, it may put them in a cache for later process as needed, for example as specified in 3.3.3 Attribute-Value Normalization.

Implementation Note

this method does not limit to processing external parsed entities as 2.11 required. It handles all cases where newlines need to be processed.

Parameters
buffer:XMLString

the current content buffer

append:boolean

a flag indicating whether to append to the buffer

storeWS:boolean

a flag indicating whether the whitespaces need to be stored for later processing

nt:XMLScanner.NameType

the type of the entity

Returns:boolean

true if the cursor is at the end of the current entity, false otherwise.

peekCharback to summary
public int peekChar() throws IOException

Returns the next character on the input.

Note

The character is not consumed.

Exceptions
IOException:
Thrown if i/o error occurs.
EOFException:
Thrown on end of file.
registerListenerback to summary
public void registerListener(XMLBufferListener listener)

Registers the listener object and provides callback.

Parameters
listener:XMLBufferListener

listener to which call back should be provided when scanner buffer is being changed.

resetback to summary
public void reset(PropertyManager propertyManager)

Resets the components.

resetback to summary
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException

Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.

Parameters
componentManager:XMLComponentManager

The component manager.

Exceptions
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.
resetback to summary
public final void reset(SymbolTable symbolTable, XMLEntityManager entityManager, XMLErrorReporter reporter)
resetCommonback to summary
private void resetCommon()
scanCharback to summary
protected int scanChar(XMLScanner.NameType nt) throws IOException

Returns the next character on the input.

Note

The character is consumed.

Parameters
nt:XMLScanner.NameType

The type of the name (element or attribute)

Exceptions
IOException:
Thrown if i/o error occurs.
EOFException:
Thrown on end of file.
scanContentback to summary
protected int scanContent(XMLString content) throws IOException

CHANGED: Scans a range of parsed character data, This function appends the character data to the supplied buffer.

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.

Parameters
content:XMLString

The content structure to fill.

Returns:int

Returns the next character on the input, if known. This value may be -1 but this does note designate end of file.

Exceptions
IOException:
Thrown if i/o error occurs.
EOFException:
Thrown on end of file.
scanDataback to summary
protected boolean scanData(String delimiter, XMLStringBuffer buffer, int chunkLimit) throws IOException

Scans a range of character data up to the specified delimiter, setting the fields of the XMLString structure, appropriately.

Note

The characters are consumed.

Note

This assumes 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.

Parameters
delimiter:String

The string that signifies the end of the character data to be scanned.

buffer:XMLStringBuffer

The XMLStringBuffer to fill.

chunkLimit:int

the size limit of the data to be scanned. Zero by default indicating no limit.

Returns:boolean

Returns true if there is more data to scan, false otherwise.

Exceptions
IOException:
Thrown if i/o error occurs.
EOFException:
Thrown on end of file.
scanLiteralback to summary
protected int scanLiteral(int quote, XMLString content, boolean isNSURI) throws IOException

Scans a range of attribute value data, setting the fields of the XMLString structure, appropriately.

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.

Parameters
quote:int

The quote character that signifies the end of the attribute value data.

content:XMLString

The content structure to fill.

isNSURI:boolean

a flag indicating whether the content is a Namespace URI

Returns:int

Returns the next character on the input, if known. This value may be -1 but this does note designate end of file.

Exceptions
IOException:
Thrown if i/o error occurs.
EOFException:
Thrown on end of file.
scanNameback to summary
protected String scanName(XMLScanner.NameType nt) throws IOException

Returns a string matching the Name production appearing immediately on the input as a symbol, or null if no Name string is present.

Note

The Name characters are consumed.

Note

The string returned must be a symbol. The SymbolTable can be used for this purpose.

Parameters
nt:XMLScanner.NameType

The type of the name (element or attribute)

Exceptions
IOException:
Thrown if i/o error occurs.
EOFException:
Thrown on end of file.
See Also
com.sun.org.apache.xerces.internal.util.SymbolTable, com.sun.org.apache.xerces.internal.util.XMLChar#isName, com.sun.org.apache.xerces.internal.util.XMLChar#isNameStart
scanNmtokenback to summary
protected String scanNmtoken() throws IOException

Returns a string matching the NMTOKEN production appearing immediately on the input as a symbol, or null if NMTOKEN Name string is present.

Note

The NMTOKEN characters are consumed.

Note

The string returned must be a symbol. The SymbolTable can be used for this purpose.

Exceptions
IOException:
Thrown if i/o error occurs.
EOFException:
Thrown on end of file.
See Also
com.sun.org.apache.xerces.internal.util.SymbolTable, com.sun.org.apache.xerces.internal.util.XMLChar#isName
scanQNameback to summary
protected boolean scanQName(QName qname, XMLScanner.NameType nt) throws IOException

Scans a qualified name from the input, setting the fields of the QName structure appropriately.

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.

Parameters
qname:QName

The qualified name structure to fill.

nt:XMLScanner.NameType

The type of the name (element or attribute)

Returns:boolean

Returns true if a qualified name appeared immediately on the input and was scanned, false otherwise.

Exceptions
IOException:
Thrown if i/o error occurs.
EOFException:
Thrown on end of file.
See Also
com.sun.org.apache.xerces.internal.util.SymbolTable, com.sun.org.apache.xerces.internal.util.XMLChar#isName, com.sun.org.apache.xerces.internal.util.XMLChar#isNameStart
setBaseSystemIdback to summary
public void setBaseSystemId(String systemId)
See Also
com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier#setBaseSystemId(String)
setBufferSizeback to summary
public final void setBufferSize(int size)
setColumnNumberback to summary
public void setColumnNumber(int col)
See Also
com.sun.org.apache.xerces.internal.xni.XMLLocator#setColumnNumber(int)
setCurrentEntityback to summary
public final void setCurrentEntity(Entity.ScannedEntity scannedEntity)

set the instance of current scanned entity.

setEncodingback to summary
public final void setEncoding(String encoding) throws IOException

Sets the encoding of the scanner. This method is used by the scanners if the XMLDecl or TextDecl line contains an encoding pseudo-attribute.

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).

Parameters
encoding:String

The IANA encoding name of the new encoding.

Exceptions
IOException:
Thrown if the new encoding is not supported.
See Also
com.sun.org.apache.xerces.internal.util.EncodingMap
setExpandedSystemIdback to summary
public void setExpandedSystemId(String systemId)
See Also
com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier#setExpandedSystemId(String)
setLineNumberback to summary
public void setLineNumber(int line)
See Also
com.sun.org.apache.xerces.internal.xni.XMLLocator#setLineNumber(int)
setLiteralSystemIdback to summary
public void setLiteralSystemId(String systemId)
See Also
com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier#setLiteralSystemId(String)
setPublicIdback to summary
public void setPublicId(String publicId)
See Also
com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier#setPublicId(String)
setVersionback to summary
public void setVersion(String version)

the version of the current entity being scanned

setXMLVersionback to summary
public final void setXMLVersion(String xmlVersion)

Sets the XML version. This method is used by the scanners to report the value of the version pseudo-attribute in an XML or text declaration.

Parameters
xmlVersion:String

the XML version of the current entity

skipCharback to summary
protected boolean skipChar(int c, XMLScanner.NameType nt) throws IOException

Skips a character appearing immediately on the input.

Note

The character is consumed only if it matches the specified character.

Parameters
c:int

The character to skip.

nt:XMLScanner.NameType

The type of the name (element or attribute)

Returns:boolean

Returns true if the character was skipped.

Exceptions
IOException:
Thrown if i/o error occurs.
EOFException:
Thrown on end of file.
skipDeclSpacesback to summary
protected final boolean skipDeclSpaces() throws IOException

Skips space characters appearing immediately on the input that would match non-terminal S (0x09, 0x0A, 0x0D, 0x20) before end of line normalization is performed. This is useful when scanning structures such as the XMLDecl and TextDecl that can only contain US-ASCII characters.

Note

The characters are consumed only if they would match non-terminal S before end of line normalization is performed.

Returns:boolean

Returns true if at least one space character was skipped.

Exceptions
IOException:
Thrown if i/o error occurs.
EOFException:
Thrown on end of file.
See Also
com.sun.org.apache.xerces.internal.util.XMLChar#isSpace
skipSpacesback to summary
protected boolean skipSpaces() throws IOException

Skips space characters appearing immediately on the input.

Note

The characters are consumed only if they are space characters.

Returns:boolean

Returns true if at least one space character was skipped.

Exceptions
IOException:
Thrown if i/o error occurs.
EOFException:
Thrown on end of file.
See Also
com.sun.org.apache.xerces.internal.util.XMLChar#isSpace
skipStringback to summary
protected boolean skipString(String s) throws IOException

Skips the specified string appearing immediately on the input.

Note

The characters are consumed only if all the characters are skipped.

Parameters
s:String

The string to skip.

Returns:boolean

Returns true if the string was skipped.

Exceptions
IOException:
Thrown if i/o error occurs.
EOFException:
Thrown on end of file.
skipStringback to summary
protected boolean skipString(char[] s) throws IOException
storeWhiteSpaceback to summary
pack-priv void storeWhiteSpace(int whiteSpacePos)

Save whitespace information. Increase the whitespace buffer by 100 when needed. For XML 1.0, legal characters below 0x20 are 0x09 (TAB), 0x0A (LF) and 0x0D (CR).

Parameters
whiteSpacePos:int

position of a whitespace in the scanner entity buffer