org.apache.xerces.readers
Interface XMLEntityHandler

All Superinterfaces:
Locator
All Known Implementing Classes:
DefaultEntityHandler

public interface XMLEntityHandler
extends Locator

This is the interface used for entity management. This interface is typically implemented by the "parser" class to provide entity management services for the scanner classes.

Version:
$Id: XMLEntityHandler.java 315647 2000-05-17 18:33:29Z jeffreyr $

Inner Class Summary
static interface XMLEntityHandler.CharBuffer
          This interface is used to store and retrieve character sequences.
static interface XMLEntityHandler.CharDataHandler
          Interface for passing character data.
static interface XMLEntityHandler.DTDHandler
          DTD specific entity handler
static interface XMLEntityHandler.EntityReader
          This is the interface for scanners to process input data from entities without needing to know the details of the underlying storage of those entities, or their encodings.
 
Field Summary
static int ATTVALUE_RESULT_COMPLEX
          Special return values for scanAttValue method.
static int ATTVALUE_RESULT_INVALID_CHAR
          Special return values for scanAttValue method.
static int ATTVALUE_RESULT_LESSTHAN
          Special return values for scanAttValue method.
static int CHARREF_RESULT_INVALID_CHAR
          Special return values for scanCharRef method.
static int CHARREF_RESULT_OUT_OF_RANGE
          Special return values for scanCharRef method.
static int CHARREF_RESULT_SEMICOLON_REQUIRED
          Special return values for scanCharRef method.
static int CONTENT_RESULT_END_OF_CDSECT
          Return values for the scanContent method.
static int CONTENT_RESULT_INVALID_CHAR
          Return values for the scanContent method.
static int CONTENT_RESULT_MARKUP_END_OF_INPUT
          Return values for the scanContent method.
static int CONTENT_RESULT_MARKUP_NOT_RECOGNIZED
          Return values for the scanContent method.
static int CONTENT_RESULT_MATCHING_ETAG
          Return values for the scanContent method.
static int CONTENT_RESULT_REFERENCE_END_OF_INPUT
          Return values for the scanContent method.
static int CONTENT_RESULT_START_OF_CDSECT
          Return values for the scanContent method.
static int CONTENT_RESULT_START_OF_CHARREF
          Return values for the scanContent method.
static int CONTENT_RESULT_START_OF_COMMENT
          Return values for the scanContent method.
static int CONTENT_RESULT_START_OF_ELEMENT
          Return values for the scanContent method.
static int CONTENT_RESULT_START_OF_ENTITYREF
          Return values for the scanContent method.
static int CONTENT_RESULT_START_OF_ETAG
          Return values for the scanContent method.
static int CONTENT_RESULT_START_OF_PI
          Return values for the scanContent method.
static int ENTITYREF_DOCUMENT
          This is an enumeration of all the defined contexts in which an entity reference may appear.
static int ENTITYREF_EXTERNAL_SUBSET
          This is an enumeration of all the defined contexts in which an entity reference may appear.
static int ENTITYREF_IN_ATTVALUE
          This is an enumeration of all the defined contexts in which an entity reference may appear.
static int ENTITYREF_IN_CONTENT
          This is an enumeration of all the defined contexts in which an entity reference may appear.
static int ENTITYREF_IN_DEFAULTATTVALUE
          This is an enumeration of all the defined contexts in which an entity reference may appear.
static int ENTITYREF_IN_DTD_AS_MARKUP
          This is an enumeration of all the defined contexts in which an entity reference may appear.
static int ENTITYREF_IN_DTD_WITHIN_MARKUP
          This is an enumeration of all the defined contexts in which an entity reference may appear.
static int ENTITYREF_IN_ENTITYVALUE
          This is an enumeration of all the defined contexts in which an entity reference may appear.
static int ENTITYTYPE_DOCUMENT
          This is an enumeration of all the defined entity types.
static int ENTITYTYPE_EXTERNAL
          This is an enumeration of all the defined entity types.
static int ENTITYTYPE_EXTERNAL_PE
          This is an enumeration of all the defined entity types.
static int ENTITYTYPE_EXTERNAL_SUBSET
          This is an enumeration of all the defined entity types.
static int ENTITYTYPE_INTERNAL
          This is an enumeration of all the defined entity types.
static int ENTITYTYPE_INTERNAL_PE
          This is an enumeration of all the defined entity types.
static int ENTITYTYPE_UNPARSED
          This is an enumeration of all the defined entity types.
static int ENTITYVALUE_RESULT_END_OF_INPUT
          Special return values for scanEntityValue method.
static int ENTITYVALUE_RESULT_FINISHED
          Special return values for scanEntityValue method.
static int ENTITYVALUE_RESULT_INVALID_CHAR
          Special return values for scanEntityValue method.
