ALLOW_JAVA_ENCODINGS
protected static final String ALLOW_JAVA_ENCODINGS
Feature identifier: allow Java encodings.
BUFFER_SIZE
protected static final String BUFFER_SIZE
property identifier: buffer size.
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
Default buffer size (2048).
DEFAULT_INTERNAL_BUFFER_SIZE
public static final int DEFAULT_INTERNAL_BUFFER_SIZE
Default internal entity buffer size (512).
DEFAULT_XMLDECL_BUFFER_SIZE
public static final int DEFAULT_XMLDECL_BUFFER_SIZE
Default buffer size before we've finished with the XMLDecl:
ENTITY_RESOLVER
protected static final String ENTITY_RESOLVER
Property identifier: entity resolver.
ERROR_REPORTER
protected static final String ERROR_REPORTER
Property identifier: error reporter.
EXTERNAL_GENERAL_ENTITIES
protected static final String EXTERNAL_GENERAL_ENTITIES
Feature identifier: external general entities.
EXTERNAL_PARAMETER_ENTITIES
protected static final String EXTERNAL_PARAMETER_ENTITIES
Feature identifier: external parameter entities.
PARSER_SETTINGS
protected static final String PARSER_SETTINGS
SECURITY_MANAGER
protected static final String SECURITY_MANAGER
property identifier: security manager.
STANDARD_URI_CONFORMANT
protected static final String STANDARD_URI_CONFORMANT
Feature identifier: standard uri conformant
SYMBOL_TABLE
protected static final String SYMBOL_TABLE
Property identifier: symbol table.
VALIDATION
protected static final String VALIDATION
Feature identifier: validation.
VALIDATION_MANAGER
protected static final String VALIDATION_MANAGER
WARN_ON_DUPLICATE_ENTITYDEF
protected static final String WARN_ON_DUPLICATE_ENTITYDEF
Feature identifier: warn on duplicate EntityDef
fAllowJavaEncodings
protected boolean fAllowJavaEncodings
Allow Java encoding names. This feature identifier is:
http://apache.org/xml/features/allow-java-encodings
fBufferSize
protected int fBufferSize
Buffer size. We get this value from a property. The default size
is used if the input buffer size property is not specified.
REVISIT: do we need a property for internal entity buffer size?
fDeclaredEntities
protected Hashtable fDeclaredEntities
Shared declared entities.
fEntities
protected Hashtable fEntities
Entities.
fEntityExpansionCount
protected int fEntityExpansionCount
fEntityExpansionLimit
protected int fEntityExpansionLimit
fEntityResolver
protected org.apache.xerces.xni.parser.XMLEntityResolver fEntityResolver
Entity resolver. This property identifier is:
http://apache.org/xml/properties/internal/entity-resolver
fEntityStack
protected Stack fEntityStack
Entity stack.
fErrorReporter
protected XMLErrorReporter fErrorReporter
Error reporter. This property identifier is:
http://apache.org/xml/properties/internal/error-reporter
fExternalGeneralEntities
protected boolean fExternalGeneralEntities
External general entities. This feature identifier is:
http://xml.org/sax/features/external-general-entities
fExternalParameterEntities
protected boolean fExternalParameterEntities
External parameter entities. This feature identifier is:
http://xml.org/sax/features/external-parameter-entities
fInExternalSubset
protected boolean fInExternalSubset
fReaderStack
protected Stack fReaderStack
fStandalone
protected boolean fStandalone
True if the document entity is standalone. This should really
only be set by the document source (e.g. XMLDocumentScanner).
fStrictURI
protected boolean fStrictURI
standard uri conformant (strict uri).
http://apache.org/xml/features/standard-uri-conformant
fSymbolTable
protected SymbolTable fSymbolTable
Symbol table. This property identifier is:
http://apache.org/xml/properties/internal/symbol-table
fValidation
protected boolean fValidation
Validation. This feature identifier is:
http://xml.org/sax/features/validation
fValidationManager
protected ValidationManager fValidationManager
Validation manager. This property identifier is:
http://apache.org/xml/properties/internal/validation-manager
fWarnDuplicateEntityDef
protected boolean fWarnDuplicateEntityDef
warn on duplicate Entity declaration.
http://apache.org/xml/features/warn-on-duplicate-entitydef
fXML10EntityScanner
protected XMLEntityScanner fXML10EntityScanner
XML 1.0 entity scanner.
fXML11EntityScanner
protected XMLEntityScanner fXML11EntityScanner
XML 1.1 entity scanner.
absolutizeAgainstUserDir
public static void absolutizeAgainstUserDir(URI uri)
throws URI.MalformedURIException
Absolutizes a URI using the current value
of the "user.dir" property as the base URI. If
the URI is already absolute, this is a no-op.
uri
- the URI to absolutize
addExternalEntity
public void addExternalEntity(String name,
String publicId,
String literalSystemId,
String baseSystemId)
throws IOException
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.
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.
addInternalEntity
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.
name
- The name of the entity.text
- The text of the entity.
addUnparsedEntity
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.
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.
closeReaders
public void closeReaders()
Close all opened InputStreams and Readers opened by this parser.
createReader
protected Reader createReader(InputStream inputStream,
String encoding,
Boolean isBigEndian)
throws IOException
Creates a reader capable of reading the given input stream in
the specified encoding.
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.
endExternalSubset
public void endExternalSubset()
expandSystemId
public static String expandSystemId(String systemId,
String baseSystemId,
boolean strict)
throws URI.MalformedURIException
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.
systemId
- The systemId to be expanded.
- Returns the URI string representing the expanded system
identifier. A null value indicates that the given
system identifier is already expanded.
fixURI
protected static String fixURI(String str)
Fixes a platform dependent filename to standard URI form.
- Returns the fixed URI string.
getCurrentResourceIdentifier
public org.apache.xerces.xni.XMLResourceIdentifier getCurrentResourceIdentifier()
getEncodingName
protected Object[] getEncodingName(byte[] b4,
int count)
Returns the IANA encoding name that is auto-detected from
the bytes specified, with the endian-ness of that encoding where appropriate.
b4
- The first four bytes of the input.count
- The number of bytes actually read.
- a 2-element array: the first element, an IANA-encoding string,
the second element a Boolean which is true iff the document is big endian, false
if it's little-endian, and null if the distinction isn't relevant.
getEntityScanner
public XMLEntityScanner getEntityScanner()
Returns the entity scanner.
getFeatureDefault
public Boolean getFeatureDefault(String featureId)
Returns the default state for a feature, or null if this
component does not want to report a default value for this
feature.
- getFeatureDefault in interface org.apache.xerces.xni.parser.XMLComponent
featureId
- The feature identifier.
getPropertyDefault
public Object getPropertyDefault(String propertyId)
Returns the default state for a property, or null if this
component does not want to report a default value for this
property.
- getPropertyDefault in interface org.apache.xerces.xni.parser.XMLComponent
propertyId
- The property identifier.
getRecognizedFeatures
public String[] getRecognizedFeatures()
Returns a list of feature identifiers that are recognized by
this component. This method may return null if no features
are recognized by this component.
- getRecognizedFeatures in interface org.apache.xerces.xni.parser.XMLComponent
getRecognizedProperties
public String[] getRecognizedProperties()
Returns a list of property identifiers that are recognized by
this component. This method may return null if no properties
are recognized by this component.
- getRecognizedProperties in interface org.apache.xerces.xni.parser.XMLComponent
isDeclaredEntity
public boolean isDeclaredEntity(String entityName)
Checks whether an entity given by name is declared.
entityName
- The name of the entity to check.
- True if the entity is declared, false otherwise.
isEntityDeclInExternalSubset
public boolean isEntityDeclInExternalSubset(String entityName)
Checks whether the declaration of an entity given by name is
// in the external subset.
entityName
- The name of the entity to check.
- True if the entity was declared in the external subset, false otherwise
(including when the entity is not declared).
isExternalEntity
public boolean isExternalEntity(String entityName)
Checks whether an entity given by name is external.
entityName
- The name of the entity to check.
- True if the entity is external, false otherwise
(including when the entity is not declared).
isStandalone
public boolean isStandalone()
Returns true if the document entity is standalone.
isUnparsedEntity
public boolean isUnparsedEntity(String entityName)
Checks whether an entity given by name is unparsed.
entityName
- The name of the entity to check.
- True if the entity is unparsed, false otherwise
(including when the entity is not declared).
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.
- reset in interface org.apache.xerces.xni.parser.XMLComponent
componentManager
- The component manager.
resolveEntity
public org.apache.xerces.xni.parser.XMLInputSource resolveEntity(org.apache.xerces.xni.XMLResourceIdentifier resourceIdentifier)
throws IOException,
org.apache.xerces.xni.XNIException
Resolves the specified public and system identifiers. This
method first attempts to resolve the entity based on the
EntityResolver registered by the application. If no entity
resolver is registered or if the registered entity handler
is unable to resolve the entity, then default entity
resolution will occur.
- resolveEntity in interface org.apache.xerces.xni.parser.XMLEntityResolver
- Returns an input source that wraps the resolved entity.
This method will never return null.
org.apache.xerces.xni.XNIException
- Thrown by entity resolver to signal an error.
setEntityHandler
public void setEntityHandler(XMLEntityHandler entityHandler)
Sets the entity handler. When an entity starts and ends, the
entity handler is notified of the change.
entityHandler
- The new entity handler.
setFeature
public void setFeature(String featureId,
boolean state)
throws org.apache.xerces.xni.parser.XMLConfigurationException
Sets the state of a feature. This method is called by the component
manager any time after reset when a feature changes state.
Note: Components should silently ignore features
that do not affect the operation of the component.
- setFeature in interface org.apache.xerces.xni.parser.XMLComponent
featureId
- The feature identifier.state
- The state of the feature.
setInstanceFollowRedirects
public static void setInstanceFollowRedirects(HttpURLConnection urlCon,
boolean followRedirects)
Attempt to set whether redirects will be followed for an HttpURLConnection
.
This may fail on earlier JDKs which do not support setting this preference.
setProperty
public void setProperty(String propertyId,
Object value)
throws org.apache.xerces.xni.parser.XMLConfigurationException
Sets the value of a property. This method is called by the component
manager any time after reset when a property changes value.
Note: Components should silently ignore properties
that do not affect the operation of the component.
- setProperty in interface org.apache.xerces.xni.parser.XMLComponent
propertyId
- The property identifier.value
- The value of the property.
setScannerVersion
public void setScannerVersion(short version)
setStandalone
public void setStandalone(boolean standalone)
Sets whether the document entity is standalone.
standalone
- True if document entity is standalone.
setupCurrentEntity
public String setupCurrentEntity(String name,
org.apache.xerces.xni.parser.XMLInputSource xmlInputSource,
boolean literal,
boolean isExternal)
throws IOException,
org.apache.xerces.xni.XNIException
This method uses the passed-in XMLInputSource to make
fCurrentEntity usable for reading.
name
- name of the entity (XML is it's the document entity)xmlInputSource
- the input source, with sufficient information
to begin scanning characters.literal
- True if this entity is started within a
literal value.isExternal
- whether this entity should be treated as an internal or external entity.
- the encoding of the new entity or null if a character stream was employed
startDTDEntity
public void startDTDEntity(org.apache.xerces.xni.parser.XMLInputSource xmlInputSource)
throws IOException,
org.apache.xerces.xni.XNIException
Starts the DTD entity. The DTD entity has the "[dtd]"
pseudo-name.
xmlInputSource
- The input source of the DTD entity.
org.apache.xerces.xni.XNIException
- Thrown by entity handler to signal an error.
startDocumentEntity
public void startDocumentEntity(org.apache.xerces.xni.parser.XMLInputSource xmlInputSource)
throws IOException,
org.apache.xerces.xni.XNIException
Starts the document entity. The document entity has the "[xml]"
pseudo-name.
xmlInputSource
- The input source of the document entity.
org.apache.xerces.xni.XNIException
- Thrown by entity handler to signal an error.
startEntity
public void startEntity(String entityName,
boolean literal)
throws IOException,
org.apache.xerces.xni.XNIException
Starts a named entity.
entityName
- The name of the entity to start.literal
- True if this entity is started within a literal
value.
org.apache.xerces.xni.XNIException
- Thrown by entity handler to signal an error.
startEntity
public void startEntity(String name,
org.apache.xerces.xni.parser.XMLInputSource xmlInputSource,
boolean literal,
boolean isExternal)
throws IOException,
org.apache.xerces.xni.XNIException
Starts an entity.
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.
org.apache.xerces.xni.XNIException
- Thrown by entity handler to signal an error.
startExternalSubset
public void startExternalSubset()