📄 adaptiveresulttreeimpl.java
字号:
{ if (_dom != null) { _dom.setFilter(filter); } else { super.setFilter(filter); } } public void setupMapping(String[] names, String[] uris, int[] types, String[] namespaces) { if (_dom != null) { _dom.setupMapping(names, uris, types, namespaces); } else { super.setupMapping(names, uris, types, namespaces); } } public boolean isElement(final int node) { if (_dom != null) { return _dom.isElement(node); } else { return super.isElement(node); } } public boolean isAttribute(final int node) { if (_dom != null) { return _dom.isAttribute(node); } else { return super.isAttribute(node); } } public String lookupNamespace(int node, String prefix) throws TransletException { if (_dom != null) { return _dom.lookupNamespace(node, prefix); } else { return super.lookupNamespace(node, prefix); } } /** * Return the node identity from a node handle. */ public final int getNodeIdent(final int nodehandle) { if (_dom != null) { return _dom.getNodeIdent(nodehandle); } else { return super.getNodeIdent(nodehandle); } } /** * Return the node handle from a node identity. */ public final int getNodeHandle(final int nodeId) { if (_dom != null) { return _dom.getNodeHandle(nodeId); } else { return super.getNodeHandle(nodeId); } } public DOM getResultTreeFrag(int initialSize, int rtfType) { if (_dom != null) { return _dom.getResultTreeFrag(initialSize, rtfType); } else { return super.getResultTreeFrag(initialSize, rtfType); } } public SerializationHandler getOutputDomBuilder() { return this; } public int getNSType(int node) { if (_dom != null) { return _dom.getNSType(node); } else { return super.getNSType(node); } } public String getUnparsedEntityURI(String name) { if (_dom != null) { return _dom.getUnparsedEntityURI(name); } else { return super.getUnparsedEntityURI(name); } } public Hashtable getElementsWithIDs() { if (_dom != null) { return _dom.getElementsWithIDs(); } else { return super.getElementsWithIDs(); } } /** Implementation of the SerializationHandler interfaces **/ /** The code in some of the following interfaces are copied from SAXAdapter. **/ private void maybeEmitStartElement() throws SAXException { if (_openElementName != null) { int index; if ((index =_openElementName.indexOf(":")) < 0) _dom.startElement(null, _openElementName, _openElementName, _attributes); else { String uri =_dom.getNamespaceURI(_openElementName.substring(0,index)); _dom.startElement(uri, _openElementName.substring(index+1), _openElementName, _attributes); } _openElementName = null; } } // Create and initialize the wrapped SAXImpl object private void prepareNewDOM() throws SAXException { _dom = (SAXImpl)_dtmManager.getDTM(null, true, _wsfilter, true, false, false, _initSize, _buildIdIndex); _dom.startDocument(); // Flush pending Text nodes to SAXImpl for (int i = 0; i < _size; i++) { String str = _textArray[i]; _dom.characters(str.toCharArray(), 0, str.length()); } _size = 0; } public void startDocument() throws SAXException { } public void endDocument() throws SAXException { if (_dom != null) { _dom.endDocument(); } else { super.endDocument(); } } public void characters(String str) throws SAXException { if (_dom != null) { characters(str.toCharArray(), 0, str.length()); } else { super.characters(str); } } public void characters(char[] ch, int offset, int length) throws SAXException { if (_dom != null) { maybeEmitStartElement(); _dom.characters(ch, offset, length); } else { super.characters(ch, offset, length); } } public boolean setEscaping(boolean escape) throws SAXException { if (_dom != null) { return _dom.setEscaping(escape); } else { return super.setEscaping(escape); } } public void startElement(String elementName) throws SAXException { if (_dom == null) { prepareNewDOM(); } maybeEmitStartElement(); _openElementName = elementName; _attributes.clear(); } public void startElement(String uri, String localName, String qName) throws SAXException { startElement(qName); } public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { startElement(qName); } public void endElement(String elementName) throws SAXException { maybeEmitStartElement(); _dom.endElement(null, null, elementName); } public void endElement(String uri, String localName, String qName) throws SAXException { endElement(qName); } public void addUniqueAttribute(String qName, String value, int flags) throws SAXException { addAttribute(qName, value); } public void addAttribute(String name, String value) { if (_openElementName != null) { _attributes.add(name, value); } else { BasisLibrary.runTimeError(BasisLibrary.STRAY_ATTRIBUTE_ERR, name); } } public void namespaceAfterStartElement(String prefix, String uri) throws SAXException { if (_dom == null) { prepareNewDOM(); } _dom.startPrefixMapping(prefix, uri); } public void comment(String comment) throws SAXException { if (_dom == null) { prepareNewDOM(); } maybeEmitStartElement(); char[] chars = comment.toCharArray(); _dom.comment(chars, 0, chars.length); } public void comment(char[] chars, int offset, int length) throws SAXException { if (_dom == null) { prepareNewDOM(); } maybeEmitStartElement(); _dom.comment(chars, offset, length); } public void processingInstruction(String target, String data) throws SAXException { if (_dom == null) { prepareNewDOM(); } maybeEmitStartElement(); _dom.processingInstruction(target, data); } /** Implementation of the DTM interfaces **/ public void setFeature(String featureId, boolean state) { if (_dom != null) { _dom.setFeature(featureId, state); } } public void setProperty(String property, Object value) { if (_dom != null) { _dom.setProperty(property, value); } } public DTMAxisTraverser getAxisTraverser(final int axis) { if (_dom != null) { return _dom.getAxisTraverser(axis); } else { return super.getAxisTraverser(axis); } } public boolean hasChildNodes(int nodeHandle) { if (_dom != null) { return _dom.hasChildNodes(nodeHandle); } else { return super.hasChildNodes(nodeHandle); } } public int getFirstChild(int nodeHandle) { if (_dom != null) { return _dom.getFirstChild(nodeHandle); } else { return super.getFirstChild(nodeHandle); } } public int getLastChild(int nodeHandle) { if (_dom != null) { return _dom.getLastChild(nodeHandle); } else { return super.getLastChild(nodeHandle); } } public int getAttributeNode(int elementHandle, String namespaceURI, String name) { if (_dom != null) { return _dom.getAttributeNode(elementHandle, namespaceURI, name); } else { return super.getAttributeNode(elementHandle, namespaceURI, name); } } public int getFirstAttribute(int nodeHandle) { if (_dom != null) { return _dom.getFirstAttribute(nodeHandle); } else { return super.getFirstAttribute(nodeHandle); } } public int getFirstNamespaceNode(int nodeHandle, boolean inScope) { if (_dom != null) { return _dom.getFirstNamespaceNode(nodeHandle, inScope); } else { return super.getFirstNamespaceNode(nodeHandle, inScope); } } public int getNextSibling(int nodeHandle) { if (_dom != null) { return _dom.getNextSibling(nodeHandle); } else { return super.getNextSibling(nodeHandle); } } public int getPreviousSibling(int nodeHandle) { if (_dom != null) { return _dom.getPreviousSibling(nodeHandle); } else { return super.getPreviousSibling(nodeHandle); } } public int getNextAttribute(int nodeHandle) { if (_dom != null) { return _dom.getNextAttribute(nodeHandle); } else { return super.getNextAttribute(nodeHandle); } } public int getNextNamespaceNode(int baseHandle, int namespaceHandle, boolean inScope) { if (_dom != null) { return _dom.getNextNamespaceNode(baseHandle, namespaceHandle, inScope); } else { return super.getNextNamespaceNode(baseHandle, namespaceHandle, inScope); } } public int getOwnerDocument(int nodeHandle) { if (_dom != null) { return _dom.getOwnerDocument(nodeHandle); } else { return super.getOwnerDocument(nodeHandle); } } public int getDocumentRoot(int nodeHandle) { if (_dom != null) { return _dom.getDocumentRoot(nodeHandle); } else {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -