APIdia Launch Partner
Top Fields Constructors Methods
com.sun.xml.internal.stream

public Class XMLEntityStorage

extends Object
Class Inheritance
Imports
com.sun.org.apache.xerces.internal.impl.Constants, .PropertyManager, .XMLEntityManager, .XMLErrorReporter, com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter, com.sun.org.apache.xerces.internal.util.URI, .XMLResourceIdentifierImpl, com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager, .XMLConfigurationException, java.util.HashMap, .Map, jdk.xml.internal.SecuritySupport

Authors
K.Venugopal SUN Microsystems, Neeraj Bajaj SUN Microsystems, Andy Clark, IBM

Field Summary

Modifier and TypeField and Description
protected static final String
ERROR_REPORTER

Property identifier: error reporter.

protected Entity.ScannedEntity
protected Map<String, Entity>
fEntities

Entities.

private XMLEntityManager
protected XMLErrorReporter
fErrorReporter

Error reporter.

protected boolean
protected PropertyManager
protected boolean
fWarnDuplicateEntityDef

warn on duplicate Entity declaration.

private static char[]
private static char[]
private static String
private static char[]
private static boolean[]
private static String
protected static final String
WARN_ON_DUPLICATE_ENTITYDEF

Feature identifier: warn on duplicate EntityDef

Constructor Summary

AccessConstructor and Description
public
XMLEntityStorage(PropertyManager propertyManager)

Creates a new instance of XMLEntityStorage

public
XMLEntityStorage(XMLEntityManager entityManager)

Creates a new instance of XMLEntityStorage

Method Summary

Modifier and TypeMethod and Description
public void
addExternalEntity(String
The name of the entity.
name
,
String
The public identifier of the entity.
publicId
,
String
The system identifier of the entity.
literalSystemId
,
String
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.
baseSystemId
)

Adds an external entity declaration.

public void
addInternalEntity(String
The name of the entity.
name
,
String
The text of the entity.
text
)

Adds an internal entity declaration.

public void
addUnparsedEntity(String
The name of the entity.
name
,
String
The public identifier of the entity.
publicId
,
String
The system identifier of the entity.
systemId
,
String baseSystemId, String
The name of the notation.
notation
)

Adds an unparsed entity declaration.

public void
public static String

Returns:

Returns the URI string representing the expanded system identifier. A null value indicates that the given system identifier is already expanded.
expandSystemId
(String
The systemId to be expanded.
systemId
)

Expands a system id and returns the system id as a URI, if it can be expanded.

public static String

Returns:

Returns the URI string representing the expanded system identifier. A null value indicates that the given system identifier is already expanded.
expandSystemId
(String
The systemId to be expanded.
systemId
,
String baseSystemId)

Expands a system id and returns the system id as a URI, if it can be expanded.

protected static String

Returns:

Returns the fixed URI string.
fixURI
(String
The string to fix.
str
)

Fixes a platform dependent filename to standard URI form.

public Map<String, Entity>
public Entity
getEntity(String
The name of the entity.
name
)

Returns entity declaration.

private static synchronized String
public boolean

Returns:

True if the entity is declared, false otherwise.
isDeclaredEntity
(String
The name of the entity to check.
entityName
)

Checks whether an entity given by name is declared.

public boolean

Returns:

True if the entity was declared in the external subset, false otherwise (including when the entity is not declared).
isEntityDeclInExternalSubset
(String
The name of the entity to check.
entityName
)

Checks whether the declaration of an entity given by name is // in the external subset.

public boolean

Returns:

True if the entity is external, false otherwise (including when the entity is not declared).
isExternalEntity
(String
The name of the entity to check.
entityName
)

Checks whether an entity given by name is external.

public boolean

Returns:

True if the entity is unparsed, false otherwise (including when the entity is not declared).
isUnparsedEntity
(String
The name of the entity to check.
entityName
)

Checks whether an entity given by name is unparsed.

public void
reset(PropertyManager propertyManager)

public void
public void
reset(XMLComponentManager
The component manager.
componentManager
)

Resets the component.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ERROR_REPORTERback to summary
protected static final String ERROR_REPORTER

Property identifier: error reporter.

fCurrentEntityback to summary
protected Entity.ScannedEntity fCurrentEntity
fEntitiesback to summary
protected Map<String, Entity> fEntities

