All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface org.xml.sax.EntityHandler

public interface EntityHandler
A callback interface for basic XML entity-related events.

This interface is part of the Java implementation of SAX, the Simple API for XML. It is free for both commercial and non-commercial use, and is distributed with no warrantee, real or implied.

If you do not set an entity handler, then a parser will resolve all entities to the suggested system ID, and will take no action for entity changes.

Author:
David Megginson, Microstar Software Ltd.
See Also:
setEntityHandler

Method Index

 o changeEntity(String)
Handle a change in the current entity.
 o resolveEntity(String, String, String)
Resolve a system identifier.

Methods

 o resolveEntity
 public abstract String resolveEntity(String ename,
                                      String publicID,
                                      String systemID) throws Exception
Resolve a system identifier.

Before loading any entity (including the document entity), SAX parsers will filter the system identifier through this callback, and you can return a different system identifier if you wish, or null to prevent the parser from reading any entity.

Parameters:
ename - The name of the entity, "[document]" for the document entity, or "[external DTD]" for the external DTD subset.
publicID - The public identifier, or null if there is none.
systemID - The system identifier suggested in the XML document.
Returns:
A system identifier, or null to skip the entity.
Throws: Exception
You may throw any exception.
 o changeEntity
 public abstract void changeEntity(String systemID) throws Exception
Handle a change in the current entity.

Whenever the parser switches the entity (URI) that it is reading from, it will call this handler to report the change.

Parameters:
systemID - The URI of the new entity.
Throws: Exception
You may throw any exception.

All Packages  Class Hierarchy  This Package  Previous  Next  Index