com.sun.xml.stream
Class XMLEntityStorage

java.lang.Object
  extended by com.sun.xml.stream.XMLEntityStorage

public class XMLEntityStorage
extends java.lang.Object

Author:
K.Venugopal SUN Microsystems, Neeraj Bajaj SUN Microsystems, Andy Clark, IBM

Field Summary
protected static java.lang.String ERROR_REPORTER
          Property identifier: error reporter.
protected  Entity.ScannedEntity fCurrentEntity
           
protected  java.util.Hashtable fEntities
          Entities.
protected  XMLErrorReporter fErrorReporter
          Error reporter.
protected  PropertyManager fPropertyManager
           
protected  boolean fWarnDuplicateEntityDef
          warn on duplicate Entity declaration.
protected static java.lang.String WARN_ON_DUPLICATE_ENTITYDEF
          Feature identifier: warn on duplicate EntityDef
 
Constructor Summary
XMLEntityStorage(PropertyManager propertyManager)
          Creates a new instance of XMLEntityStorage
XMLEntityStorage(XMLEntityManager entityManager)
          Creates a new instance of XMLEntityStorage
 
Method Summary
 void addExternalEntity(java.lang.String name, java.lang.String publicId, java.lang.String literalSystemId, java.lang.String baseSystemId)
          Adds an external entity declaration.
 void addInternalEntity(java.lang.String name, java.lang.String text)
          Adds an internal entity declaration.
 void addUnparsedEntity(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String baseSystemId, java.lang.String notation)
          Adds an unparsed entity declaration.
static java.lang.String expandSystemId(java.lang.String systemId)
          Expands a system id and returns the system id as a URI, if it can be expanded.
static java.lang.String expandSystemId(java.lang.String systemId, java.lang.String baseSystemId)
          Expands a system id and returns the system id as a URI, if it can be expanded.
protected static java.lang.String fixURI(java.lang.String str)
          Fixes a platform dependent filename to standard URI form.
 java.util.Hashtable getDeclaredEntities()
          Returns the hashtable of declared entities.
 boolean isDeclaredEntity(java.lang.String entityName)
          Checks whether an entity given by name is declared.
 boolean isEntityDeclInExternalSubset(java.lang.String entityName)
          Checks whether the declaration of an entity given by name is // in the external subset.
 boolean isExternalEntity(java.lang.String entityName)
          Checks whether an entity given by name is external.
 boolean isUnparsedEntity(java.lang.String entityName)
          Checks whether an entity given by name is unparsed.
 void reset()
           
 void reset(PropertyManager propertyManager)
           
 void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
          Resets the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_REPORTER

protected static final java.lang.String ERROR_REPORTER
Property identifier: error reporter.

See Also:
Constant Field Values

WARN_ON_DUPLICATE_ENTITYDEF

protected static final java.lang.String WARN_ON_DUPLICATE_ENTITYDEF
Feature identifier: warn on duplicate EntityDef

See Also:
Constant Field Values

fWarnDuplicateEntityDef

protected boolean fWarnDuplicateEntityDef
warn on duplicate Entity declaration. http://apache.org/xml/features/warn-on-duplicate-entitydef


fEntities

protected java.util.Hashtable fEntities
Entities.


fCurrentEntity

protected Entity.ScannedEntity fCurrentEntity

fErrorReporter

protected XMLErrorReporter fErrorReporter
Error reporter. This property identifier is: http://apache.org/xml/properties/internal/error-reporter


fPropertyManager

protected PropertyManager fPropertyManager
Constructor Detail

XMLEntityStorage

public XMLEntityStorage(PropertyManager propertyManager)
Creates a new instance of XMLEntityStorage


XMLEntityStorage

public XMLEntityStorage(XMLEntityManager entityManager)
Creates a new instance of XMLEntityStorage

Method Detail

reset

public void reset(PropertyManager propertyManager)

reset

public void reset()

reset

