public class DOMParserImpl extends AbstractDOMParser implements LSParser, DOMConfiguration
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEBUG |
protected static String |
DISALLOW_DOCTYPE_DECL_FEATURE
Feature identifier: disallow docType Decls.
|
protected static String |
DYNAMIC_VALIDATION
Dynamic validation
|
protected boolean |
fBusy |
protected boolean |
fNamespaceDeclarations
Include namespace declaration attributes in the document.
|
protected String |
fSchemaType |
protected static String |
HONOUR_ALL_SCHEMALOCATIONS
Feature identifier: honour all schemaLocations
|
protected static String |
NAMESPACES
Feature identifier: namespaces.
|
protected static String |
NORMALIZE_DATA
Feature identifier: expose schema normalized value
|
protected static String |
PSVI_AUGMENT |
protected static String |
SYMBOL_TABLE |
protected static String |
VALIDATION_FEATURE
Feature id: validation.
|
protected static String |
XMLSCHEMA
XML Schema validation
|
protected static String |
XMLSCHEMA_FULL_CHECKING
XML Schema full checking
|
ABORT, CORE_DOCUMENT_CLASS_NAME, CREATE_CDATA_NODES_FEATURE, CREATE_ENTITY_REF_NODES, CURRENT_ELEMENT_NODE, DEFAULT_DOCUMENT_CLASS_NAME, DEFER_NODE_EXPANSION, DOCUMENT_CLASS_NAME, fBaseURIStack, fCreateCDATANodes, fCreateEntityRefNodes, fCurrentCDATASection, fCurrentCDATASectionIndex, fCurrentEntityDecl, fCurrentNode, fCurrentNodeIndex, fDeferNodeExpansion, fDeferredDocumentImpl, fDeferredEntityDecl, fDocument, fDocumentClassName, fDocumentImpl, fDocumentIndex, fDocumentType, fDocumentTypeIndex, fDOMFilter, fErrorHandler, fFilterReject, fFirstChunk, fInCDATASection, fIncludeComments, fIncludeIgnorableWhitespace, fInDTD, fInDTDExternalSubset, fInEntityRef, fInternalSubset, fNamespaceAware, fRejectedElement, fRoot, fSkippedElemStack, fStorePSVI, fStringBuffer, INCLUDE_COMMENTS_FEATURE, INCLUDE_IGNORABLE_WHITESPACE, PSVI_DOCUMENT_CLASS_NAME
fDocumentSource, fDTDContentModelSource, fDTDSource
ENTITY_RESOLVER, ERROR_HANDLER, fConfiguration
ACTION_APPEND_AS_CHILDREN, ACTION_INSERT_AFTER, ACTION_INSERT_BEFORE, ACTION_REPLACE, ACTION_REPLACE_CHILDREN
CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE
OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCE
Constructor and Description |
---|
DOMParserImpl(String configuration,
String schemaType)
Constructs a DOM Builder using the standard parser configuration.
|
DOMParserImpl(SymbolTable symbolTable)
Constructs a DOM Builder using the specified symbol table.
|
DOMParserImpl(SymbolTable symbolTable,
XMLGrammarPool grammarPool)
Constructs a DOM Builder using the specified symbol table and
grammar pool.
|
DOMParserImpl(XMLParserConfiguration config)
Constructs a DOM Builder using the specified parser configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
abort() |
boolean |
canSetParameter(String name,
Object value) |
boolean |
getAsync() |
boolean |
getBusy() |
DOMConfiguration |
getDomConfig() |
LSParserFilter |
getFilter()
When the application provides a filter, the parser will call out to
the filter at the completion of the construction of each
Element node. |
Object |
getParameter(String name)
Look up the value of a feature or a property.
|
DOMStringList |
getParameterNames()
DOM Level 3 CR - Experimental.
|
Document |
parse(LSInput is)
Parse an XML document from a resource identified by an
LSInput . |
Document |
parseURI(String uri)
Parse an XML document from a location identified by an URI reference.
|
Node |
parseWithContext(LSInput is,
Node cnode,
short action)
Parse an XML document or fragment from a resource identified by an
LSInput and insert the content into an existing
document at the position epcified with the contextNode
and action arguments. |
void |
reset()
Resets the parser state.
|
void |
setFilter(LSParserFilter filter)
When the application provides a filter, the parser will call out to
the filter at the completion of the construction of each
Element node. |
void |
setParameter(String name,
Object value)
Set parameters and properties
|
void |
startElement(QName element,
XMLAttributes attributes,
Augmentations augs)
The start of an element.
|
attributeDecl, characters, comment, createAttrNode, createElementNode, doctypeDecl, dropDocumentReferences, elementDecl, emptyElement, endAttlist, endCDATA, endConditional, endDocument, endDTD, endElement, endExternalSubset, endGeneralEntity, endParameterEntity, externalEntityDecl, getDocument, getDocumentClassName, handleBaseURI, handleBaseURI, ignorableWhitespace, ignoredCharacters, internalEntityDecl, notationDecl, processingInstruction, setCharacterData, setDocumentClassName, setLocale, startAttlist, startCDATA, startConditional, startDocument, startDTD, startExternalSubset, startGeneralEntity, startParameterEntity, textDecl, unparsedEntityDecl, xmlDecl
any, element, empty, endContentModel, endGroup, getDocumentSource, getDTDContentModelSource, getDTDSource, occurrence, pcdata, separator, setDocumentSource, setDTDContentModelSource, setDTDSource, startContentModel, startGroup
protected static final String NAMESPACES
protected static final String VALIDATION_FEATURE
protected static final String XMLSCHEMA
protected static final String XMLSCHEMA_FULL_CHECKING
protected static final String DYNAMIC_VALIDATION
protected static final String NORMALIZE_DATA
protected static final String DISALLOW_DOCTYPE_DECL_FEATURE
protected static final String HONOUR_ALL_SCHEMALOCATIONS
protected static final String SYMBOL_TABLE
protected static final String PSVI_AUGMENT
protected boolean fNamespaceDeclarations
protected String fSchemaType
protected boolean fBusy
protected static final boolean DEBUG
public DOMParserImpl(String configuration, String schemaType)
public DOMParserImpl(XMLParserConfiguration config)
public DOMParserImpl(SymbolTable symbolTable)
public DOMParserImpl(SymbolTable symbolTable, XMLGrammarPool grammarPool)
public void reset()
reset
in class AbstractDOMParser
SAXException
- Thrown on initialization error.public DOMConfiguration getDomConfig()
getDomConfig
in interface LSParser
public LSParserFilter getFilter()
Element
node. The filter implementation can choose to
remove the element from the document being constructed (unless the
element is the document element) or to terminate the parse early. If
the document is being validated when it's loaded the validation
happens before the filter is called.public void setFilter(LSParserFilter filter)
Element
node. The filter implementation can choose to
remove the element from the document being constructed (unless the
element is the document element) or to terminate the parse early. If
the document is being validated when it's loaded the validation
happens before the filter is called.public void setParameter(String name, Object value) throws DOMException
setParameter
in interface DOMConfiguration
DOMException
public Object getParameter(String name) throws DOMException
getParameter
in interface DOMConfiguration
DOMException
public boolean canSetParameter(String name, Object value)
canSetParameter
in interface DOMConfiguration
public DOMStringList getParameterNames()
DOMConfiguration
object and for which at least one value
can be set by the application. Note that this list can also contain
parameter names defined outside this specification.getParameterNames
in interface DOMConfiguration
public Document parseURI(String uri) throws LSException
parseURI
in interface LSParser
LSException
public Document parse(LSInput is) throws LSException
LSInput
.parse
in interface LSParser
LSException
public Node parseWithContext(LSInput is, Node cnode, short action) throws DOMException, LSException
LSInput
and insert the content into an existing
document at the position epcified with the contextNode
and action
arguments. When parsing the input stream the
context node is used for resolving unbound namespace prefixes.parseWithContext
in interface LSParser
is
- The LSInput
from which the source
document is to be read.cnode
- The Node
that is used as the context for
the data that is being parsed.action
- This parameter describes which action should be taken
between the new set of node being inserted and the existing
children of the context node. The set of possible actions is
defined above.DOMException
- HIERARCHY_REQUEST_ERR: Thrown if this action results in an invalid
hierarchy (i.e. a Document with more than one document element).LSException
public boolean getAsync()
getAsync
in interface LSParser
LSParser.getAsync()
public boolean getBusy()
getBusy
in interface LSParser
LSParser.getBusy()
public void abort()
abort
in interface LSParser
abort
in class AbstractDOMParser
LSParser.abort()
public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
startElement
in interface XMLDocumentHandler
startElement
in class AbstractDOMParser
element
- The name of the element.attributes
- The element attributes.augs
- Additional information that may include infoset augmentationsXNIException
- Thrown by handler to signal an error.Copyright © 2018 JBoss by Red Hat. All rights reserved.