static int ENTITYVALUE_RESULT_PEREF
          Special return values for scanEntityValue method.
static int ENTITYVALUE_RESULT_REFERENCE
          Special return values for scanEntityValue method.
static int STRINGLIT_RESULT_INVALID_CHAR
          Special return values for scanStringLiteral method.
static int STRINGLIT_RESULT_QUOTE_REQUIRED
          Special return values for scanStringLiteral method.
 
Method Summary
 XMLEntityHandler.EntityReader changeReaders()
          This method is called by the reader subclasses at the end of input.
 java.lang.String expandSystemId(java.lang.String systemId)
          Expand the system identifier relative to the entity that we are processing.
 XMLEntityHandler.CharDataHandler getCharDataHandler()
          Get the character data handler.
 XMLEntityHandler.EntityReader getEntityReader()
          Return the current reader.
 int getReaderDepth()
          Return the depth set for the current reader.
 int getReaderId()
          Return a unique identifier for the current reader.
 void setCharDataHandler(XMLEntityHandler.CharDataHandler charDataHandler)
          Set the character data handler.
 void setReaderDepth(int depth)
          Set the depth for the current reader.
 boolean startReadingFromDocument(InputSource source)
          Start reading document from an InputSource.
 boolean startReadingFromEntity(int entityName, int readerDepth, int entityContext)
          Start reading from this entity.
 
Methods inherited from interface org.xml.sax.Locator
getColumnNumber, getLineNumber, getPublicId, getSystemId
 

Field Detail

CHARREF_RESULT_SEMICOLON_REQUIRED

public static final int CHARREF_RESULT_SEMICOLON_REQUIRED
Special return values for scanCharRef method. The normal return value is a unicode character. These error conditions are defined using invalid XML unicode code points.

CHARREF_RESULT_INVALID_CHAR

public static final int CHARREF_RESULT_INVALID_CHAR
Special return values for scanCharRef method. The normal return value is a unicode character. These error conditions are defined using invalid XML unicode code points.

CHARREF_RESULT_OUT_OF_RANGE

public static final int CHARREF_RESULT_OUT_OF_RANGE
Special return values for scanCharRef method. The normal return value is a unicode character. These error conditions are defined using invalid XML unicode code points.

STRINGLIT_RESULT_QUOTE_REQUIRED

public static final int STRINGLIT_RESULT_QUOTE_REQUIRED
Special return values for scanStringLiteral method. The normal return value is a StringPool handle. These error conditions are defined using invalid indices.

STRINGLIT_RESULT_INVALID_CHAR

public static final int STRINGLIT_RESULT_INVALID_CHAR
Special return values for scanStringLiteral method. The normal return value is a StringPool handle. These error conditions are defined using invalid indices.

ATTVALUE_RESULT_COMPLEX

public static final int ATTVALUE_RESULT_COMPLEX
Special return values for scanAttValue method. The normal return value is a StringPool handle for a simple AttValue that was already correctly normalized for CDATA in the original document. These other return values either indicate an error or that the AttValue needs further processing.

ATTVALUE_RESULT_LESSTHAN

public static final int ATTVALUE_RESULT_LESSTHAN
Special return values for scanAttValue method. The normal return value is a StringPool handle for a simple AttValue that was already correctly normalized for CDATA in the original document. These other return values either indicate an error or that the AttValue needs further processing.

ATTVALUE_RESULT_INVALID_CHAR

public static final int ATTVALUE_RESULT_INVALID_CHAR
Special return values for scanAttValue method. The normal return value is a StringPool handle for a simple AttValue that was already correctly normalized for CDATA in the original document. These other return values either indicate an error or that the AttValue needs further processing.

ENTITYVALUE_RESULT_FINISHED

public static final int ENTITYVALUE_RESULT_FINISHED
Special return values for scanEntityValue method. The normal return value is a StringPool handle for a simple EntityValue that was entirely contained within the original document. These other return values can either indicate an error or that the EntityValue needs further processing.

ENTITYVALUE_RESULT_REFERENCE

public static final int ENTITYVALUE_RESULT_REFERENCE
Special return values for scanEntityValue method. The normal return value is a StringPool handle for a simple EntityValue that was entirely contained within the original document. These other return values can either indicate an error or that the EntityValue needs further processing.

ENTITYVALUE_RESULT_PEREF

public static final int ENTITYVALUE_RESULT_PEREF
Special return values for scanEntityValue method. The normal return value is a StringPool handle for a simple EntityValue that was entirely contained within the original document. These other return values can either indicate an error or that the EntityValue needs further processing.

ENTITYVALUE_RESULT_INVALID_CHAR