public void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
           throws org.apache.xerces.xni.parser.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 - The component manager.
Throws:
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

getDeclaredEntities

public java.util.Hashtable getDeclaredEntities()
Returns the hashtable of declared entities.

REVISIT: This should be done the "right" way by designing a better way to enumerate the declared entities. For now, this method is needed by the constructor that takes an XMLEntityManager parameter. XXX Making this method public, return all the declared entities.

Returns:
Hashtable hastable containing all the declared entities.

addInternalEntity

public void addInternalEntity(java.lang.String name,
                              java.lang.String text)
Adds an internal entity declaration.

Note: This method ignores subsequent entity declarations.

Note: The name should be a unique symbol. The SymbolTable can be used for this purpose.

Parameters:
name - The name of the entity.
text - The text of the entity.
See Also:
SymbolTable

addExternalEntity

public void addExternalEntity(java.lang.String name,
                              java.lang.String publicId,
                              java.lang.String literalSystemId,
                              java.lang.String baseSystemId)
Adds an external entity declaration.

Note: This method ignores subsequent entity declarations.

Note: The name should be a unique symbol. The SymbolTable can be used for this purpose.

Parameters:
name - The name of the entity.
publicId - The public identifier of the entity.
literalSystemId - The system identifier of the entity.
baseSystemId - The base system identifier of the entity. This is the system identifier of the entity where the entity being added and is used to expand the system identifier when the system identifier is a relative URI. When null the system identifier of the first external entity on the stack is used instead.
See Also:
SymbolTable

isExternalEntity

public boolean isExternalEntity(java.lang.String entityName)
Checks whether an entity given by name is external.

Parameters:
entityName - The name of the entity to check.

isEntityDeclInExternalSubset

public boolean isEntityDeclInExternalSubset(java.lang.String entityName)
Checks whether the declaration of an entity given by name is // in the external subset.

Parameters:
entityName - The name of the entity to check.

addUnparsedEntity

public void addUnparsedEntity(java.lang.String name,
                              java.lang.String publicId,
                              java.lang.String systemId,
                              java.lang.String baseSystemId,
                              java.lang.String notation)
Adds an unparsed entity declaration.

Note: This method ignores subsequent entity declarations.

Note: The name should be a unique symbol. The SymbolTable can be used for this purpose.

Parameters:
name - The name of the entity.
publicId - The public identifier of the entity.
systemId - The system identifier of the entity.
notation - The name of the notation.
See Also:
SymbolTable

isUnparsedEntity

public boolean isUnparsedEntity(java.lang.String entityName)
Checks whether an entity given by name is unparsed.

Parameters:
entityName - The name of the entity to check.

isDeclaredEntity

public boolean isDeclaredEntity(java.lang.String entityName)
Checks whether an entity given by name is declared.

Parameters:
entityName - The name of the entity to check.

expandSystemId

public static java.lang.String expandSystemId(java.lang.String systemId)
Expands a system id and returns the system id as a URI, if it can be expanded. A return value of null means that the identifier is already expanded. An exception thrown indicates a failure to expand the id.

Parameters:
systemId - The systemId to be expanded.
Returns:
Returns the URI string representing the expanded system identifier. A null value indicates that the given system identifier is already expanded.

expandSystemId

public static java.lang.String expandSystemId(java.lang.String systemId,
                                              java.lang.String baseSystemId)
Expands a system id and returns the system id as a URI, if it can be expanded. A return value of null means that the identifier is already expanded. An exception thrown indicates a failure to expand the id.

Parameters:
systemId - The systemId to be expanded.
Returns:
Returns the URI string representing the expanded system identifier. A null value indicates that the given system identifier is already expanded.

fixURI

protected static java.lang.String fixURI(java.lang.String str)
Fixes a platform dependent filename to standard URI form.

Parameters:
str - The string to fix.
Returns:
Returns the fixed URI string.


Copyright ? 2002-2003 Apache XML Project. All Rights Reserved.