Entities.

fEntityManagerback to summary
private XMLEntityManager fEntityManager
fErrorReporterback to summary
protected XMLErrorReporter fErrorReporter

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

fInExternalSubsetback to summary
protected boolean fInExternalSubset
fPropertyManagerback to summary
protected PropertyManager fPropertyManager
fWarnDuplicateEntityDefback to summary
protected boolean fWarnDuplicateEntityDef

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

gAfterEscaping1back to summary
private static char[] gAfterEscaping1
gAfterEscaping2back to summary
private static char[] gAfterEscaping2
gEscapedUserDirback to summary
private static String gEscapedUserDir
gHexChsback to summary
private static char[] gHexChs
gNeedEscapingback to summary
private static boolean[] gNeedEscaping
gUserDirback to summary
private static String gUserDir
WARN_ON_DUPLICATE_ENTITYDEFback to summary
protected static final String WARN_ON_DUPLICATE_ENTITYDEF

Feature identifier: warn on duplicate EntityDef

Constructor Detail

XMLEntityStorageback to summary
public XMLEntityStorage(PropertyManager propertyManager)

Creates a new instance of XMLEntityStorage

XMLEntityStorageback to summary
public XMLEntityStorage(XMLEntityManager entityManager)

Creates a new instance of XMLEntityStorage

Method Detail

addExternalEntityback to summary
public void addExternalEntity(String name, String publicId, String literalSystemId, 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:String

The name of the entity.

publicId:String

The public identifier of the entity.

literalSystemId:String

The system identifier of the entity.

baseSystemId:String

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
addInternalEntityback to summary
public void addInternalEntity(String name, 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:String

The name of the entity.

text:String

The text of the entity.

See Also
SymbolTable
addUnparsedEntityback to summary
public void addUnparsedEntity(String name, String publicId, String systemId, String baseSystemId, 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:String

The name of the entity.

publicId:String

The public identifier of the entity.

systemId:String

The system identifier of the entity.

notation:String

The name of the notation.

See Also
SymbolTable
endExternalSubsetback to summary
public void endExternalSubset()
expandSystemIdback to summary
public static String expandSystemId(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:String

The systemId to be expanded.

Returns:String

Returns the URI string representing the expanded system identifier. A null value indicates that the given system identifier is already expanded.

expandSystemIdback to summary
public static String expandSystemId(String systemId, 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:String

The systemId to be expanded.

Returns:String

Returns the URI string representing the expanded system identifier. A null value indicates that the given system identifier is already expanded.

fixURIback to summary
protected static String fixURI(String str)

Fixes a platform dependent filename to standard URI form.

Parameters
str:String

The string to fix.

Returns:String

Returns the fixed URI string.

getEntitiesback to summary
public Map<String, Entity> getEntities()
getEntityback to summary
public Entity getEntity(String name)

Returns entity declaration.

Parameters
name:String

The name of the entity.

See Also
SymbolTable
getUserDirback to summary
private static synchronized String getUserDir()
isDeclaredEntityback to summary
public boolean isDeclaredEntity(String entityName)

Checks whether an entity given by name is declared.

Parameters
entityName:String

The name of the entity to check.

Returns:boolean

True if the entity is declared, false otherwise.

isEntityDeclInExternalSubsetback to summary
public boolean isEntityDeclInExternalSubset(String entityName)

Checks whether the declaration of an entity given by name is // in the external subset.

Parameters
entityName:String

The name of the entity to check.

Returns:boolean

True if the entity was declared in the external subset, false otherwise (including when the entity is not declared).

isExternalEntityback to summary
public boolean isExternalEntity(String entityName)

Checks whether an entity given by name is external.

Parameters
entityName:String

The name of the entity to check.

Returns:boolean

True if the entity is external, false otherwise (including when the entity is not declared).

isUnparsedEntityback to summary
public boolean isUnparsedEntity(String entityName)

Checks whether an entity given by name is unparsed.

Parameters
entityName:String

The name of the entity to check.

Returns:boolean

True if the entity is unparsed, false otherwise (including when the entity is not declared).

resetback to summary
public void reset(PropertyManager propertyManager)
resetback to summary
public void reset()
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.
startExternalSubsetback to summary
public void startExternalSubset()