public static final int ENTITYVALUE_RESULT_INVALID_CHAR
Special return values for scanEntityValue method. The normal return value is a StringPool handle for a simple EntityValue that was entirely contained within the original document. These other return values can either indicate an error or that the EntityValue needs further processing.

ENTITYVALUE_RESULT_END_OF_INPUT

public static final int ENTITYVALUE_RESULT_END_OF_INPUT
Special return values for scanEntityValue method. The normal return value is a StringPool handle for a simple EntityValue that was entirely contained within the original document. These other return values can either indicate an error or that the EntityValue needs further processing.

CONTENT_RESULT_START_OF_PI

public static final int CONTENT_RESULT_START_OF_PI
Return values for the scanContent method.

CONTENT_RESULT_START_OF_COMMENT

public static final int CONTENT_RESULT_START_OF_COMMENT
Return values for the scanContent method.

CONTENT_RESULT_START_OF_CDSECT

public static final int CONTENT_RESULT_START_OF_CDSECT
Return values for the scanContent method.

CONTENT_RESULT_END_OF_CDSECT

public static final int CONTENT_RESULT_END_OF_CDSECT
Return values for the scanContent method.

CONTENT_RESULT_START_OF_ETAG

public static final int CONTENT_RESULT_START_OF_ETAG
Return values for the scanContent method.

CONTENT_RESULT_MATCHING_ETAG

public static final int CONTENT_RESULT_MATCHING_ETAG
Return values for the scanContent method.

CONTENT_RESULT_START_OF_ELEMENT

public static final int CONTENT_RESULT_START_OF_ELEMENT
Return values for the scanContent method.

CONTENT_RESULT_START_OF_CHARREF

public static final int CONTENT_RESULT_START_OF_CHARREF
Return values for the scanContent method.

CONTENT_RESULT_START_OF_ENTITYREF

public static final int CONTENT_RESULT_START_OF_ENTITYREF
Return values for the scanContent method.

CONTENT_RESULT_INVALID_CHAR

public static final int CONTENT_RESULT_INVALID_CHAR
Return values for the scanContent method.

CONTENT_RESULT_MARKUP_NOT_RECOGNIZED

public static final int CONTENT_RESULT_MARKUP_NOT_RECOGNIZED
Return values for the scanContent method.

CONTENT_RESULT_MARKUP_END_OF_INPUT

public static final int CONTENT_RESULT_MARKUP_END_OF_INPUT
Return values for the scanContent method.

CONTENT_RESULT_REFERENCE_END_OF_INPUT

public static final int CONTENT_RESULT_REFERENCE_END_OF_INPUT
Return values for the scanContent method.

ENTITYTYPE_INTERNAL_PE

public static final int ENTITYTYPE_INTERNAL_PE
This is an enumeration of all the defined entity types. These are provided to communicate state information to the clients of the parser.

ENTITYTYPE_EXTERNAL_PE

public static final int ENTITYTYPE_EXTERNAL_PE
This is an enumeration of all the defined entity types. These are provided to communicate state information to the clients of the parser.

ENTITYTYPE_INTERNAL

public static final int ENTITYTYPE_INTERNAL
This is an enumeration of all the defined entity types. These are provided to communicate state information to the clients of the parser.

ENTITYTYPE_EXTERNAL

public static final int ENTITYTYPE_EXTERNAL
This is an enumeration of all the defined entity types. These are provided to communicate state information to the clients of the parser.

ENTITYTYPE_UNPARSED

public static final int ENTITYTYPE_UNPARSED
This is an enumeration of all the defined entity types. These are provided to communicate state information to the clients of the parser.

ENTITYTYPE_DOCUMENT

public static final int ENTITYTYPE_DOCUMENT
This is an enumeration of all the defined entity types. These are provided to communicate state information to the clients of the parser.

ENTITYTYPE_EXTERNAL_SUBSET

public static final int ENTITYTYPE_EXTERNAL_SUBSET
This is an enumeration of all the defined entity types. These are provided to communicate state information to the clients of the parser.

ENTITYREF_IN_ATTVALUE

public static final int ENTITYREF_IN_ATTVALUE
This is an enumeration of all the defined contexts in which an entity reference may appear. The order is important, as all explicit general entity references must appear first and the last of these must be ENTITYREF_IN_CONTENT. This permits the test "(context <= ENTITYREF_IN_CONTENT)" to be used as a quick check for a general entity reference.
See Also:
startReadingFromEntity(int, int, int)

ENTITYREF_IN_DEFAULTATTVALUE

public static final int ENTITYREF_IN_DEFAULTATTVALUE
This is an enumeration of all the defined contexts in which an entity reference may appear. The order is important, as all explicit general entity references must appear first and the last of these must be ENTITYREF_IN_CONTENT. This permits the test "(context <= ENTITYREF_IN_CONTENT)" to be used as a quick check for a general entity reference.
See Also:
startReadingFromEntity(int, int, int)

