public class EPPSchemaCachingParser extends javax.xml.parsers.DocumentBuilder implements EPPSchemaCacher
EPPFactory
for improved XML parsing performance.Modifier and Type | Field and Description |
---|---|
static int |
BIG_PRIME
A default prime number to use for the SymbolTable size.
|
static java.lang.String |
CREATE_ENTITY_REF_NODES
True: Create EntityReference nodes in the DOM tree.
|
static java.lang.String |
DEFER_NODE_EXPANSION
Constant for setting the defer node expansion parser feature.
|
static java.lang.String |
EXTERNAL_GENERAL_ENTITIES
True: Include external general entities.
|
static java.lang.String |
EXTERNAL_PARAMETER_ENTITIES
True: Include external parameter entities and the external DTD subset.
|
static java.lang.String |
INCLUDE_IGNORABLE_WHITE_SPACE
True: Include text nodes that can be considered "ignorable whitespace" in
the DOM tree.
|
static java.lang.String |
LOAD_DTD_GRAMMAR
True: Load the DTD and use it to add default attributes and set attribute
types when parsing.
|
static java.lang.String |
LOAD_EXTERNAL_DTD
Apache constant for loading external DTD's when they are seen in the
instance document
|
static java.lang.String |
NAMESPACES_FEATURE_ID
Namespaces feature id (http://xml.org/sax/features/namespaces)
|
static java.lang.String |
NORMALIZE_DATA
attempt to normalize data in an entity reference or CDATA section.
|
static java.lang.String |
POOL
Name of the EPP XML Parser Pool managed by
GenericPoolManager |
static java.lang.String |
SCHEMA_FULL_CHECKING_FEATURE_ID
Schema full checking feature id
(http://apache.org/xml/features/validation/schema-full-checking).
|
static java.lang.String |
SCHEMA_VALIDATION_FEATURE_ID
Schema validation feature id
(http://apache.org/xml/features/validation/schema).
|
protected static java.lang.String |
SYMBOL_TABLE
Property identifier: The symbol table feature
|
static java.lang.String |
VALIDATION_FEATURE_ID
Validation feature id (http://xml.org/sax/features/validation).
|
static java.lang.String |
XMLGRAMMAR_POOL
Property identifier: The XML Grammar pool feature
|
Constructor and Description |
---|
EPPSchemaCachingParser()
Create a new instance of EPPSchemaCachingParser.
|
EPPSchemaCachingParser(int aSymbolTableSize)
Creates an EPPSchemaCachingParser instance with the specified symboltable
size
|
Modifier and Type | Method and Description |
---|---|
void |
addSchemaToCache(org.apache.xerces.xni.parser.XMLInputSource aSchema)
Addes the XMLInputSource instance to the current cache of schemas.
|
org.w3c.dom.DOMImplementation |
getDOMImplementation()
Returns the DOM implementation
|
boolean |
getFeature(java.lang.String aFeatureId)
Query the state of a feature.
|
java.lang.Object |
getProperty(java.lang.String aPropertyId)
Query the value of a property.
|
int |
getSymbolTableSize()
Gets the symbol table size
|
protected java.util.Set<java.lang.String> |
getXmlSchemas()
Gets the XML schemas to pre-load into the XML parser.
|
protected void |
init()
Helper method to initialize this instance of
EPPSchemaCachingParser . |
boolean |
isNamespaceAware()
Returns true if the parser is setup to be Namespace aware, false
otherwise.
|
boolean |
isValidating()
Returns true if this parser is setup to validate XML instances, false
otherwise
|
org.w3c.dom.Document |
newDocument()
Non-preferred: use the getDOMImplementation() method instead of this one
to get a DOM Level 2 DOMImplementation object and then use DOM Level 2
methods to create a DOM Document object.
|
org.w3c.dom.Document |
parse(java.io.File aFile)
Parse a file to a DOM Document.
|
org.w3c.dom.Document |
parse(org.xml.sax.InputSource aXmlInstance)
Parses the InputSource passed in which should be an XML instance.
|
org.w3c.dom.Document |
parse(java.io.InputStream aInputStream)
Implemented as part of standard Document Builder API.
|
org.w3c.dom.Document |
parse(java.io.InputStream aInputStream,
java.lang.String aSystemId)
Implemented as part of standard Document Builder API.
|
org.w3c.dom.Document |
parse(java.lang.String aUri)
Implemented as part of standard Document Builder API.
|
protected void |
preloadSchemas()
Pre-load the XML schemas into the parser based on the
EPPFactory
XML schemas. |
void |
setEntityResolver(org.xml.sax.EntityResolver aEntityResolver)
Sets the EntityResolver of this DocumentBuilder
|
void |
setErrorHandler(org.xml.sax.ErrorHandler aErrorHandler)
Sets the ErrorHandler this DocumentBuilder instance.
|
void |
setFeature(java.lang.String aFeatureId,
boolean aBoolean)
Set the state of any feature in a SAX2 parser.
|
void |
setLockSchemaCache(boolean aBoolean)
Lock the schema cache.
|
void |
setProperty(java.lang.String aProperty,
java.lang.Object aObject)
Set the state of any property in a SAX2 parser.
|
void |
setSymbolTableSize(int aSymbolTableSize)
Sets the symbol table size.
|
public static final java.lang.String POOL
GenericPoolManager
public static final int BIG_PRIME
public static final java.lang.String NAMESPACES_FEATURE_ID
public static final java.lang.String VALIDATION_FEATURE_ID
public static final java.lang.String SCHEMA_VALIDATION_FEATURE_ID
public static final java.lang.String SCHEMA_FULL_CHECKING_FEATURE_ID
public static final java.lang.String XMLGRAMMAR_POOL
protected static final java.lang.String SYMBOL_TABLE
public static final java.lang.String DEFER_NODE_EXPANSION
public static final java.lang.String LOAD_EXTERNAL_DTD
public static final java.lang.String LOAD_DTD_GRAMMAR
public static final java.lang.String CREATE_ENTITY_REF_NODES
public static final java.lang.String INCLUDE_IGNORABLE_WHITE_SPACE
public static final java.lang.String EXTERNAL_GENERAL_ENTITIES
public static final java.lang.String EXTERNAL_PARAMETER_ENTITIES
public static final java.lang.String NORMALIZE_DATA
public EPPSchemaCachingParser()
public EPPSchemaCachingParser(int aSymbolTableSize)
aSymbolTableSize
- protected void init() throws EPPParserException
EPPSchemaCachingParser
.EPPParserException
- Error initializing EPPSchemaCachingParser
protected java.util.Set<java.lang.String> getXmlSchemas()
protected void preloadSchemas() throws EPPParserException
EPPFactory
XML schemas. A derived class can customize what XML schemas to pre-load.EPPParserException
- Error loading the XML schemas into the parserpublic void setLockSchemaCache(boolean aBoolean)
setLockSchemaCache
in interface EPPSchemaCacher
aBoolean
- True param locks it, false unlocks itpublic void addSchemaToCache(org.apache.xerces.xni.parser.XMLInputSource aSchema) throws EPPParserException
addSchemaToCache
in interface EPPSchemaCacher
aSchema
- The schema instance to be cachedEPPParserException
- Error adding schema to the cachepublic boolean isNamespaceAware()
isNamespaceAware
in class javax.xml.parsers.DocumentBuilder
java.lang.IllegalStateException
- Parser is not in a state to query it's propertiespublic void setEntityResolver(org.xml.sax.EntityResolver aEntityResolver)
setEntityResolver
in class javax.xml.parsers.DocumentBuilder
aEntityResolver
- The EntityResolver instance that this DocumentBuilder will use
when parsing.public org.w3c.dom.DOMImplementation getDOMImplementation()
getDOMImplementation
in class javax.xml.parsers.DocumentBuilder
public org.w3c.dom.Document newDocument()
newDocument
in class javax.xml.parsers.DocumentBuilder
public org.w3c.dom.Document parse(org.xml.sax.InputSource aXmlInstance) throws org.xml.sax.SAXException, java.io.IOException
parse
in class javax.xml.parsers.DocumentBuilder
aXmlInstance
- The XML instance to parseorg.xml.sax.SAXException
- Thrown if any errors occurjava.io.IOException
- Thrown if any errors occurjava.lang.IllegalArgumentException
- DOCUMENT ME!public org.w3c.dom.Document parse(java.io.InputStream aInputStream, java.lang.String aSystemId) throws org.xml.sax.SAXException, java.io.IOException
parse
in class javax.xml.parsers.DocumentBuilder
aInputStream
- The InputStream instance to parseaSystemId
- org.xml.sax.SAXException
java.io.IOException
public org.w3c.dom.Document parse(java.lang.String aUri) throws org.xml.sax.SAXException, java.io.IOException
parse
in class javax.xml.parsers.DocumentBuilder
aUri
- The URI to parseorg.xml.sax.SAXException
java.io.IOException
public org.w3c.dom.Document parse(java.io.InputStream aInputStream) throws org.xml.sax.SAXException, java.io.IOException
parse
in class javax.xml.parsers.DocumentBuilder
aInputStream
- The InputStream to parseorg.xml.sax.SAXException
java.io.IOException
public org.w3c.dom.Document parse(java.io.File aFile) throws org.xml.sax.SAXException, java.io.IOException
parse
in class javax.xml.parsers.DocumentBuilder
aFile
- XML file to parse to a DOM Documentjava.io.IOException
- Error opening XML fileorg.xml.sax.SAXException
- Error parsing XML filepublic void setErrorHandler(org.xml.sax.ErrorHandler aErrorHandler)
setErrorHandler
in class javax.xml.parsers.DocumentBuilder
aErrorHandler
- The ErrorHandler instance to usepublic boolean isValidating()
isValidating
in class javax.xml.parsers.DocumentBuilder
java.lang.IllegalStateException
- Error setting the validation featurepublic int getSymbolTableSize()
public void setSymbolTableSize(int aSymbolTableSize) throws EPPParserException
aSymbolTableSize
- The new value of the symbol table sizeEPPParserException
- Error setting the symbol table sizepublic void setFeature(java.lang.String aFeatureId, boolean aBoolean) throws org.xml.sax.SAXNotSupportedException, org.xml.sax.SAXNotRecognizedException
aFeatureId
- The unique identifier (URI) of the feature.aBoolean
- The requested state of the feature (true or false).org.xml.sax.SAXNotSupportedException
- If the requested feature is known, but the requested state
is not supported.org.xml.sax.SAXNotRecognizedException
- If the requested feature is not known.public void setProperty(java.lang.String aProperty, java.lang.Object aObject) throws org.xml.sax.SAXNotSupportedException, org.xml.sax.SAXNotRecognizedException
aProperty
- The unique identifier (URI) of the feature.aObject
- The requested state of the feature (true or false).org.xml.sax.SAXNotSupportedException
- If the requested feature is known, but the requested state
is not supported.org.xml.sax.SAXNotRecognizedException
- If the requested feature is not known.public boolean getFeature(java.lang.String aFeatureId) throws org.xml.sax.SAXNotSupportedException, org.xml.sax.SAXNotRecognizedException
aFeatureId
- The unique identifier (URI) of the feature being set.org.xml.sax.SAXNotSupportedException
- If the requested feature is known but not supported.org.xml.sax.SAXNotRecognizedException
- If the requested feature is not known.public java.lang.Object getProperty(java.lang.String aPropertyId) throws org.xml.sax.SAXNotSupportedException, org.xml.sax.SAXNotRecognizedException
aPropertyId
- The unique identifier (URI) of the property being set.org.xml.sax.SAXNotSupportedException
- If the requested property is known but not supported.org.xml.sax.SAXNotRecognizedException
- If the requested property is not known.Copyright © VeriSign Inc. All Rights Reserved.