|
BEA Systems, Inc. | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweblogic.apache.xerces.impl.XMLEntityManager
The entity manager handles the registration of general and parameter entities; resolves entities; and starts entities. The entity manager is a central component in a standard parser configuration and this class works directly with the entity scanner to manage the underlying xni.
This component requires the following features and properties from the component manager that uses it:
Nested Class Summary | |
protected static class |
XMLEntityManager.Entity
Deprecated. Entity information. |
protected class |
XMLEntityManager.EntityScanner
Deprecated. Implements the entity scanner methods. |
protected static class |
XMLEntityManager.ExternalEntity
Deprecated. External entity. |
protected static class |
XMLEntityManager.InternalEntity
Deprecated. Internal entity. |
protected class |
XMLEntityManager.RewindableInputStream
Deprecated. |
protected class |
XMLEntityManager.ScannedEntity
Deprecated. Entity state. |
Field Summary | |
protected static String |
ALLOW_JAVA_ENCODINGS
Deprecated. Feature identifier: allow Java encodings. |
protected static String |
BUFFER_SIZE
Deprecated. property identifier: buffer size. |
static int |
DEFAULT_BUFFER_SIZE
Deprecated. Default buffer size (2048). |
static int |
DEFAULT_INTERNAL_BUFFER_SIZE
Deprecated. Default internal entity buffer size (1024). |
static int |
DEFAULT_XMLDECL_BUFFER_SIZE
Deprecated. Default buffer size before we've finished with the XMLDecl: |
protected static String |
ENTITY_RESOLVER
Deprecated. Property identifier: entity resolver. |
protected static String |
ERROR_REPORTER
Deprecated. Property identifier: error reporter. |
protected static String |
EXTERNAL_GENERAL_ENTITIES
Deprecated. Feature identifier: external general entities. |
protected static String |
EXTERNAL_PARAMETER_ENTITIES
Deprecated. Feature identifier: external parameter entities. |
protected boolean |
fAllowJavaEncodings
Deprecated. Allow Java encoding names. |
protected int |
fBufferSize
Deprecated. Buffer size. |
protected XMLEntityManager.ScannedEntity |
fCurrentEntity
Deprecated. Current entity. |
protected Hashtable |
fDeclaredEntities
Deprecated. Shared declared entities. |
protected Hashtable |
fEntities
Deprecated. Entities. |
protected int |
fEntityExpansionCount
Deprecated. |
protected int |
fEntityExpansionLimit
Deprecated. |
protected XMLEntityHandler |
fEntityHandler
Deprecated. Entity handler. |
protected XMLEntityResolver |
fEntityResolver
Deprecated. Entity resolver. |
protected XMLEntityScanner |
fEntityScanner
Deprecated. Entity scanner. |
protected Stack |
fEntityStack
Deprecated. Entity stack. |
protected XMLErrorReporter |
fErrorReporter
Deprecated. Error reporter. |
protected boolean |
fExternalGeneralEntities
Deprecated. External general entities. |
protected boolean |
fExternalParameterEntities
Deprecated. External parameter entities. |
protected Vector |
fOwnReaders
Deprecated. |
protected SecurityManager |
fSecurityManager
Deprecated. |
protected boolean |
fStandalone
Deprecated. True if the document entity is standalone. |
protected SymbolTable |
fSymbolTable
Deprecated. Symbol table. |
protected boolean |
fValidation
Deprecated. Validation. |
protected ValidationManager |
fValidationManager
Deprecated. Validation manager. |
protected boolean |
fWarnDuplicateEntityDef
Deprecated. warn on duplicate Entity declaration. |
protected static String |
SECURITY_MANAGER
Deprecated. property identifier: security manager. |
protected static String |
SYMBOL_TABLE
Deprecated. Property identifier: symbol table. |
protected static String |
VALIDATION
Deprecated. Feature identifier: validation. |
protected static String |
VALIDATION_MANAGER
Deprecated. |
protected static String |
WARN_ON_DUPLICATE_ENTITYDEF
Deprecated. Feature identifier: warn on duplicate EntityDef |
Constructor Summary | |
XMLEntityManager()
Deprecated. Default constructor. |
|
XMLEntityManager(XMLEntityManager entityManager)
Deprecated. Constructs an entity manager that shares the specified entity declarations during each parse. |
Method Summary | |
void |
addExternalEntity(String name,
String publicId,
String literalSystemId,
String baseSystemId)
Deprecated. Adds an external entity declaration. |
void |
addInternalEntity(String name,
String text)
Deprecated. Adds an internal entity declaration. |
void |
addUnparsedEntity(String name,
String publicId,
String systemId,
String baseSystemId,
String notation)
Deprecated. Adds an unparsed entity declaration. |
void |
closeReaders()
Deprecated. Close all opened InputStreams and Readers opened by this parser. |
protected XMLEntityScanner |
createEntityScanner()
Deprecated. |
protected Reader |
createReader(InputStream inputStream,
String encoding,
Boolean isBigEndian)
Deprecated. Creates a reader capable of reading the given input stream in the specified encoding. |
protected void |
endEntity()
Deprecated. Ends an entity. |
static String |
expandSystemId(String systemId)
Deprecated. Expands a system id and returns the system id as a URI, if it can be expanded. |
static String |
expandSystemId(String systemId,
String baseSystemId)
Deprecated. Expands a system id and returns the system id as a URI, if it can be expanded. |
protected static String |
fixURI(String str)
Deprecated. Fixes a platform dependent filename to standard URI form. |
protected Object[] |
getEncodingName(byte[] b4,
int count)
Deprecated. Returns the IANA encoding name that is auto-detected from the bytes specified, with the endian-ness of that encoding where appropriate. |
XMLEntityScanner |
getEntityScanner()
Deprecated. Returns the entity scanner. |
String[] |
getRecognizedFeatures()
Deprecated. Returns a list of feature identifiers that are recognized by this component. |
String[] |
getRecognizedProperties()
Deprecated. Returns a list of property identifiers that are recognized by this component. |
boolean |
isDeclaredEntity(String entityName)
Deprecated. Checks whether an entity given by name is declared. |
boolean |
isExternalEntity(String entityName)
Deprecated. Checks whether an entity given by name is external. |
boolean |
isStandalone()
Deprecated. Returns true if the document entity is standalone. |
boolean |
isUnparsedEntity(String entityName)
Deprecated. Checks whether an entity given by name is unparsed. |
void |
reset(XMLComponentManager componentManager)
Deprecated. Resets the component. |
XMLInputSource |
resolveEntity(XMLResourceIdentifier resourceIdentifier)
Deprecated. Resolves the specified public and system identifiers. |
void |
setEntityHandler(XMLEntityHandler entityHandler)
Deprecated. Sets the entity handler. |
void |
setFeature(String featureId,
boolean state)
Deprecated. Sets the state of a feature. |
void |
setProperty(String propertyId,
Object value)
Deprecated. Sets the value of a property. |
void |
setStandalone(boolean standalone)
Deprecated. Sets whether the document entity is standalone. |
void |
startDocumentEntity(XMLInputSource xmlInputSource)
Deprecated. Starts the document entity. |
void |
startDTDEntity(XMLInputSource xmlInputSource)
Deprecated. Starts the DTD entity. |
void |
startEntity(String entityName,
boolean literal)
Deprecated. Starts a named entity. |
void |
startEntity(String name,
XMLInputSource xmlInputSource,
boolean literal,
boolean isExternal)
Deprecated. Starts an entity. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final String ALLOW_JAVA_ENCODINGS
protected static final String BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
public static final int DEFAULT_INTERNAL_BUFFER_SIZE
public static final int DEFAULT_XMLDECL_BUFFER_SIZE
protected static final String ENTITY_RESOLVER
protected static final String ERROR_REPORTER
protected static final String EXTERNAL_GENERAL_ENTITIES
protected static final String EXTERNAL_PARAMETER_ENTITIES
protected boolean fAllowJavaEncodings
protected int fBufferSize
protected XMLEntityManager.ScannedEntity fCurrentEntity
protected Hashtable fDeclaredEntities
protected Hashtable fEntities
protected int fEntityExpansionCount
protected int fEntityExpansionLimit
protected XMLEntityHandler fEntityHandler
protected XMLEntityResolver fEntityResolver
protected XMLEntityScanner fEntityScanner
protected Stack fEntityStack
protected XMLErrorReporter fErrorReporter
protected boolean fExternalGeneralEntities
protected boolean fExternalParameterEntities
protected Vector fOwnReaders
protected SecurityManager fSecurityManager
protected boolean fStandalone
protected SymbolTable fSymbolTable
protected boolean fValidation
protected ValidationManager fValidationManager
protected boolean fWarnDuplicateEntityDef
protected static final String SECURITY_MANAGER
protected static final String SYMBOL_TABLE
protected static final String VALIDATION
protected static final String VALIDATION_MANAGER
protected static final String WARN_ON_DUPLICATE_ENTITYDEF
Constructor Detail |
public XMLEntityManager()
public XMLEntityManager(XMLEntityManager entityManager)
REVISIT: We might want to think about the "right" way to expose the list of declared entities. For now, the knowledge how to access the entity declarations is implicit.
Method Detail |
public void addExternalEntity(String name, String publicId, String literalSystemId, String baseSystemId)
Note: This method ignores subsequent entity declarations.
Note: The name should be a unique symbol. The SymbolTable can be used for this purpose.
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.SymbolTable
public void addInternalEntity(String name, String text)
Note: This method ignores subsequent entity declarations.
Note: The name should be a unique symbol. The SymbolTable can be used for this purpose.
name
- The name of the entity.text
- The text of the entity.SymbolTable
public void addUnparsedEntity(String name, String publicId, String systemId, String baseSystemId, String notation)
Note: This method ignores subsequent entity declarations.
Note: The name should be a unique symbol. The SymbolTable can be used for this purpose.
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.SymbolTable
public void closeReaders()
protected XMLEntityScanner createEntityScanner()
protected Reader createReader(InputStream inputStream, String encoding, Boolean isBigEndian) throws IOException
inputStream
- The input stream.encoding
- 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.isBigEndian
- 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.
IOException
protected void endEntity() throws XNIException
XNIException
- Thrown by entity handler to signal an error.public static String expandSystemId(String systemId)
systemId
- The systemId to be expanded.
public static String expandSystemId(String systemId, String baseSystemId)
systemId
- The systemId to be expanded.
protected static String fixURI(String str)
str
- The string to fix.
protected Object[] getEncodingName(byte[] b4, int count)
b4
- The first four bytes of the input.count
- The number of bytes actually read.
public XMLEntityScanner getEntityScanner()
public String[] getRecognizedFeatures()
getRecognizedFeatures
in interface XMLComponent
public String[] getRecognizedProperties()
getRecognizedProperties
in interface XMLComponent
public boolean isDeclaredEntity(String entityName)
entityName
- The name of the entity to check.public boolean isExternalEntity(String entityName)
entityName
- The name of the entity to check.public boolean isStandalone()
public boolean isUnparsedEntity(String entityName)
entityName
- The name of the entity to check.public void reset(XMLComponentManager componentManager) throws XMLConfigurationException
reset
in interface XMLComponent
componentManager
- The component manager.
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.
XMLConfigurationException
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws IOException, XNIException
resolveEntity
in interface XMLEntityResolver
IOException
- Thrown on i/o error.
XNIException
- Thrown by entity resolver to signal an error.XMLResourceIdentifier
public void setEntityHandler(XMLEntityHandler entityHandler)
entityHandler
- The new entity handler.public void setFeature(String featureId, boolean state) throws XMLConfigurationException
Note: Components should silently ignore features that do not affect the operation of the component.
setFeature
in interface XMLComponent
featureId
- The feature identifier.state
- The state of the feature.
SAXNotRecognizedException
- The component should not throw
this exception.
SAXNotSupportedException
- The component should not throw
this exception.
XMLConfigurationException
- Thrown for configuration error.
In general, components should
only throw this exception if
it is really
a critical error.public void setProperty(String propertyId, Object value) throws XMLConfigurationException
Note: Components should silently ignore properties that do not affect the operation of the component.
setProperty
in interface XMLComponent
propertyId
- The property identifier.value
- The value of the property.
SAXNotRecognizedException
- The component should not throw
this exception.
SAXNotSupportedException
- The component should not throw
this exception.
XMLConfigurationException
- Thrown for configuration error.
In general, components should
only throw this exception if
it is really
a critical error.public void setStandalone(boolean standalone)
standalone
- True if document entity is standalone.public void startDocumentEntity(XMLInputSource xmlInputSource) throws IOException, XNIException
xmlInputSource
- The input source of the document entity.
IOException
- Thrown on i/o error.
XNIException
- Thrown by entity handler to signal an error.public void startDTDEntity(XMLInputSource xmlInputSource) throws IOException, XNIException
xmlInputSource
- The input source of the DTD entity.
IOException
- Thrown on i/o error.
XNIException
- Thrown by entity handler to signal an error.public void startEntity(String entityName, boolean literal) throws IOException, XNIException
entityName
- The name of the entity to start.literal
- True if this entity is started within a literal
value.
IOException
- Thrown on i/o error.
XNIException
- Thrown by entity handler to signal an error.public void startEntity(String name, XMLInputSource xmlInputSource, boolean literal, boolean isExternal) throws IOException, XNIException
This method can be used to insert an application defined XML entity stream into the parsing stream.
name
- The name of the entity.xmlInputSource
- The input source of the entity.literal
- True if this entity is started within a
literal value.isExternal
- whether this entity should be treated as an internal or external entity.
IOException
- Thrown on i/o error.
XNIException
- Thrown by entity handler to signal an error.
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs90 Copyright 2005 BEA Systems Inc. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |