code
stringlengths
11
173k
docstring
stringlengths
2
593k
func_name
stringlengths
2
189
language
stringclasses
1 value
repo
stringclasses
833 values
path
stringlengths
11
294
url
stringlengths
60
339
license
stringclasses
4 values
public final Node replaceChild(Node newChild, Node oldChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
@param newChild @param oldChild @throws DOMException @see org.w3c.dom.Node -- DTMNodeProxy is read-only
DTMNodeProxy::replaceChild
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Node removeChild(Node oldChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
@param oldChild @throws DOMException @see org.w3c.dom.Node -- DTMNodeProxy is read-only
DTMNodeProxy::removeChild
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Node appendChild(Node newChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
@param newChild @throws DOMException @see org.w3c.dom.Node -- DTMNodeProxy is read-only
DTMNodeProxy::appendChild
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Node cloneNode(boolean deep) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param deep @see org.w3c.dom.Node -- DTMNodeProxy is read-only
DTMNodeProxy::cloneNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final DocumentType getDoctype() { return null; }
@see org.w3c.dom.Document
DTMNodeProxy::getDoctype
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Element getDocumentElement() { int dochandle=dtm.getDocument(); int elementhandle=DTM.NULL; for(int kidhandle=dtm.getFirstChild(dochandle); kidhandle!=DTM.NULL; kidhandle=dtm.getNextSibling(kidhandle)) { switch(dtm.getNodeType(kidhandle)) { case Node.ELEMENT_NODE: if(elementhandle!=DTM.NULL) { elementhandle=DTM.NULL; // More than one; ill-formed. kidhandle=dtm.getLastChild(dochandle); // End loop } else elementhandle=kidhandle; break; // These are harmless; document is still wellformed case Node.COMMENT_NODE: case Node.PROCESSING_INSTRUCTION_NODE: case Node.DOCUMENT_TYPE_NODE: break; default: elementhandle=DTM.NULL; // ill-formed kidhandle=dtm.getLastChild(dochandle); // End loop break; } } if(elementhandle==DTM.NULL) throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); else return (Element)(dtm.getNode(elementhandle)); }
This is a bit of a problem in DTM, since a DTM may be a Document Fragment and hence not have a clear-cut Document Element. We can make it work in the well-formed cases but would that be confusing for others? @see org.w3c.dom.Document
DTMNodeProxy::getDocumentElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Element createElement(String tagName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param tagName @throws DOMException @see org.w3c.dom.Document
DTMNodeProxy::createElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Text createTextNode(String data) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param data @see org.w3c.dom.Document
DTMNodeProxy::createTextNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final CDATASection createCDATASection(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param data @throws DOMException @see org.w3c.dom.Document
DTMNodeProxy::createCDATASection
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final ProcessingInstruction createProcessingInstruction( String target, String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param target @param data @throws DOMException @see org.w3c.dom.Document
DTMNodeProxy::createProcessingInstruction
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Attr createAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param name @throws DOMException @see org.w3c.dom.Document
DTMNodeProxy::createAttribute
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final NodeList getElementsByTagName(String tagname) { Vector listVector = new Vector(); Node retNode = dtm.getNode(node); if (retNode != null) { boolean isTagNameWildCard = "*".equals(tagname); if (DTM.ELEMENT_NODE == retNode.getNodeType()) { NodeList nodeList = retNode.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { traverseChildren(listVector, nodeList.item(i), tagname, isTagNameWildCard); } } else if (DTM.DOCUMENT_NODE == retNode.getNodeType()) { traverseChildren(listVector, dtm.getNode(node), tagname, isTagNameWildCard); } } int size = listVector.size(); NodeSet nodeSet = new NodeSet(size); for (int i = 0; i < size; i++) { nodeSet.addNode((Node) listVector.elementAt(i)); } return (NodeList) nodeSet; }
@param tagname @see org.w3c.dom.Document
DTMNodeProxy::getElementsByTagName
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
private final void traverseChildren ( Vector listVector, Node tempNode, String tagname, boolean isTagNameWildCard) { if (tempNode == null) { return; } else { if (tempNode.getNodeType() == DTM.ELEMENT_NODE && (isTagNameWildCard || tempNode.getNodeName().equals(tagname))) { listVector.add(tempNode); } if(tempNode.hasChildNodes()) { NodeList nodeList = tempNode.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { traverseChildren(listVector, nodeList.item(i), tagname, isTagNameWildCard); } } } }
@param listVector @param tempNode @param tagname @param isTagNameWildCard Private method to be used for recursive iterations to obtain elements by tag name.
DTMNodeProxy::traverseChildren
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Node importNode(Node importedNode, boolean deep) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
@param importedNode @param deep @throws DOMException @see org.w3c.dom.Document as of DOM Level 2 -- DTMNodeProxy is read-only
DTMNodeProxy::importNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Element createElementNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param namespaceURI @param qualifiedName @throws DOMException @see org.w3c.dom.Document as of DOM Level 2
DTMNodeProxy::createElementNS
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final NodeList getElementsByTagNameNS(String namespaceURI, String localName) { Vector listVector = new Vector(); Node retNode = dtm.getNode(node); if (retNode != null) { boolean isNamespaceURIWildCard = "*".equals(namespaceURI); boolean isLocalNameWildCard = "*".equals(localName); if (DTM.ELEMENT_NODE == retNode.getNodeType()) { NodeList nodeList = retNode.getChildNodes(); for(int i = 0; i < nodeList.getLength(); i++) { traverseChildren(listVector, nodeList.item(i), namespaceURI, localName, isNamespaceURIWildCard, isLocalNameWildCard); } } else if(DTM.DOCUMENT_NODE == retNode.getNodeType()) { traverseChildren(listVector, dtm.getNode(node), namespaceURI, localName, isNamespaceURIWildCard, isLocalNameWildCard); } } int size = listVector.size(); NodeSet nodeSet = new NodeSet(size); for (int i = 0; i < size; i++) { nodeSet.addNode((Node)listVector.elementAt(i)); } return (NodeList) nodeSet; }
@param namespaceURI @param localName @see org.w3c.dom.Document as of DOM Level 2
DTMNodeProxy::getElementsByTagNameNS
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
private final void traverseChildren ( Vector listVector, Node tempNode, String namespaceURI, String localname, boolean isNamespaceURIWildCard, boolean isLocalNameWildCard) { if (tempNode == null) { return; } else { if (tempNode.getNodeType() == DTM.ELEMENT_NODE && (isLocalNameWildCard || tempNode.getLocalName().equals(localname))) { String nsURI = tempNode.getNamespaceURI(); if ((namespaceURI == null && nsURI == null) || isNamespaceURIWildCard || (namespaceURI != null && namespaceURI.equals(nsURI))) { listVector.add(tempNode); } } if(tempNode.hasChildNodes()) { NodeList nl = tempNode.getChildNodes(); for(int i = 0; i < nl.getLength(); i++) { traverseChildren(listVector, nl.item(i), namespaceURI, localname, isNamespaceURIWildCard, isLocalNameWildCard); } } } }
@param listVector @param tempNode @param namespaceURI @param localname @param isNamespaceURIWildCard @param isLocalNameWildCard Private method to be used for recursive iterations to obtain elements by tag name and namespaceURI.
DTMNodeProxy::traverseChildren
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Element getElementById(String elementId) { return (Element) dtm.getNode(dtm.getElementById(elementId)); }
@param elementId @see org.w3c.dom.Document as of DOM Level 2
DTMNodeProxy::getElementById
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Text splitText(int offset) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param offset @throws DOMException @see org.w3c.dom.Text
DTMNodeProxy::splitText
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final String getData() throws DOMException { return dtm.getNodeValue(node); }
@throws DOMException @see org.w3c.dom.CharacterData
DTMNodeProxy::getData
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void setData(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param data @throws DOMException @see org.w3c.dom.CharacterData
DTMNodeProxy::setData
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final int getLength() { // %OPT% This should do something smarter? return dtm.getNodeValue(node).length(); }
@see org.w3c.dom.CharacterData
DTMNodeProxy::getLength
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final String substringData(int offset, int count) throws DOMException { return getData().substring(offset,offset+count); }
@param offset @param count @throws DOMException @see org.w3c.dom.CharacterData
DTMNodeProxy::substringData
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void appendData(String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param arg @throws DOMException @see org.w3c.dom.CharacterData
DTMNodeProxy::appendData
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void insertData(int offset, String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param offset @param arg @throws DOMException @see org.w3c.dom.CharacterData
DTMNodeProxy::insertData
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void deleteData(int offset, int count) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param offset @param count @throws DOMException @see org.w3c.dom.CharacterData
DTMNodeProxy::deleteData
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void replaceData(int offset, int count, String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param offset @param count @param arg @throws DOMException @see org.w3c.dom.CharacterData
DTMNodeProxy::replaceData
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final String getTagName() { return dtm.getNodeName(node); }
@see org.w3c.dom.Element
DTMNodeProxy::getTagName
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final String getAttribute(String name) { DTMNamedNodeMap map = new DTMNamedNodeMap(dtm, node); Node node = map.getNamedItem(name); return (null == node) ? EMPTYSTRING : node.getNodeValue(); }
@param name @see org.w3c.dom.Element
DTMNodeProxy::getAttribute
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void setAttribute(String name, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param name @param value @throws DOMException @see org.w3c.dom.Element
DTMNodeProxy::setAttribute
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void removeAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param name @throws DOMException @see org.w3c.dom.Element
DTMNodeProxy::removeAttribute
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Attr setAttributeNode(Attr newAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param newAttr @throws DOMException @see org.w3c.dom.Element
DTMNodeProxy::setAttributeNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Attr removeAttributeNode(Attr oldAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param oldAttr @throws DOMException @see org.w3c.dom.Element
DTMNodeProxy::removeAttributeNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public boolean hasAttributes() { return DTM.NULL != dtm.getFirstAttribute(node); }
Introduced in DOM Level 2.
DTMNodeProxy::hasAttributes
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void normalize() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
Introduced in DOM Level 2. public boolean hasAttributes() { return DTM.NULL != dtm.getFirstAttribute(node); } /** @see org.w3c.dom.Element
DTMNodeProxy::normalize
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final String getAttributeNS(String namespaceURI, String localName) { Node retNode = null; int n = dtm.getAttributeNode(node,namespaceURI,localName); if(n != DTM.NULL) retNode = dtm.getNode(n); return (null == retNode) ? EMPTYSTRING : retNode.getNodeValue(); }
@param namespaceURI @param localName @see org.w3c.dom.Element
DTMNodeProxy::getAttributeNS
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void setAttributeNS( String namespaceURI, String qualifiedName, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param namespaceURI @param qualifiedName @param value @throws DOMException @see org.w3c.dom.Element
DTMNodeProxy::setAttributeNS
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void removeAttributeNS(String namespaceURI, String localName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param namespaceURI @param localName @throws DOMException @see org.w3c.dom.Element
DTMNodeProxy::removeAttributeNS
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final String getName() { return dtm.getNodeName(node); }
@see org.w3c.dom.Attr
DTMNodeProxy::getName
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final void setValue(String value) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
@param value @see org.w3c.dom.Attr
DTMNodeProxy::setValue
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public final Element getOwnerElement() { if (getNodeType() != Node.ATTRIBUTE_NODE) return null; // In XPath and DTM data models, unlike DOM, an Attr's parent is its // owner element. int newnode = dtm.getParent(node); return (newnode == DTM.NULL) ? null : (Element)(dtm.getNode(newnode)); }
Get the owner element of an attribute. @see org.w3c.dom.Attr as of DOM Level 2
DTMNodeProxy::getOwnerElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public Node adoptNode(Node source) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
NEEDSDOC Method adoptNode NEEDSDOC @param source @throws DOMException
DTMNodeProxy::adoptNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public String getInputEncoding() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
<p>Based on the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification of 07 April 2004.</a>. <p> An attribute specifying, as part of the XML declaration, the encoding of this document. This is <code>null</code> when unspecified. @since DOM Level 3
DTMNodeProxy::getInputEncoding
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public boolean getStrictErrorChecking() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
<p>Based on the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification of 07 April 2004.</a>. <p> An attribute specifying whether errors checking is enforced or not. When set to <code>false</code>, the implementation is free to not test every possible error case normally defined on DOM operations, and not raise any <code>DOMException</code>. In case of error, the behavior is undefined. This attribute is <code>true</code> by defaults. @since DOM Level 3
DTMNodeProxy::getStrictErrorChecking
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public boolean hasFeature(String feature,String version) { if( ("CORE".equals(feature.toUpperCase()) || "XML".equals(feature.toUpperCase())) && ("1.0".equals(version) || "2.0".equals(version)) ) return true; return false; }
Ask whether we support a given DOM feature. In fact, we do not _fully_ support any DOM feature -- we're a read-only subset -- so arguably we should always return false. On the other hand, it may be more practically useful to return true and simply treat the whole DOM as read-only, failing on the methods we can't support. I'm not sure which would be more useful to the caller.
DTMNodeProxyImplementation::hasFeature
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public Object getFeature(String feature, String version) { // we don't have any alternate node, either this node does the job // or we don't have anything that does //return hasFeature(feature, version) ? this : null; return null; //PENDING }
This method returns a specialized object which implements the specialized APIs of the specified feature and version. The specialized object may also be obtained by using binding-specific casting methods but is not necessarily expected to, as discussed in Mixed DOM implementations . @param feature The name of the feature requested (case-insensitive). @param version This is the version number of the feature to test. If the version is <code>null</code> or the empty string, supporting any version of the feature will cause the method to return an object that supports at least one version of the feature. @return Returns an object which implements the specialized APIs of the specified feature and version, if any, or <code>null</code> if there is no object which implements interfaces associated with that feature. If the <code>DOMObject</code> returned by this method implements the <code>Node</code> interface, it must delegate to the primary core <code>Node</code> and not return results inconsistent with the primary core <code>Node</code> such as attributes, childNodes, etc. @since DOM Level 3
DTMNodeProxyImplementation::getFeature
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java
Apache-2.0
public Node item(int index) { return null; }
Returns the <code>index</code>th item in the collection. If <code>index</code> is greater than or equal to the number of nodes in the list, this returns <code>null</code>. @param index Index into the collection. @return The node at the <code>index</code>th position in the <code>NodeList</code>, or <code>null</code> if that is not a valid index.
DTMNodeListBase::item
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeListBase.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeListBase.java
Apache-2.0
public int getLength() { return 0; }
The number of nodes in the list. The range of valid child node indices is 0 to <code>length-1</code> inclusive.
DTMNodeListBase::getLength
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeListBase.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeListBase.java
Apache-2.0
public IncrementalSAXSource_Filter(CoroutineManager co, int controllerCoroutineID) { this.init( co, controllerCoroutineID, -1 ); }
Create a IncrementalSAXSource_Filter which is not yet bound to a specific SAX event source. *
IncrementalSAXSource_Filter::IncrementalSAXSource_Filter
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
Apache-2.0
public void setXMLReader(XMLReader eventsource) { fXMLReader=eventsource; eventsource.setContentHandler(this); eventsource.setDTDHandler(this); eventsource.setErrorHandler(this); // to report fatal errors in filtering mode // Not supported by all SAX2 filters: try { eventsource. setProperty("http://xml.org/sax/properties/lexical-handler", this); } catch(SAXNotRecognizedException e) { // Nothing we can do about it } catch(SAXNotSupportedException e) { // Nothing we can do about it } // Should we also bind as other varieties of handler? // (DTDHandler and so on) }
Bind our input streams to an XMLReader. Just a convenience routine; obviously you can explicitly register this as a listener with the same effect. *
IncrementalSAXSource_Filter::setXMLReader
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
Apache-2.0
public CoroutineManager getCoroutineManager() { return fCoroutineManager; }
@return the CoroutineManager this CoroutineFilter object is bound to. If you're using the do...() methods, applications should only need to talk to the CoroutineManager once, to obtain the application's Coroutine ID. *
IncrementalSAXSource_Filter::getCoroutineManager
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
Apache-2.0
protected void count_and_yield(boolean moreExpected) throws SAXException { if(!moreExpected) eventcounter=0; if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } }
<p>In the SAX delegation code, I've inlined the count-down in the hope of encouraging compilers to deliver better performance. However, if we subclass (eg to directly connect the output to a DTM builder), that would require calling super in order to run that logic... which seems inelegant. Hence this routine for the convenience of subclasses: every [frequency] invocations, issue a co_yield.</p> @param moreExepected Should always be true unless this is being called at the end of endDocument() handling. *
IncrementalSAXSource_Filter::count_and_yield
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
Apache-2.0
private void co_entry_pause() throws SAXException { if(fCoroutineManager==null) { // Nobody called init()? Do it now... init(null,-1,-1); } try { Object arg=fCoroutineManager.co_entry_pause(fSourceCoroutineID); if(arg==Boolean.FALSE) co_yield(false); } catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); } }
co_entry_pause is called in startDocument() before anything else happens. It causes the filter to wait for a "go ahead" request from the controller before delivering any events. Note that the very first thing the controller tells us may be "I don't need events after all"!
IncrementalSAXSource_Filter::co_entry_pause
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
Apache-2.0
private void co_yield(boolean moreRemains) throws SAXException { // Horrendous kluge to run filter to completion. See below. if(fNoMoreEvents) return; try // Coroutine manager might throw no-such. { Object arg=Boolean.FALSE; if(moreRemains) { // Yield control, resume parsing when done arg = fCoroutineManager.co_resume(Boolean.TRUE, fSourceCoroutineID, fControllerCoroutineID); } // If we're at end of document or were told to stop early if(arg==Boolean.FALSE) { fNoMoreEvents=true; if(fXMLReader!=null) // Running under startParseThread() throw new StopException(); // We'll co_exit from there. // Yield control. We do NOT expect anyone to ever ask us again. fCoroutineManager.co_exit_to(Boolean.FALSE, fSourceCoroutineID, fControllerCoroutineID); } } catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); } }
Co_Yield handles coroutine interactions while a parse is in progress. When moreRemains==true, we are pausing after delivering events, to ask if more are needed. We will resume the controller thread with co_resume(Boolean.TRUE, ...) When control is passed back it may indicate Boolean.TRUE indication to continue delivering events Boolean.FALSE indication to discontinue events and shut down. When moreRemains==false, we shut down immediately without asking the controller's permission. Normally this means end of document has been reached. Shutting down a IncrementalSAXSource_Filter requires terminating the incoming SAX event stream. If we are in control of that stream (if it came from an XMLReader passed to our startReader() method), we can do so very quickly by throwing a reserved exception to it. If the stream is coming from another source, we can't do that because its caller may not be prepared for this "normal abnormal exit", and instead we put ourselves in a "spin" mode where events are discarded.
IncrementalSAXSource_Filter::co_yield
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
Apache-2.0
public void startParse(InputSource source) throws SAXException { if(fNoMoreEvents) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INCRSAXSRCFILTER_NOT_RESTARTABLE, null)); //"IncrmentalSAXSource_Filter not currently restartable."); if(fXMLReader==null) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_XMLRDR_NOT_BEFORE_STARTPARSE, null)); //"XMLReader not before startParse request"); fXMLReaderInputSource=source; // Xalan thread pooling... // org.apache.xalan.transformer.TransformerImpl.runTransformThread(this); ThreadControllerWrapper.runThread(this, -1); }
Launch a thread that will run an XMLReader's parse() operation within a thread, feeding events to this IncrementalSAXSource_Filter. Mostly a convenience routine, but has the advantage that -- since we invoked parse() -- we can halt parsing quickly via a StopException rather than waiting for the SAX stream to end by itself. @throws SAXException is parse thread is already in progress or parsing can not be started. *
IncrementalSAXSource_Filter::startParse
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
Apache-2.0
public void run() { // Guard against direct invocation of start(). if(fXMLReader==null) return; if(DEBUG)System.out.println("IncrementalSAXSource_Filter parse thread launched"); // Initially assume we'll run successfully. Object arg=Boolean.FALSE; // For the duration of this operation, all coroutine handshaking // will occur in the co_yield method. That's the nice thing about // coroutines; they give us a way to hand off control from the // middle of a synchronous method. try { fXMLReader.parse(fXMLReaderInputSource); } catch(IOException ex) { arg=ex; } catch(StopException ex) { // Expected and harmless if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception"); } catch (SAXException ex) { Exception inner=ex.getException(); if(inner instanceof StopException){ // Expected and harmless if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception"); } else { // Unexpected malfunction if(DEBUG) { System.out.println("Active IncrementalSAXSource_Filter UNEXPECTED SAX exception: "+inner); inner.printStackTrace(); } arg=ex; } } // end parse // Mark as no longer running in thread. fXMLReader=null; try { // Mark as done and yield control to the controller coroutine fNoMoreEvents=true; fCoroutineManager.co_exit_to(arg, fSourceCoroutineID, fControllerCoroutineID); } catch(java.lang.NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "CPO, shut down the garbage smashers on the detention level!" e.printStackTrace(System.err); fCoroutineManager.co_exit(fSourceCoroutineID); } }
Launch a thread that will run an XMLReader's parse() operation within a thread, feeding events to this IncrementalSAXSource_Filter. Mostly a convenience routine, but has the advantage that -- since we invoked parse() -- we can halt parsing quickly via a StopException rather than waiting for the SAX stream to end by itself. @throws SAXException is parse thread is already in progress or parsing can not be started. * public void startParse(InputSource source) throws SAXException { if(fNoMoreEvents) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INCRSAXSRCFILTER_NOT_RESTARTABLE, null)); //"IncrmentalSAXSource_Filter not currently restartable."); if(fXMLReader==null) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_XMLRDR_NOT_BEFORE_STARTPARSE, null)); //"XMLReader not before startParse request"); fXMLReaderInputSource=source; // Xalan thread pooling... // org.apache.xalan.transformer.TransformerImpl.runTransformThread(this); ThreadControllerWrapper.runThread(this, -1); } /* Thread logic to support startParseThread()
IncrementalSAXSource_Filter::run
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
Apache-2.0
public Object deliverMoreNodes(boolean parsemore) { // If parsing is already done, we can immediately say so if(fNoMoreEvents) return Boolean.FALSE; try { Object result = fCoroutineManager.co_resume(parsemore?Boolean.TRUE:Boolean.FALSE, fControllerCoroutineID, fSourceCoroutineID); if(result==Boolean.FALSE) fCoroutineManager.co_exit(fControllerCoroutineID); return result; } // SHOULD NEVER OCCUR, since the coroutine number and coroutine manager // are those previously established for this IncrementalSAXSource_Filter... // So I'm just going to return it as a parsing exception, for now. catch(NoSuchMethodException e) { return e; } }
deliverMoreNodes() is a simple API which tells the coroutine parser that we need more nodes. This is intended to be called from one of our partner routines, and serves to encapsulate the details of how incremental parsing has been achieved. @param parsemore If true, tells the incremental filter to generate another chunk of output. If false, tells the filter that we're satisfied and it can terminate parsing of this document. @return Boolean.TRUE if there may be more events available by invoking deliverMoreNodes() again. Boolean.FALSE if parsing has run to completion (or been terminated by deliverMoreNodes(false). Or an exception object if something malfunctioned. %REVIEW% We _could_ actually throw the exception, but that would require runinng deliverMoreNodes() in a try/catch... and for many applications, exception will be simply be treated as "not TRUE" in any case. *
StopException::deliverMoreNodes
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
Apache-2.0
public DTMAxisIterator reset() { final boolean temp = _isRestartable; _isRestartable = true; setStartNode(_startNode); _isRestartable = temp; return this; }
@return A DTMAxisIterator which has been reset to the start node, which may or may not be the same as this iterator. *
DTMAxisIteratorBase::reset
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
Apache-2.0
public DTMAxisIterator includeSelf() { _includeSelf = true; return this; }
Set the flag to include the start node in the iteration. @return This default method returns just returns this DTMAxisIterator, after setting the flag. (Returning "this" permits C++-style chaining of method calls into a single expression.)
DTMAxisIteratorBase::includeSelf
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
Apache-2.0
public int getLast() { if (_last == -1) // Not previously established { // Note that we're doing both setMark() -- which saves _currentChild // -- and explicitly saving our position counter (number of nodes // yielded so far). // // %REVIEW% Should position also be saved by setMark()? // (It wasn't in the XSLTC version, but I don't understand why not.) final int temp = _position; // Save state setMark(); reset(); // Count the nodes found by this iterator do { _last++; } while (next() != END); gotoMark(); // Restore saved state _position = temp; } return _last; }
Returns the position of the last node within the iteration, as defined by XPath. In a forward iterator, I believe this equals the number of nodes which this iterator will yield. In a reverse iterator, I believe it should return 1 (since the "last" is the first produced.) This may be an expensive operation when called the first time, since it may have to iterate through a large part of the document to produce its answer. @return The number of nodes in this iterator (forward) or 1 (reverse).
DTMAxisIteratorBase::getLast
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
Apache-2.0
public int getPosition() { return _position == 0 ? 1 : _position; }
@return The position of the current node within the set, as defined by XPath. Note that this is one-based, not zero-based.
DTMAxisIteratorBase::getPosition
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
Apache-2.0
public boolean isReverse() { return false; }
@return true if this iterator has a reversed axis, else false
DTMAxisIteratorBase::isReverse
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
Apache-2.0
public DTMAxisIterator cloneIterator() { try { final DTMAxisIteratorBase clone = (DTMAxisIteratorBase) super.clone(); clone._isRestartable = false; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } }
Returns a deep copy of this iterator. Cloned iterators may not be restartable. The iterator being cloned may or may not become non-restartable as a side effect of this operation. @return a deep copy of this iterator.
DTMAxisIteratorBase::cloneIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
Apache-2.0
protected final int returnNode(final int node) { _position++; return node; }
Do any final cleanup that is required before returning the node that was passed in, and then return it. The intended use is <br /> <code>return returnNode(node);</code> %REVIEW% If we're calling it purely for side effects, should we really be bothering with a return value? Something like <br /> <code> accept(node); return node; </code> <br /> would probably optimize just about as well and avoid questions about whether what's returned could ever be different from what's passed in. @param node Node handle which iteration is about to yield. * @return The node handle passed in.
DTMAxisIteratorBase::returnNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
Apache-2.0
protected final DTMAxisIterator resetPosition() { _position = 0; return this; }
Reset the position to zero. NOTE that this does not change the iteration state, only the position number associated with that state. %REVIEW% Document when this would be used? @return This instance.
DTMAxisIteratorBase::resetPosition
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
Apache-2.0
public int getNodeByPosition(int position) { if (position > 0) { final int pos = isReverse() ? getLast() - position + 1 : position; int node; while ((node = next()) != DTMAxisIterator.END) { if (pos == getPosition()) { return node; } } } return END; }
Return the node at the given position. @param position The position @return The node at the given position.
DTMAxisIteratorBase::getNodeByPosition
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
Apache-2.0
synchronized public void addDTM(DTM dtm, int id) { addDTM(dtm,id,0); }
Add a DTM to the DTM table. This convenience call adds it as the "base DTM ID", with offset 0. The other version of addDTM should be used if you want to add "extended" DTM IDs with nonzero offsets. @param dtm Should be a valid reference to a DTM. @param id Integer DTM ID to be bound to this DTM
DTMManagerDefault::addDTM
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public void addDTM(DTM dtm, int id, int offset) { if(id>=IDENT_MAX_DTMS) { // TODO: %REVIEW% Not really the right error message. throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null)); //"No more DTM IDs are available!"); } // We used to just allocate the array size to IDENT_MAX_DTMS. // But we expect to increase that to 16 bits, and I'm not willing // to allocate that much space unless needed. We could use one of our // handy-dandy Fast*Vectors, but this will do for now. // %REVIEW% int oldlen=m_dtms.length; if(oldlen<=id) { // Various growth strategies are possible. I think we don't want // to over-allocate excessively, and I'm willing to reallocate // more often to get that. See also Fast*Vector classes. // // %REVIEW% Should throw a more diagnostic error if we go over the max... int newlen=Math.min((id+256),IDENT_MAX_DTMS); DTM new_m_dtms[] = new DTM[newlen]; System.arraycopy(m_dtms,0,new_m_dtms,0,oldlen); m_dtms=new_m_dtms; int new_m_dtm_offsets[] = new int[newlen]; System.arraycopy(m_dtm_offsets,0,new_m_dtm_offsets,0,oldlen); m_dtm_offsets=new_m_dtm_offsets; } m_dtms[id] = dtm; m_dtm_offsets[id]=offset; dtm.documentRegistration(); // The DTM should have been told who its manager was when we created it. // Do we need to allow for adopting DTMs _not_ created by this manager? }
Add a DTM to the DTM table. @param dtm Should be a valid reference to a DTM. @param id Integer DTM ID to be bound to this DTM. @param offset Integer addressing offset. The internal DTM Node ID is obtained by adding this offset to the node-number field of the public DTM Handle. For the first DTM ID accessing each DTM, this is 0; for overflow addressing it will be a multiple of 1<<IDENT_DTM_NODE_BITS.
DTMManagerDefault::addDTM
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public int getFirstFreeDTMID() { int n = m_dtms.length; for (int i = 1; i < n; i++) { if(null == m_dtms[i]) { return i; } } return n; // count on addDTM() to throw exception if out of range }
Get the first free DTM ID available. %OPT% Linear search is inefficient!
DTMManagerDefault::getFirstFreeDTMID
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
public DTMManagerDefault(){}
Constructor DTMManagerDefault
DTMManagerDefault::DTMManagerDefault
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public DTM getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing) { if(DEBUG && null != source) System.out.println("Starting "+ (unique ? "UNIQUE" : "shared")+ " source: "+source.getSystemId() ); XMLStringFactory xstringFactory = m_xsf; int dtmPos = getFirstFreeDTMID(); int documentID = dtmPos << IDENT_DTM_NODE_BITS; if ((null != source) && source instanceof DOMSource) { DOM2DTM dtm = new DOM2DTM(this, (DOMSource) source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); addDTM(dtm, dtmPos, 0); // if (DUMPTREE) // { // dtm.dumpDTM(); // } return dtm; } else { boolean isSAXSource = (null != source) ? (source instanceof SAXSource) : true; boolean isStreamSource = (null != source) ? (source instanceof StreamSource) : false; if (isSAXSource || isStreamSource) { XMLReader reader = null; SAX2DTM dtm; try { InputSource xmlSource; if (null == source) { xmlSource = null; } else { reader = getXMLReader(source); xmlSource = SAXSource.sourceToInputSource(source); String urlOfSource = xmlSource.getSystemId(); if (null != urlOfSource) { try { urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource); } catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); } xmlSource.setSystemId(urlOfSource); } } if (source==null && unique && !incremental && !doIndexing) { // Special case to support RTF construction into shared DTM. // It should actually still work for other uses, // but may be slightly deoptimized relative to the base // to allow it to deal with carrying multiple documents. // // %REVIEW% This is a sloppy way to request this mode; // we need to consider architectural improvements. dtm = new SAX2RTFDTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } /************************************************************** // EXPERIMENTAL 3/22/02 else if(JKESS_XNI_EXPERIMENT && m_incremental) { dtm = new XNI2DTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } **************************************************************/ // Create the basic SAX2DTM. else { dtm = new SAX2DTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } // Go ahead and add the DTM to the lookup table. This needs to be // done before any parsing occurs. Note offset 0, since we've just // created a new DTM. addDTM(dtm, dtmPos, 0); boolean haveXercesParser = (null != reader) && (reader.getClass() .getName() .equals("org.apache.xerces.parsers.SAXParser") ); if (haveXercesParser) { incremental = true; // No matter what. %REVIEW% } // If the reader is null, but they still requested an incremental // build, then we still want to set up the IncrementalSAXSource stuff. if (m_incremental && incremental /* || ((null == reader) && incremental) */) { IncrementalSAXSource coParser=null; if (haveXercesParser) { // IncrementalSAXSource_Xerces to avoid threading. try { coParser =(IncrementalSAXSource) Class.forName("org.apache.xml.dtm.ref.IncrementalSAXSource_Xerces").newInstance(); } catch( Exception ex ) { ex.printStackTrace(); coParser=null; } } if (coParser==null ) { // Create a IncrementalSAXSource to run on the secondary thread. if (null == reader) { coParser = new IncrementalSAXSource_Filter(); } else { IncrementalSAXSource_Filter filter = new IncrementalSAXSource_Filter(); filter.setXMLReader(reader); coParser=filter; } } /************************************************************** // EXPERIMENTAL 3/22/02 if (JKESS_XNI_EXPERIMENT && m_incremental && dtm instanceof XNI2DTM && coParser instanceof IncrementalSAXSource_Xerces) { org.apache.xerces.xni.parser.XMLPullParserConfiguration xpc= ((IncrementalSAXSource_Xerces)coParser) .getXNIParserConfiguration(); if (xpc!=null) { // Bypass SAX; listen to the XNI stream ((XNI2DTM)dtm).setIncrementalXNISource(xpc); } else { // Listen to the SAX stream (will fail, diagnostically...) dtm.setIncrementalSAXSource(coParser); } } else ***************************************************************/ // Have the DTM set itself up as IncrementalSAXSource's listener. dtm.setIncrementalSAXSource(coParser); if (null == xmlSource) { // Then the user will construct it themselves. return dtm; } if (null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } reader.setDTDHandler(dtm); try { // Launch parsing coroutine. Launches a second thread, // if we're using IncrementalSAXSource.filter(). coParser.startParse(xmlSource); } catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; } catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); } } else { if (null == reader) { // Then the user will construct it themselves. return dtm; } // not incremental reader.setContentHandler(dtm); reader.setDTDHandler(dtm); if (null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } try { reader.setProperty( "http://xml.org/sax/properties/lexical-handler", dtm); } catch (SAXNotRecognizedException e){} catch (SAXNotSupportedException e){} try { reader.parse(xmlSource); } catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; } catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); } } if (DUMPTREE) { System.out.println("Dumping SAX2DOM"); dtm.dumpDTM(System.err); } return dtm; } finally { // Reset the ContentHandler, DTDHandler, ErrorHandler to the DefaultHandler // after creating the DTM. if (reader != null && !(m_incremental && incremental)) { reader.setContentHandler(m_defaultHandler); reader.setDTDHandler(m_defaultHandler); reader.setErrorHandler(m_defaultHandler); // Reset the LexicalHandler to null after creating the DTM. try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", null); } catch (Exception e) {} } releaseXMLReader(reader); } } else { // It should have been handled by a derived class or the caller // made a mistake. throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NOT_SUPPORTED, new Object[]{source})); //"Not supported: " + source); } } }
Get an instance of a DTM, loaded with the content from the specified source. If the unique flag is true, a new instance will always be returned. Otherwise it is up to the DTMManager to return a new instance or an instance that it already created and may be being used by someone else. A bit of magic in this implementation: If the source is null, unique is true, and incremental and doIndexing are both false, we return an instance of SAX2RTFDTM, which see. (I think more parameters will need to be added for error handling, and entity resolution, and more explicit control of the RTF situation). @param source the specification of the source object. @param unique true if the returned DTM must be unique, probably because it is going to be mutated. @param whiteSpaceFilter Enables filtering of whitespace nodes, and may be null. @param incremental true if the DTM should be built incrementally, if possible. @param doIndexing true if the caller considers it worth it to use indexing schemes. @return a non-null DTM reference.
DTMManagerDefault::getDTM
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public int getDTMHandleFromNode(org.w3c.dom.Node node) { if(null == node) throw new IllegalArgumentException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NODE_NON_NULL, null)); //"node must be non-null for getDTMHandleFromNode!"); if (node instanceof org.apache.xml.dtm.ref.DTMNodeProxy) return ((org.apache.xml.dtm.ref.DTMNodeProxy) node).getDTMNodeNumber(); else { // Find the DOM2DTMs wrapped around this Document (if any) // and check whether they contain the Node in question. // // NOTE that since a DOM2DTM may represent a subtree rather // than a full document, we have to be prepared to check more // than one -- and there is no guarantee that we will find // one that contains ancestors or siblings of the node we're // seeking. // // %REVIEW% We could search for the one which contains this // node at the deepest level, and thus covers the widest // subtree, but that's going to entail additional work // checking more DTMs... and getHandleOfNode is not a // cheap operation in most implementations. // // TODO: %REVIEW% If overflow addressing, we may recheck a DTM // already examined. Ouch. But with the increased number of DTMs, // scanning back to check this is painful. // POSSIBLE SOLUTIONS: // Generate a list of _unique_ DTM objects? // Have each DTM cache last DOM node search? int max = m_dtms.length; for(int i = 0; i < max; i++) { DTM thisDTM=m_dtms[i]; if((null != thisDTM) && thisDTM instanceof DOM2DTM) { int handle=((DOM2DTM)thisDTM).getHandleOfNode(node); if(handle!=DTM.NULL) return handle; } } // Not found; generate a new DTM. // // %REVIEW% Is this really desirable, or should we return null // and make folks explicitly instantiate from a DOMSource? The // latter is more work but gives the caller the opportunity to // explicitly add the DTM to a DTMManager... and thus to know when // it can be discarded again, which is something we need to pay much // more attention to. (Especially since only DTMs which are assigned // to a manager can use the overflow addressing scheme.) // // %BUG% If the source node was a DOM2DTM$defaultNamespaceDeclarationNode // and the DTM wasn't registered with this DTMManager, we will create // a new DTM and _still_ not be able to find the node (since it will // be resynthesized). Another reason to push hard on making all DTMs // be managed DTMs. // Since the real root of our tree may be a DocumentFragment, we need to // use getParent to find the root, instead of getOwnerDocument. Otherwise // DOM2DTM#getHandleOfNode will be very unhappy. Node root = node; Node p = (root.getNodeType() == Node.ATTRIBUTE_NODE) ? ((org.w3c.dom.Attr)root).getOwnerElement() : root.getParentNode(); for (; p != null; p = p.getParentNode()) { root = p; } DOM2DTM dtm = (DOM2DTM) getDTM(new javax.xml.transform.dom.DOMSource(root), false, null, true, true); int handle; if(node instanceof org.apache.xml.dtm.ref.dom2dtm.DOM2DTMdefaultNamespaceDeclarationNode) { // Can't return the same node since it's unique to a specific DTM, // but can return the equivalent node -- find the corresponding // Document Element, then ask it for the xml: namespace decl. handle=dtm.getHandleOfNode(((org.w3c.dom.Attr)node).getOwnerElement()); handle=dtm.getAttributeNode(handle,node.getNamespaceURI(),node.getLocalName()); } else handle = ((DOM2DTM)dtm).getHandleOfNode(node); if(DTM.NULL == handle) throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_RESOLVE_NODE, null)); //"Could not resolve the node to a handle!"); return handle; } }
Given a W3C DOM node, try and return a DTM handle. Note: calling this may be non-optimal, and there is no guarantee that the node will be found in any particular DTM. @param node Non-null reference to a DOM node. @return a valid DTM handle.
DTMManagerDefault::getDTMHandleFromNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public XMLReader getXMLReader(Source inputSource) { try { XMLReader reader = (inputSource instanceof SAXSource) ? ((SAXSource) inputSource).getXMLReader() : null; // If user did not supply a reader, ask for one from the reader manager if (null == reader) { if (m_readerManager == null) { m_readerManager = XMLReaderManager.getInstance(); } reader = m_readerManager.getXMLReader(); } return reader; } catch (SAXException se) { throw new DTMException(se.getMessage(), se); } }
This method returns the SAX2 parser to use with the InputSource obtained from this URI. It may return null if any SAX2-conformant XML parser can be used, or if getInputSource() will also return null. The parser must be free for use (i.e., not currently in use for another parse(). After use of the parser is completed, the releaseXMLReader(XMLReader) must be called. @param inputSource The value returned from the URIResolver. @return a SAX2 XMLReader to use to resolve the inputSource argument. @return non-null XMLReader reference ready to parse.
DTMManagerDefault::getXMLReader
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public void releaseXMLReader(XMLReader reader) { if (m_readerManager != null) { m_readerManager.releaseXMLReader(reader); } }
Indicates that the XMLReader object is no longer in use for the transform. Note that the getXMLReader method may return an XMLReader that was specified on the SAXSource object by the application code. Such a reader should still be passed to releaseXMLReader, but the reader manager will only re-use XMLReaders that it created. @param reader The XMLReader to be released.
DTMManagerDefault::releaseXMLReader
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public DTM getDTM(int nodeHandle) { try { // Performance critical function. return m_dtms[nodeHandle >>> IDENT_DTM_NODE_BITS]; } catch(java.lang.ArrayIndexOutOfBoundsException e) { if(nodeHandle==DTM.NULL) return null; // Accept as a special case. else throw e; // Programming error; want to know about it. } }
Return the DTM object containing a representation of this node. @param nodeHandle DTM Handle indicating which node to retrieve @return a reference to the DTM object containing this node.
DTMManagerDefault::getDTM
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public int getDTMIdentity(DTM dtm) { // Shortcut using DTMDefaultBase's extension hooks // %REVIEW% Should the lookup be part of the basic DTM API? if(dtm instanceof DTMDefaultBase) { DTMDefaultBase dtmdb=(DTMDefaultBase)dtm; if(dtmdb.getManager()==this) return dtmdb.getDTMIDs().elementAt(0); else return -1; } int n = m_dtms.length; for (int i = 0; i < n; i++) { DTM tdtm = m_dtms[i]; if (tdtm == dtm && m_dtm_offsets[i]==0) return i << IDENT_DTM_NODE_BITS; } return -1; }
Given a DTM, find the ID number in the DTM tables which addresses the start of the document. If overflow addressing is in use, other DTM IDs may also be assigned to this DTM. @param dtm The DTM which (hopefully) contains this node. @return The DTM ID (as the high bits of a NodeHandle, not as our internal index), or -1 if the DTM doesn't belong to this manager.
DTMManagerDefault::getDTMIdentity
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public boolean release(DTM dtm, boolean shouldHardDelete) { if(DEBUG) { System.out.println("Releasing "+ (shouldHardDelete ? "HARD" : "soft")+ " dtm="+ // Following shouldn't need a nodeHandle, but does... // and doesn't seem to report the intended value dtm.getDocumentBaseURI() ); } if (dtm instanceof SAX2DTM) { ((SAX2DTM) dtm).clearCoRoutine(); } // Multiple DTM IDs may be assigned to a single DTM. // The Right Answer is to ask which (if it supports // extension, the DTM will need a list anyway). The // Wrong Answer, applied if the DTM can't help us, // is to linearly search them all; this may be very // painful. // // %REVIEW% Should the lookup move up into the basic DTM API? if(dtm instanceof DTMDefaultBase) { org.apache.xml.utils.SuballocatedIntVector ids=((DTMDefaultBase)dtm).getDTMIDs(); for(int i=ids.size()-1;i>=0;--i) m_dtms[ids.elementAt(i)>>>DTMManager.IDENT_DTM_NODE_BITS]=null; } else { int i = getDTMIdentity(dtm); if (i >= 0) { m_dtms[i >>> DTMManager.IDENT_DTM_NODE_BITS] = null; } } dtm.documentRelease(); return true; }
Release the DTMManager's reference(s) to a DTM, making it unmanaged. This is typically done as part of returning the DTM to the heap after we're done with it. @param dtm the DTM to be released. @param shouldHardDelete If false, this call is a suggestion rather than an order, and we may not actually release the DTM. This is intended to support intelligent caching of documents... which is not implemented in this version of the DTM manager. @return true if the DTM was released, false if shouldHardDelete was set and we decided not to.
DTMManagerDefault::release
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public DTM createDocumentFragment() { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.newDocument(); Node df = doc.createDocumentFragment(); return getDTM(new DOMSource(df), true, null, false, false); } catch (Exception e) { throw new DTMException(e); } }
Method createDocumentFragment NEEDSDOC (createDocumentFragment) @return
DTMManagerDefault::createDocumentFragment
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public DTMIterator createDTMIterator(int whatToShow, DTMFilter filter, boolean entityReferenceExpansion) { /** @todo: implement this org.apache.xml.dtm.DTMManager abstract method */ return null; }
NEEDSDOC Method createDTMIterator NEEDSDOC @param whatToShow NEEDSDOC @param filter NEEDSDOC @param entityReferenceExpansion NEEDSDOC (createDTMIterator) @return
DTMManagerDefault::createDTMIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public DTMIterator createDTMIterator(String xpathString, PrefixResolver presolver) { /** @todo: implement this org.apache.xml.dtm.DTMManager abstract method */ return null; }
NEEDSDOC Method createDTMIterator NEEDSDOC @param xpathString NEEDSDOC @param presolver NEEDSDOC (createDTMIterator) @return
DTMManagerDefault::createDTMIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public DTMIterator createDTMIterator(int node) { /** @todo: implement this org.apache.xml.dtm.DTMManager abstract method */ return null; }
NEEDSDOC Method createDTMIterator NEEDSDOC @param node NEEDSDOC (createDTMIterator) @return
DTMManagerDefault::createDTMIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
synchronized public DTMIterator createDTMIterator(Object xpathCompiler, int pos) { /** @todo: implement this org.apache.xml.dtm.DTMManager abstract method */ return null; }
NEEDSDOC Method createDTMIterator NEEDSDOC @param xpathCompiler NEEDSDOC @param pos NEEDSDOC (createDTMIterator) @return
DTMManagerDefault::createDTMIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
public ExpandedNameTable getExpandedNameTable(DTM dtm) { return m_expandedNameTable; }
return the expanded name table. NEEDSDOC @param dtm NEEDSDOC ($objectName$) @return
DTMManagerDefault::getExpandedNameTable
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java
Apache-2.0
public DTMAxisIterator getTypedAxisIterator(int axis, int type) { DTMAxisIterator iterator = null; /* This causes an error when using patterns for elements that do not exist in the DOM (translet types which do not correspond to a DOM type are mapped to the DOM.ELEMENT type). */ // if (type == NO_TYPE) { // return(EMPTYITERATOR); // } // else if (type == ELEMENT) { // iterator = new FilterIterator(getAxisIterator(axis), // getElementFilter()); // } // else { switch (axis) { case Axis.SELF : iterator = new TypedSingletonIterator(type); break; case Axis.CHILD : iterator = new TypedChildrenIterator(type); break; case Axis.PARENT : return (new ParentIterator().setNodeType(type)); case Axis.ANCESTOR : return (new TypedAncestorIterator(type)); case Axis.ANCESTORORSELF : return ((new TypedAncestorIterator(type)).includeSelf()); case Axis.ATTRIBUTE : return (new TypedAttributeIterator(type)); case Axis.DESCENDANT : iterator = new TypedDescendantIterator(type); break; case Axis.DESCENDANTORSELF : iterator = (new TypedDescendantIterator(type)).includeSelf(); break; case Axis.FOLLOWING : iterator = new TypedFollowingIterator(type); break; case Axis.PRECEDING : iterator = new TypedPrecedingIterator(type); break; case Axis.FOLLOWINGSIBLING : iterator = new TypedFollowingSiblingIterator(type); break; case Axis.PRECEDINGSIBLING : iterator = new TypedPrecedingSiblingIterator(type); break; case Axis.NAMESPACE : iterator = new TypedNamespaceIterator(type); break; case Axis.ROOT : iterator = new TypedRootIterator(type); break; default : throw new DTMException(XMLMessages.createXMLMessage( XMLErrorResources.ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED, new Object[]{Axis.getNames(axis)})); //"Error: typed iterator for axis " //+ Axis.names[axis] + "not implemented"); } } return (iterator); }
Get an iterator that can navigate over an XPath Axis, predicated by the extended type ID. Returns an iterator that must be initialized with a start node (using iterator.setStartNode()). @param axis One of Axes.ANCESTORORSELF, etc. @param type An extended type ID. @return A DTMAxisIterator, or null if the given axis isn't supported.
DTMDefaultBaseIterators::getTypedAxisIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public DTMAxisIterator getAxisIterator(final int axis) { DTMAxisIterator iterator = null; switch (axis) { case Axis.SELF : iterator = new SingletonIterator(); break; case Axis.CHILD : iterator = new ChildrenIterator(); break; case Axis.PARENT : return (new ParentIterator()); case Axis.ANCESTOR : return (new AncestorIterator()); case Axis.ANCESTORORSELF : return ((new AncestorIterator()).includeSelf()); case Axis.ATTRIBUTE : return (new AttributeIterator()); case Axis.DESCENDANT : iterator = new DescendantIterator(); break; case Axis.DESCENDANTORSELF : iterator = (new DescendantIterator()).includeSelf(); break; case Axis.FOLLOWING : iterator = new FollowingIterator(); break; case Axis.PRECEDING : iterator = new PrecedingIterator(); break; case Axis.FOLLOWINGSIBLING : iterator = new FollowingSiblingIterator(); break; case Axis.PRECEDINGSIBLING : iterator = new PrecedingSiblingIterator(); break; case Axis.NAMESPACE : iterator = new NamespaceIterator(); break; case Axis.ROOT : iterator = new RootIterator(); break; default : throw new DTMException(XMLMessages.createXMLMessage( XMLErrorResources.ER_ITERATOR_AXIS_NOT_IMPLEMENTED, new Object[]{Axis.getNames(axis)})); //"Error: iterator for axis '" + Axis.names[axis] //+ "' not implemented"); } return (iterator); }
This is a shortcut to the iterators that implement the XPath axes. Returns a bare-bones iterator that must be initialized with a start node (using iterator.setStartNode()). @param axis One of Axes.ANCESTORORSELF, etc. @return A DTMAxisIterator, or null if the given axis isn't supported.
DTMDefaultBaseIterators::getAxisIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public void setMark() { _markedNode = _currentNode; }
Remembers the current node for the next call to gotoMark(). %REVIEW% Should this save _position too?
InternalAxisIteratorBase::setMark
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public void gotoMark() { _currentNode = _markedNode; }
Restores the current node remembered by setMark(). %REVEIW% Should this restore _position too?
InternalAxisIteratorBase::gotoMark
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public DTMAxisIterator setStartNode(int node) { //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily if (node == DTMDefaultBase.ROOTNODE) node = getDocument(); if (_isRestartable) { _startNode = node; _currentNode = (node == DTM.NULL) ? DTM.NULL : _firstch(makeNodeIdentity(node)); return resetPosition(); } return this; }
Setting start to END should 'close' the iterator, i.e. subsequent call to next() should return END. If the iterator is not restartable, this has no effect. %REVIEW% Should it return/throw something in that case, or set current node to END, to indicate request-not-honored? @param node Sets the root of the iteration. @return A DTMAxisIterator set to the start of the iteration.
ChildrenIterator::setStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public NamespaceChildrenIterator(final int type) { _nsType = type; }
Constructor NamespaceChildrenIterator @param type The extended type ID being requested.
NamespaceChildrenIterator::NamespaceChildrenIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public NamespaceIterator() { super(); }
Constructor NamespaceAttributeIterator
NamespaceIterator::NamespaceIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public TypedNamespaceIterator(int nodeType) { super(); _nodeType = nodeType; }
Constructor TypedNamespaceIterator @param nodeType The extended type ID being requested.
TypedNamespaceIterator::TypedNamespaceIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public RootIterator() { super(); }
Constructor RootIterator
RootIterator::RootIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public NamespaceAttributeIterator(int nsType) { super(); _nsType = nsType; }
Constructor NamespaceAttributeIterator @param nsType The extended type ID being requested.
NamespaceAttributeIterator::NamespaceAttributeIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public NthDescendantIterator(int pos) { _pos = pos; }
Constructor NthDescendantIterator @param pos The nth position being requested.
NthDescendantIterator::NthDescendantIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public SingletonIterator() { this(Integer.MIN_VALUE, false); }
Constructor SingletonIterator
SingletonIterator::SingletonIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public SingletonIterator(int node) { this(node, false); }
Constructor SingletonIterator @param node The node handle to return.
SingletonIterator::SingletonIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public SingletonIterator(int node, boolean constant) { _currentNode = _startNode = node; _isConstant = constant; }
Constructor SingletonIterator @param node the node handle to return. @param constant (Not sure what this is yet. -sb)
SingletonIterator::SingletonIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
Apache-2.0
public ExtendedType (int nodetype, String namespace, String localName) { this.nodetype = nodetype; this.namespace = namespace; this.localName = localName; this.hash = nodetype + namespace.hashCode() + localName.hashCode(); }
Create an ExtendedType object from node type, namespace and local name. The hash code is calculated from the node type, namespace and local name. @param nodetype Type of the node @param namespace Namespace of the node @param localName Local name of the node
ExtendedType::ExtendedType
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ExtendedType.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ExtendedType.java
Apache-2.0
public ExtendedType (int nodetype, String namespace, String localName, int hash) { this.nodetype = nodetype; this.namespace = namespace; this.localName = localName; this.hash = hash; }
Create an ExtendedType object from node type, namespace, local name and a given hash code. @param nodetype Type of the node @param namespace Namespace of the node @param localName Local name of the node @param hash The given hash code
ExtendedType::ExtendedType
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ExtendedType.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ExtendedType.java
Apache-2.0
protected void redefine(int nodetype, String namespace, String localName) { this.nodetype = nodetype; this.namespace = namespace; this.localName = localName; this.hash = nodetype + namespace.hashCode() + localName.hashCode(); }
Redefine this ExtendedType object to represent a different extended type. This is intended to be used ONLY on the hashET object. Using it elsewhere will mess up existing hashtable entries!
ExtendedType::redefine
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ExtendedType.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ExtendedType.java
Apache-2.0