| Modifier and Type | Field 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. | |
| protected XMLEntityManager | |
| protected XMLErrorReporter | |
| protected XMLLimitAnalyzer | fLimitAnalyzer
Limit analyzer. |
| protected PropertyManager | |
| protected XMLSecurityManager | fSecurityManager
Security manager. |
| protected SymbolTable | |
| pack-priv boolean | |
| private ArrayList | 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 |
| Access | Constructor and Description |
|---|---|
| public | |
| public | XMLEntityScanner(PropertyManager propertyManager, XMLEntityManager entityManager)
private constructor, this class can only be instantiated within this class. |
| Modifier and Type | Method 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 bufferthe current entity entity,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.
type of name (element, attribute or entity) nt,The current entity entity,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.
The Limit to be checked limit,The current entity entity,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.
The current entity entityIf 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.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. Returns the base system identifier of the currently scanned entity, or null if none is available. |
| public int | |
| public final int | getCharacterOffset()
Implements com. Returns the character offset, or |
| public final int | getColumnNumber()
Implements com. Returns the column number, or |
| public Entity. | |
| public final String | getEncoding()
Implements com. 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.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 | getExpandedSystemId()
Implements com. Returns the expanded system identifier. |
| public final int | getLineNumber()
Implements com. Returns the line number, or |
| public final String | getLiteralSystemId()
Implements com. Returns the literal system identifier. |
| public final String | getPublicId()
Implements com. Returns the public identifier. |
| public String | |
| public final String | getXMLVersion()
Implements com. 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 | |
| public boolean | |
| pack-priv final boolean | Returns: Returns true if the entity changed as a result of this load operation.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.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.the type of the entity ntNormalizes newlines. |
| public int | |
| pack-priv final void | |
| 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 | |
| public void | |
| public final void | |
| private void | |
| protected int | scanChar(XMLScanner.
The type of the name (element or attribute) ntReturns 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.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.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.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.
The type of the name (element or attribute) ntReturns 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.The qualified name structure to fill. qname, XMLScanner.The type of the name (element or attribute) ntScans a qualified name from the input, setting the fields of the QName structure appropriately. |
| public void | |
| public final void | |
| public void | |
| public final void | |
| public final void | setEncoding(String
The IANA encoding name of the new encoding. encoding)Sets the encoding of the scanner. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public final void | |
| protected boolean | Returns: Returns true if the character was skipped.The character to skip. c, XMLScanner.The type of the name (element or attribute) ntSkips a character appearing immediately on the input. |
| protected final boolean | Returns: Returns true if at least one space character was skipped.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.Skips space characters appearing immediately on the input. |
| protected boolean | Returns: Returns true if the string was skipped.The string to skip. s)Skips the specified string appearing immediately on the input. |
| protected boolean | |
| pack-priv void | storeWhiteSpace(int
position of a whitespace in the scanner entity buffer whiteSpacePos)Save whitespace information. |
| ALLOW_JAVA_ENCODINGS | back to summary |
|---|---|
| protected static final String ALLOW_JAVA_ENCODINGS Feature identifier: allow Java encodings. | |
| counted | back to summary |
|---|---|
| pack-priv boolean counted | |
| DEBUG_BUFFER | back 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_ENCODINGS | back to summary |
|---|---|
| private static final boolean DEBUG_ENCODINGS Debug switching readers for encodings. | |
| DEBUG_SKIP_STRING | back to summary |
|---|---|
| private static final boolean DEBUG_SKIP_STRING | |
| detectingVersion | back to summary |
|---|---|
| pack-priv boolean detectingVersion | |
| END_OF_DOCUMENT_ENTITY | back to summary |
|---|---|
| private static final EOFException END_OF_DOCUMENT_ENTITY To signal the end of the document entity, this exception will be thrown. | |
| ERROR_REPORTER | back to summary |
|---|---|
| protected static final String ERROR_REPORTER Property identifier: error reporter. | |
| fAllowJavaEncodings | back to summary |
|---|---|
| protected boolean fAllowJavaEncodings Allow Java encoding names. This feature identifier is: http://apache.org/xml/features/allow-java-encodings | |
| fBufferSize | back to summary |
|---|---|
| protected int fBufferSize | |
| fCurrentEntity | back to summary |
|---|---|
| protected Entity. | |
| fEntityManager | back to summary |
|---|---|
| protected XMLEntityManager fEntityManager | |
| fErrorReporter | back to summary |
|---|---|
| protected XMLErrorReporter fErrorReporter | |
| fLimitAnalyzer | back to summary |
|---|---|
| protected XMLLimitAnalyzer fLimitAnalyzer Limit analyzer. | |
| fPropertyManager | back to summary |
|---|---|
| protected PropertyManager fPropertyManager | |
| fSecurityManager | back to summary |
|---|---|
| protected XMLSecurityManager fSecurityManager Security manager. | |
| fSymbolTable | back to summary |
|---|---|
| protected SymbolTable fSymbolTable | |
| isExternal | back to summary |
|---|---|
| pack-priv boolean isExternal | |
| listeners | back to summary |
|---|---|
| private ArrayList<XMLBufferListener> listeners Listeners which should know when load is being called | |
| newlines | back to summary |
|---|---|
| pack-priv int newlines | |
| offset | back to summary |
|---|---|
| pack-priv int offset | |
| SYMBOL_TABLE | back to summary |
|---|---|
| protected static final String SYMBOL_TABLE Property identifier: symbol table. | |
| VALID_NAMES | back to summary |
|---|---|
| private static final boolean[] VALID_NAMES | |
| whiteSpaceInfoNeeded | back to summary |
|---|---|
| pack-priv boolean whiteSpaceInfoNeeded | |
| whiteSpaceLen | back to summary |
|---|---|
| pack-priv int whiteSpaceLen | |
| whiteSpaceLookup | back to summary |
|---|---|
| pack-priv int[] whiteSpaceLookup | |
| xmlVersionSetExplicitly | back to summary |
|---|---|
| protected boolean xmlVersionSetExplicitly | |
| XMLEntityScanner | back to summary |
|---|---|
| public XMLEntityScanner() Default constructor. | |
| XMLEntityScanner | back 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) | |
| arrangeCapacity | back to summary |
|---|---|
public boolean arrangeCapacity(int length) throws IOException
| |
| arrangeCapacity | back to summary |
|---|---|
public boolean arrangeCapacity(int length, boolean changeEntity) throws IOException
| |
| checkBeforeLoad | back to summary |
|---|---|
| protected int checkBeforeLoad(Entity. Checks whether the end of the entity buffer has been reached. If yes, checks against the limit and buffer size before loading more characters.
| |
| checkEntityLimit | back to summary |
|---|---|
| protected void checkEntityLimit(XMLScanner. If the current entity is an Entity reference, check the accumulated size against the limit.
| |
| checkLimit | back to summary |
|---|---|
| protected void checkLimit(XMLSecurityManager. Checks whether the value of the specified Limit exceeds its limit
| |
| checkNodeCount | back to summary |
|---|---|
| protected void checkNodeCount(Entity. If the current entity is an Entity reference, counts the total nodes in the entity and checks the accumulated value against the limit.
| |
| createReader | back 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.
| |
| getBaseSystemId | back to summary |
|---|---|
| public final String getBaseSystemId() Implements com. Returns the base system identifier of the currently scanned entity, or null if none is available. | |
| getChar | back to summary |
|---|---|
| public int getChar(int relative) throws IOException | |
| getCharacterOffset | back to summary |
|---|---|
| public final int getCharacterOffset() Implements com. Doc from com. Returns the character offset, or | |
| getColumnNumber | back to summary |
|---|---|
| public final int getColumnNumber() Implements com. Doc from com. Returns the column number, or | |
| getCurrentEntity | back to summary |
|---|---|
| public Entity. | |
| getEncoding | back to summary |
|---|---|
| public final String getEncoding() Implements com. 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. | |
| getEncodingName | back 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.
| |
| getExpandedSystemId | back to summary |
|---|---|
| public final String getExpandedSystemId() Implements com. Returns the expanded system identifier. | |
| getLineNumber | back to summary |
|---|---|
| public final int getLineNumber() Implements com. Doc from com. Returns the line number, or | |
| getLiteralSystemId | back to summary |
|---|---|
| public final String getLiteralSystemId() Implements com. Returns the literal system identifier. | |
| getPublicId | back to summary |
|---|---|
| public final String getPublicId() Implements com. Returns the public identifier. | |
| getVersion | back to summary |
|---|---|
| public String getVersion() | |
| getXMLVersion | back to summary |
|---|---|
| public final String getXMLVersion() Implements com. 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. | |
| invokeListeners | back to summary |
|---|---|
public void invokeListeners(int loadPos)
| |
| isExternal | back to summary |
|---|---|
| public final boolean isExternal() Returns true if the current entity being scanned is external. | |
| isSpace | back to summary |
|---|---|
| public boolean isSpace(char ch) | |
| load | back to summary |
|---|---|
| pack-priv final boolean load(int offset, boolean changeEntity, boolean notify) throws IOException Loads a chunk of text.
| |
| normalizeNewlines | back to summary |
|---|---|
| protected boolean normalizeNewlines(short version, XMLString buffer, boolean append, boolean storeWS, XMLScanner. 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.
| |
| peekChar | back to summary |
|---|---|
| public int peekChar() throws IOException Returns the next character on the input. Note The character is not consumed.
| |
| back to summary | |
|---|---|
| pack-priv final void print() Prints the contents of the buffer. | |
| registerListener | back to summary |
|---|---|
| public void registerListener(XMLBufferListener listener) Registers the listener object and provides callback.
| |
| reset | back to summary |
|---|---|
| public void reset(PropertyManager propertyManager) Resets the components. | |
| reset | back 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.
| |
| reset | back to summary |
|---|---|
| public final void reset(SymbolTable symbolTable, XMLEntityManager entityManager, XMLErrorReporter reporter) | |
| resetCommon | back to summary |
|---|---|
| private void resetCommon() | |
| scanChar | back to summary |
|---|---|
| protected int scanChar(XMLScanner. Returns the next character on the input. Note The character is consumed.
| |
| scanContent | back 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.
| |
| scanData | back 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.
| |
| scanLiteral | back 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.
| |
| scanName | back to summary |
|---|---|
| protected String scanName(XMLScanner. 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.
| |
| scanNmtoken | back 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.
| |
| scanQName | back to summary |
|---|---|
| protected boolean scanQName(QName qname, XMLScanner. 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.
| |
| setBaseSystemId | back to summary |
|---|---|
| public void setBaseSystemId(String systemId) | |
| setBufferSize | back to summary |
|---|---|
| public final void setBufferSize(int size) | |
| setColumnNumber | back to summary |
|---|---|
| public void setColumnNumber(int col) | |
| setCurrentEntity | back to summary |
|---|---|
| public final void setCurrentEntity(Entity. set the instance of current scanned entity. | |
| setEncoding | back 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).
| |
| setExpandedSystemId | back to summary |
|---|---|
| public void setExpandedSystemId(String systemId) | |
| setLineNumber | back to summary |
|---|---|
| public void setLineNumber(int line) | |
| setLiteralSystemId | back to summary |
|---|---|
| public void setLiteralSystemId(String systemId) | |
| setPublicId | back to summary |
|---|---|
| public void setPublicId(String publicId) | |
| setVersion | back to summary |
|---|---|
| public void setVersion(String version) the version of the current entity being scanned | |
| setXMLVersion | back 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.
| |
| skipChar | back to summary |
|---|---|
| protected boolean skipChar(int c, XMLScanner. Skips a character appearing immediately on the input. Note The character is consumed only if it matches the specified character.
| |
| skipDeclSpaces | back 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.
| |
| skipSpaces | back 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.
| |
| skipString | back 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.
| |
| skipString | back to summary |
|---|---|
| protected boolean skipString(char[] s) throws IOException | |
| storeWhiteSpace | back 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).
| |