ENTITYREF_IN_CONTENT

public static final int ENTITYREF_IN_CONTENT
This is an enumeration of all the defined contexts in which an entity reference may appear. The order is important, as all explicit general entity references must appear first and the last of these must be ENTITYREF_IN_CONTENT. This permits the test "(context <= ENTITYREF_IN_CONTENT)" to be used as a quick check for a general entity reference.
See Also:
startReadingFromEntity(int, int, int)

ENTITYREF_IN_DTD_AS_MARKUP

public static final int ENTITYREF_IN_DTD_AS_MARKUP
This is an enumeration of all the defined contexts in which an entity reference may appear. The order is important, as all explicit general entity references must appear first and the last of these must be ENTITYREF_IN_CONTENT. This permits the test "(context <= ENTITYREF_IN_CONTENT)" to be used as a quick check for a general entity reference.
See Also:
startReadingFromEntity(int, int, int)

ENTITYREF_IN_ENTITYVALUE

public static final int ENTITYREF_IN_ENTITYVALUE
This is an enumeration of all the defined contexts in which an entity reference may appear. The order is important, as all explicit general entity references must appear first and the last of these must be ENTITYREF_IN_CONTENT. This permits the test "(context <= ENTITYREF_IN_CONTENT)" to be used as a quick check for a general entity reference.
See Also:
startReadingFromEntity(int, int, int)

ENTITYREF_IN_DTD_WITHIN_MARKUP

public static final int ENTITYREF_IN_DTD_WITHIN_MARKUP
This is an enumeration of all the defined contexts in which an entity reference may appear. The order is important, as all explicit general entity references must appear first and the last of these must be ENTITYREF_IN_CONTENT. This permits the test "(context <= ENTITYREF_IN_CONTENT)" to be used as a quick check for a general entity reference.
See Also:
startReadingFromEntity(int, int, int)

ENTITYREF_DOCUMENT

public static final int ENTITYREF_DOCUMENT
This is an enumeration of all the defined contexts in which an entity reference may appear. The order is important, as all explicit general entity references must appear first and the last of these must be ENTITYREF_IN_CONTENT. This permits the test "(context <= ENTITYREF_IN_CONTENT)" to be used as a quick check for a general entity reference.
See Also:
startReadingFromEntity(int, int, int)

ENTITYREF_EXTERNAL_SUBSET

public static final int ENTITYREF_EXTERNAL_SUBSET
This is an enumeration of all the defined contexts in which an entity reference may appear. The order is important, as all explicit general entity references must appear first and the last of these must be ENTITYREF_IN_CONTENT. This permits the test "(context <= ENTITYREF_IN_CONTENT)" to be used as a quick check for a general entity reference.
See Also:
startReadingFromEntity(int, int, int)
Method Detail

startReadingFromDocument

public boolean startReadingFromDocument(InputSource source)
                                 throws java.lang.Exception
Start reading document from an InputSource.
Parameters:
source - The input source for the document to process.
Returns:
true if we were able to open the document source; false otherwise.
Throws:
java.lang.Exception -  

startReadingFromEntity

public boolean startReadingFromEntity(int entityName,
                                      int readerDepth,
                                      int entityContext)
                               throws java.lang.Exception
Start reading from this entity. Note that the reader depth is not used by the reader, but is made available so that it may be retrieved at end of input to test that gramatical structures are properly nested within entities.
Parameters:
entityName - The entity name handle in the string pool.
readerDepth - The depth to associate with the reader for this entity.
context - The context of the entity reference; see ENTITYREF_IN_*.
Returns:
true if the entity might start with a TextDecl; false otherwise.
Throws:
java.lang.Exception -  

expandSystemId

public java.lang.String expandSystemId(java.lang.String systemId)
Expand the system identifier relative to the entity that we are processing.
Returns:
The expanded system identifier.

getReaderId

public int getReaderId()
Return a unique identifier for the current reader.

setReaderDepth

public void setReaderDepth(int depth)
Set the depth for the current reader.

getReaderDepth

public int getReaderDepth()
Return the depth set for the current reader.

getEntityReader

public XMLEntityHandler.EntityReader getEntityReader()
Return the current reader.

changeReaders

public XMLEntityHandler.EntityReader changeReaders()
                                            throws java.lang.Exception
This method is called by the reader subclasses at the end of input.
Returns:
The reader to use next.
Throws:
java.lang.Exception -  

setCharDataHandler

public void setCharDataHandler(XMLEntityHandler.CharDataHandler charDataHandler)
Set the character data handler.

getCharDataHandler

public XMLEntityHandler.CharDataHandler getCharDataHandler()
Get the character data handler.


Copyright © 1999-2001 Apache XML Project. All Rights Reserved.