code
stringlengths
11
173k
docstring
stringlengths
2
593k
func_name
stringlengths
2
189
language
stringclasses
1 value
repo
stringclasses
844 values
path
stringlengths
11
294
url
stringlengths
60
339
license
stringclasses
4 values
public void endDocument() throws SAXException { if (DEBUG) System.out.println("endDocument"); charactersFlush(); m_nextsib.setElementAt(NULL,0); if (m_firstch.elementAt(0) == NOTPROCESSED) m_firstch.setElementAt(NULL,0); if (DTM.NULL != m_previous) m_nextsib.setElementAt(DTM.NULL,m_previous); m_parents = null; m_prefixMappings = null; m_contextIndexes = null; m_endDocumentOccured = true; // Bugzilla 4858: throw away m_locator. we cache m_systemId m_locator = null; }
Receive notification of the end of the document. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#endDocument
SAX2DTM::endDocument
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void startPrefixMapping(String prefix, String uri) throws SAXException { if (DEBUG) System.out.println("startPrefixMapping: prefix: " + prefix + ", uri: " + uri); if(null == prefix) prefix = ""; m_prefixMappings.addElement(prefix); // JDK 1.1.x compat -sc m_prefixMappings.addElement(uri); // JDK 1.1.x compat -sc }
Receive notification of the start of a Namespace mapping. <p>By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each Namespace prefix scope (such as storing the prefix mapping).</p> @param prefix The Namespace prefix being declared. @param uri The Namespace URI mapped to the prefix. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#startPrefixMapping
SAX2DTM::startPrefixMapping
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void endPrefixMapping(String prefix) throws SAXException { if (DEBUG) System.out.println("endPrefixMapping: prefix: " + prefix); if(null == prefix) prefix = ""; int index = m_contextIndexes.peek() - 1; do { index = m_prefixMappings.indexOf(prefix, ++index); } while ( (index >= 0) && ((index & 0x01) == 0x01) ); if (index > -1) { m_prefixMappings.setElementAt("%@$#^@#", index); m_prefixMappings.setElementAt("%@$#^@#", index + 1); } // no op }
Receive notification of the end of a Namespace mapping. <p>By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each prefix mapping.</p> @param prefix The Namespace prefix being declared. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#endPrefixMapping
SAX2DTM::endPrefixMapping
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
protected boolean declAlreadyDeclared(String prefix) { int startDecls = m_contextIndexes.peek(); java.util.Vector prefixMappings = m_prefixMappings; int nDecls = prefixMappings.size(); for (int i = startDecls; i < nDecls; i += 2) { String prefixDecl = (String) prefixMappings.elementAt(i); if (prefixDecl == null) continue; if (prefixDecl.equals(prefix)) return true; } return false; }
Check if a declaration has already been made for a given prefix. @param prefix non-null prefix string. @return true if the declaration has already been declared in the current context.
SAX2DTM::declAlreadyDeclared
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void startElement( String uri, String localName, String qName, Attributes attributes) throws SAXException { if (DEBUG) { System.out.println("startElement: uri: " + uri + ", localname: " + localName + ", qname: "+qName+", atts: " + attributes); boolean DEBUG_ATTRS=true; if(DEBUG_ATTRS & attributes!=null) { int n = attributes.getLength(); if(n==0) System.out.println("\tempty attribute list"); else for (int i = 0; i < n; i++) System.out.println("\t attr: uri: " + attributes.getURI(i) + ", localname: " + attributes.getLocalName(i) + ", qname: " + attributes.getQName(i) + ", type: " + attributes.getType(i) + ", value: " + attributes.getValue(i) ); } } charactersFlush(); int exName = m_expandedNameTable.getExpandedTypeID(uri, localName, DTM.ELEMENT_NODE); String prefix = getPrefix(qName, uri); int prefixIndex = (null != prefix) ? m_valuesOrPrefixes.stringToIndex(qName) : 0; int elemNode = addNode(DTM.ELEMENT_NODE, exName, m_parents.peek(), m_previous, prefixIndex, true); if(m_indexing) indexNode(exName, elemNode); m_parents.push(elemNode); int startDecls = m_contextIndexes.peek(); int nDecls = m_prefixMappings.size(); int prev = DTM.NULL; if(!m_pastFirstElement) { // SPECIAL CASE: Implied declaration at root element prefix="xml"; String declURL = "http://www.w3.org/XML/1998/namespace"; exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE); int val = m_valuesOrPrefixes.stringToIndex(declURL); prev = addNode(DTM.NAMESPACE_NODE, exName, elemNode, prev, val, false); m_pastFirstElement=true; } for (int i = startDecls; i < nDecls; i += 2) { prefix = (String) m_prefixMappings.elementAt(i); if (prefix == null) continue; String declURL = (String) m_prefixMappings.elementAt(i + 1); exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE); int val = m_valuesOrPrefixes.stringToIndex(declURL); prev = addNode(DTM.NAMESPACE_NODE, exName, elemNode, prev, val, false); } int n = attributes.getLength(); for (int i = 0; i < n; i++) { String attrUri = attributes.getURI(i); String attrQName = attributes.getQName(i); String valString = attributes.getValue(i); prefix = getPrefix(attrQName, attrUri); int nodeType; String attrLocalName = attributes.getLocalName(i); if ((null != attrQName) && (attrQName.equals("xmlns") || attrQName.startsWith("xmlns:"))) { if (declAlreadyDeclared(prefix)) continue; // go to the next attribute. nodeType = DTM.NAMESPACE_NODE; } else { nodeType = DTM.ATTRIBUTE_NODE; if (attributes.getType(i).equalsIgnoreCase("ID")) setIDAttribute(valString, elemNode); } // Bit of a hack... if somehow valString is null, stringToIndex will // return -1, which will make things very unhappy. if(null == valString) valString = ""; int val = m_valuesOrPrefixes.stringToIndex(valString); //String attrLocalName = attributes.getLocalName(i); if (null != prefix) { prefixIndex = m_valuesOrPrefixes.stringToIndex(attrQName); int dataIndex = m_data.size(); m_data.addElement(prefixIndex); m_data.addElement(val); val = -dataIndex; } exName = m_expandedNameTable.getExpandedTypeID(attrUri, attrLocalName, nodeType); prev = addNode(nodeType, exName, elemNode, prev, val, false); } if (DTM.NULL != prev) m_nextsib.setElementAt(DTM.NULL,prev); if (null != m_wsfilter) { short wsv = m_wsfilter.getShouldStripSpace(makeNodeHandle(elemNode), this); boolean shouldStrip = (DTMWSFilter.INHERIT == wsv) ? getShouldStripWhitespace() : (DTMWSFilter.STRIP == wsv); pushShouldStripWhitespace(shouldStrip); } m_previous = DTM.NULL; m_contextIndexes.push(m_prefixMappings.size()); // for the children. }
Receive notification of the start of an element. <p>By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).</p> @param uri The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. @param localName The local name (without prefix), or the empty string if Namespace processing is not being performed. @param qName The qualified name (with prefix), or the empty string if qualified names are not available. @param attributes The specified or defaulted attributes. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#startElement
SAX2DTM::startElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void endElement(String uri, String localName, String qName) throws SAXException { if (DEBUG) System.out.println("endElement: uri: " + uri + ", localname: " + localName + ", qname: "+qName); charactersFlush(); // If no one noticed, startPrefixMapping is a drag. // Pop the context for the last child (the one pushed by startElement) m_contextIndexes.quickPop(1); // Do it again for this one (the one pushed by the last endElement). int topContextIndex = m_contextIndexes.peek(); if (topContextIndex != m_prefixMappings.size()) { m_prefixMappings.setSize(topContextIndex); } int lastNode = m_previous; m_previous = m_parents.pop(); // If lastNode is still DTM.NULL, this element had no children if (DTM.NULL == lastNode) m_firstch.setElementAt(DTM.NULL,m_previous); else m_nextsib.setElementAt(DTM.NULL,lastNode); popShouldStripWhitespace(); }
Receive notification of the end of an element. <p>By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).</p> @param uri The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. @param localName The local name (without prefix), or the empty string if Namespace processing is not being performed. @param qName The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#endElement
SAX2DTM::endElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void characters(char ch[], int start, int length) throws SAXException { if (m_textPendingStart == -1) // First one in this block { m_textPendingStart = m_chars.size(); m_coalescedTextType = m_textType; } // Type logic: If all adjacent text is CDATASections, the // concatentated text is treated as a single CDATASection (see // initialization above). If any were ordinary Text, the whole // thing is treated as Text. This may be worth %REVIEW%ing. else if (m_textType == DTM.TEXT_NODE) { m_coalescedTextType = DTM.TEXT_NODE; } m_chars.append(ch, start, length); }
Receive notification of character data inside an element. <p>By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).</p> @param ch The characters. @param start The start position in the character array. @param length The number of characters to use from the character array. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#characters
SAX2DTM::characters
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { // %OPT% We can probably take advantage of the fact that we know this // is whitespace. characters(ch, start, length); }
Receive notification of ignorable whitespace in element content. <p>By default, do nothing. Application writers may override this method to take specific actions for each chunk of ignorable whitespace (such as adding data to a node or buffer, or printing it to a file).</p> @param ch The whitespace characters. @param start The start position in the character array. @param length The number of characters to use from the character array. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#ignorableWhitespace
SAX2DTM::ignorableWhitespace
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void processingInstruction(String target, String data) throws SAXException { if (DEBUG) System.out.println("processingInstruction: target: " + target +", data: "+data); charactersFlush(); int exName = m_expandedNameTable.getExpandedTypeID(null, target, DTM.PROCESSING_INSTRUCTION_NODE); int dataIndex = m_valuesOrPrefixes.stringToIndex(data); m_previous = addNode(DTM.PROCESSING_INSTRUCTION_NODE, exName, m_parents.peek(), m_previous, dataIndex, false); }
Receive notification of a processing instruction. <p>By default, do nothing. Application writers may override this method in a subclass to take specific actions for each processing instruction, such as setting status variables or invoking other methods.</p> @param target The processing instruction target. @param data The processing instruction data, or null if none is supplied. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#processingInstruction
SAX2DTM::processingInstruction
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void skippedEntity(String name) throws SAXException { // %REVIEW% What should be done here? // no op }
Receive notification of a skipped entity. <p>By default, do nothing. Application writers may override this method in a subclass to take specific actions for each processing instruction, such as setting status variables or invoking other methods.</p> @param name The name of the skipped entity. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#processingInstruction
SAX2DTM::skippedEntity
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void warning(SAXParseException e) throws SAXException { // %REVIEW% Is there anyway to get the JAXP error listener here? System.err.println(e.getMessage()); }
Receive notification of a parser warning. <p>The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each warning, such as inserting the message in a log file or printing it to the console.</p> @param e The warning information encoded as an exception. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ErrorHandler#warning @see org.xml.sax.SAXParseException
SAX2DTM::warning
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void error(SAXParseException e) throws SAXException { throw e; }
Receive notification of a recoverable parser error. <p>The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each error, such as inserting the message in a log file or printing it to the console.</p> @param e The warning information encoded as an exception. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ErrorHandler#warning @see org.xml.sax.SAXParseException
SAX2DTM::error
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void fatalError(SAXParseException e) throws SAXException { throw e; }
Report a fatal XML parsing error. <p>The default implementation throws a SAXParseException. Application writers may override this method in a subclass if they need to take specific actions for each fatal error (such as collecting all of the errors into a single report): in any case, the application must stop all regular processing when this method is invoked, since the document is no longer reliable, and the parser may no longer report parsing events.</p> @param e The error information encoded as an exception. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ErrorHandler#fatalError @see org.xml.sax.SAXParseException
SAX2DTM::fatalError
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void elementDecl(String name, String model) throws SAXException { // no op }
Report an element type declaration. <p>The content model will consist of the string "EMPTY", the string "ANY", or a parenthesised group, optionally followed by an occurrence indicator. The model will be normalized so that all whitespace is removed,and will include the enclosing parentheses.</p> @param name The element type name. @param model The content model as a normalized string. @throws SAXException The application may raise an exception.
SAX2DTM::elementDecl
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { // no op }
Report an attribute type declaration. <p>Only the effective (first) declaration for an attribute will be reported. The type will be one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION", or a parenthesized token group with the separator "|" and all whitespace removed.</p> @param eName The name of the associated element. @param aName The name of the attribute. @param type A string representing the attribute type. @param valueDefault A string representing the attribute default ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies. @param value A string representing the attribute's default value, or null if there is none. @throws SAXException The application may raise an exception.
SAX2DTM::attributeDecl
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void internalEntityDecl(String name, String value) throws SAXException { // no op }
Report an internal entity declaration. <p>Only the effective (first) declaration for each entity will be reported.</p> @param name The name of the entity. If it is a parameter entity, the name will begin with '%'. @param value The replacement text of the entity. @throws SAXException The application may raise an exception. @see #externalEntityDecl @see org.xml.sax.DTDHandler#unparsedEntityDecl
SAX2DTM::internalEntityDecl
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void externalEntityDecl( String name, String publicId, String systemId) throws SAXException { // no op }
Report a parsed external entity declaration. <p>Only the effective (first) declaration for each entity will be reported.</p> @param name The name of the entity. If it is a parameter entity, the name will begin with '%'. @param publicId The declared public identifier of the entity, or null if none was declared. @param systemId The declared system identifier of the entity. @throws SAXException The application may raise an exception. @see #internalEntityDecl @see org.xml.sax.DTDHandler#unparsedEntityDecl
SAX2DTM::externalEntityDecl
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void startDTD(String name, String publicId, String systemId) throws SAXException { m_insideDTD = true; }
Report the start of DTD declarations, if any. <p>Any declarations are assumed to be in the internal subset unless otherwise indicated by a {@link #startEntity startEntity} event.</p> <p>Note that the start/endDTD events will appear within the start/endDocument events from ContentHandler and before the first startElement event.</p> @param name The document type name. @param publicId The declared public identifier for the external DTD subset, or null if none was declared. @param systemId The declared system identifier for the external DTD subset, or null if none was declared. @throws SAXException The application may raise an exception. @see #endDTD @see #startEntity
SAX2DTM::startDTD
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void endDTD() throws SAXException { m_insideDTD = false; }
Report the end of DTD declarations. @throws SAXException The application may raise an exception. @see #startDTD
SAX2DTM::endDTD
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void startEntity(String name) throws SAXException { // no op }
Report the beginning of an entity in content. <p><strong>NOTE:</entity> entity references in attribute values -- and the start and end of the document entity -- are never reported.</p> <p>The start and end of the external DTD subset are reported using the pseudo-name "[dtd]". All other events must be properly nested within start/end entity events.</p> <p>Note that skipped entities will be reported through the {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity} event, which is part of the ContentHandler interface.</p> @param name The name of the entity. If it is a parameter entity, the name will begin with '%'. @throws SAXException The application may raise an exception. @see #endEntity @see org.xml.sax.ext.DeclHandler#internalEntityDecl @see org.xml.sax.ext.DeclHandler#externalEntityDecl
SAX2DTM::startEntity
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void endEntity(String name) throws SAXException { // no op }
Report the end of an entity. @param name The name of the entity that is ending. @throws SAXException The application may raise an exception. @see #startEntity
SAX2DTM::endEntity
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void startCDATA() throws SAXException { m_textType = DTM.CDATA_SECTION_NODE; }
Report the start of a CDATA section. <p>The contents of the CDATA section will be reported through the regular {@link org.xml.sax.ContentHandler#characters characters} event.</p> @throws SAXException The application may raise an exception. @see #endCDATA
SAX2DTM::startCDATA
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void endCDATA() throws SAXException { m_textType = DTM.TEXT_NODE; }
Report the end of a CDATA section. @throws SAXException The application may raise an exception. @see #startCDATA
SAX2DTM::endCDATA
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void comment(char ch[], int start, int length) throws SAXException { if (m_insideDTD) // ignore comments if we're inside the DTD return; charactersFlush(); int exName = m_expandedNameTable.getExpandedTypeID(DTM.COMMENT_NODE); // For now, treat comments as strings... I guess we should do a // seperate FSB buffer instead. int dataIndex = m_valuesOrPrefixes.stringToIndex(new String(ch, start, length)); m_previous = addNode(DTM.COMMENT_NODE, exName, m_parents.peek(), m_previous, dataIndex, false); }
Report an XML comment anywhere in the document. <p>This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read).</p> @param ch An array holding the characters in the comment. @param start The starting position in the array. @param length The number of characters to use from the array. @throws SAXException The application may raise an exception.
SAX2DTM::comment
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public void setProperty(String property, Object value) { }
Set a run time property for this DTM instance. %REVIEW% Now that we no longer use this method to support getSourceLocatorFor, can we remove it? @param property a <code>String</code> value @param value an <code>Object</code> value
SAX2DTM::setProperty
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Apache-2.0
public SourceLocator getSourceLocatorFor(int node) { if (m_useSourceLocationProperty) { node = makeNodeIdentity(node); return new NodeLocator(null, m_sourceSystemId.elementAt(node), m_sourceLine.elementAt(node), m_sourceColumn.elementAt(node)); } else if(m_locator!=null) { return new NodeLocator(null,m_locator.getSystemId(),-1,-1); } else if(m_systemId!=null) { return new NodeLocator(null,m_systemId,-1,-1); } return null; }
Retrieve the SourceLocator associated with a specific node. This is only meaningful if the XalanProperties.SOURCE_LOCATION flag was set True using setProperty; if it was never set, or was set false, we will return null. (We _could_ return a locator with the document's base URI and bogus line/column information. Trying that; see the else clause.) *
SAX2DTM::getSourceLocatorFor
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.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 : _firstch2(makeNodeIdentity(node)); return resetPosition(); } return this; }
Setting start to END should 'close' the iterator, i.e. subsequent call to next() should return END. <p> 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/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { if (_currentNode != NULL) { int node = _currentNode; _currentNode = _nextsib2(node); return returnNode(makeNodeHandle(node)); } return END; }
Get the next node in the iteration. @return The next node handle in the iteration, or END if no more are available.
ChildrenIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.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; if (node != DTM.NULL) _currentNode = _parent2(makeNodeIdentity(node)); else _currentNode = DTM.NULL; return resetPosition(); } return this; }
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END. @param node Sets the root of the iteration. @return A DTMAxisIterator set to the start of the iteration.
ParentIterator::setStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public DTMAxisIterator setNodeType(final int type) { _nodeType = type; return this; }
Set the node type of the parent that we're looking for. Note that this does _not_ mean "find the nearest ancestor of this type", but "yield the parent if it is of this type". @param type extended type ID. @return ParentIterator configured with the type filter set.
ParentIterator::setNodeType
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { int result = _currentNode; if (result == END) return DTM.NULL; // %OPT% The most common case is handled first. if (_nodeType == NULL) { _currentNode = END; return returnNode(makeNodeHandle(result)); } else if (_nodeType >= DTM.NTYPES) { if (_nodeType == _exptype2(result)) { _currentNode = END; return returnNode(makeNodeHandle(result)); } } else { if (_nodeType == _type2(result)) { _currentNode = END; return returnNode(makeNodeHandle(result)); } } return DTM.NULL; }
Get the next node in the iteration. In this case, we return only the immediate parent, _if_ it matches the requested nodeType. @return The next node handle in the iteration, or END.
ParentIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public TypedChildrenIterator(int nodeType) { _nodeType = nodeType; }
Constructor TypedChildrenIterator @param nodeType The extended type ID being requested.
TypedChildrenIterator::TypedChildrenIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.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 : _firstch2(makeNodeIdentity(_startNode)); return resetPosition(); } return this; }
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END. @param node Sets the root of the iteration. @return A DTMAxisIterator set to the start of the iteration.
TypedChildrenIterator::setStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { int node = _currentNode; if (node == DTM.NULL) return DTM.NULL; final int nodeType = _nodeType; if (nodeType != DTM.ELEMENT_NODE) { while (node != DTM.NULL && _exptype2(node) != nodeType) { node = _nextsib2(node); } } // %OPT% If the nodeType is element (matching child::*), we only // need to compare the expType with DTM.NTYPES. A child node of // an element can be either an element, text, comment or // processing instruction node. Only element node has an extended // type greater than or equal to DTM.NTYPES. else { int eType; while (node != DTM.NULL) { eType = _exptype2(node); if (eType >= DTM.NTYPES) break; else node = _nextsib2(node); } } if (node == DTM.NULL) { _currentNode = DTM.NULL; return DTM.NULL; } else { _currentNode = _nextsib2(node); return returnNode(makeNodeHandle(node)); } }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
TypedChildrenIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int getNodeByPosition(int position) { if (position <= 0) return DTM.NULL; int node = _currentNode; int pos = 0; final int nodeType = _nodeType; if (nodeType != DTM.ELEMENT_NODE) { while (node != DTM.NULL) { if (_exptype2(node) == nodeType) { pos++; if (pos == position) return makeNodeHandle(node); } node = _nextsib2(node); } return NULL; } else { while (node != DTM.NULL) { if (_exptype2(node) >= DTM.NTYPES) { pos++; if (pos == position) return makeNodeHandle(node); } node = _nextsib2(node); } return NULL; } }
Return the node at the given position.
TypedChildrenIterator::getNodeByPosition
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public TypedRootIterator(int nodeType) { super(); _nodeType = nodeType; }
Constructor TypedRootIterator @param nodeType The extended type ID being requested.
TypedRootIterator::TypedRootIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { if(_startNode == _currentNode) return NULL; final int node = _startNode; int expType = _exptype2(makeNodeIdentity(node)); _currentNode = node; if (_nodeType >= DTM.NTYPES) { if (_nodeType == expType) { return returnNode(node); } } else { if (expType < DTM.NTYPES) { if (expType == _nodeType) { return returnNode(node); } } else { if (m_extendedTypes[expType].getNodeType() == _nodeType) { return returnNode(node); } } } return NULL; }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
TypedRootIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.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 = makeNodeIdentity(node); return resetPosition(); } return this; }
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END. @param node Sets the root of the iteration. @return A DTMAxisIterator set to the start of the iteration.
FollowingSiblingIterator::setStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { _currentNode = (_currentNode == DTM.NULL) ? DTM.NULL : _nextsib2(_currentNode); return returnNode(makeNodeHandle(_currentNode)); }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
FollowingSiblingIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public TypedFollowingSiblingIterator(int type) { _nodeType = type; }
Constructor TypedFollowingSiblingIterator @param type The extended type ID being requested.
TypedFollowingSiblingIterator::TypedFollowingSiblingIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { if (_currentNode == DTM.NULL) { return DTM.NULL; } int node = _currentNode; final int nodeType = _nodeType; if (nodeType != DTM.ELEMENT_NODE) { while ((node = _nextsib2(node)) != DTM.NULL && _exptype2(node) != nodeType) {} } else { while ((node = _nextsib2(node)) != DTM.NULL && _exptype2(node) < DTM.NTYPES) {} } _currentNode = node; return (node == DTM.NULL) ? DTM.NULL : returnNode(makeNodeHandle(node)); }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
TypedFollowingSiblingIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.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 = getFirstAttributeIdentity(makeNodeIdentity(node)); return resetPosition(); } return this; }
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END. @param node Sets the root of the iteration. @return A DTMAxisIterator set to the start of the iteration.
AttributeIterator::setStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { final int node = _currentNode; if (node != NULL) { _currentNode = getNextAttributeIdentity(node); return returnNode(makeNodeHandle(node)); } return NULL; }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
AttributeIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public TypedAttributeIterator(int nodeType) { _nodeType = nodeType; }
Constructor TypedAttributeIterator @param nodeType The extended type ID that is requested.
TypedAttributeIterator::TypedAttributeIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public DTMAxisIterator setStartNode(int node) { if (_isRestartable) { _startNode = node; _currentNode = getTypedAttribute(node, _nodeType); return resetPosition(); } return this; }
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END. @param node Sets the root of the iteration. @return A DTMAxisIterator set to the start of the iteration.
TypedAttributeIterator::setStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { final int node = _currentNode; // singleton iterator, since there can only be one attribute of // a given type. _currentNode = NULL; return returnNode(node); }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
TypedAttributeIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public boolean isReverse() { return true; }
True if this iterator has a reversed axis. @return true.
PrecedingSiblingIterator::isReverse
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.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; node = _startNodeID = makeNodeIdentity(node); if(node == NULL) { _currentNode = node; return resetPosition(); } int type = _type2(node); if(ExpandedNameTable.ATTRIBUTE == type || ExpandedNameTable.NAMESPACE == type ) { _currentNode = node; } else { // Be careful to handle the Document node properly _currentNode = _parent2(node); if(NULL!=_currentNode) _currentNode = _firstch2(_currentNode); else _currentNode = node; } return resetPosition(); } return this; }
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END. @param node Sets the root of the iteration. @return A DTMAxisIterator set to the start of the iteration.
PrecedingSiblingIterator::setStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { if (_currentNode == _startNodeID || _currentNode == DTM.NULL) { return NULL; } else { final int node = _currentNode; _currentNode = _nextsib2(node); return returnNode(makeNodeHandle(node)); } }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
PrecedingSiblingIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public TypedPrecedingSiblingIterator(int type) { _nodeType = type; }
Constructor TypedPrecedingSiblingIterator @param type The extended type ID being requested.
TypedPrecedingSiblingIterator::TypedPrecedingSiblingIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { int node = _currentNode; final int nodeType = _nodeType; final int startNodeID = _startNodeID; if (nodeType != DTM.ELEMENT_NODE) { while (node != NULL && node != startNodeID && _exptype2(node) != nodeType) { node = _nextsib2(node); } } else { while (node != NULL && node != startNodeID && _exptype2(node) < DTM.NTYPES) { node = _nextsib2(node); } } if (node == DTM.NULL || node == startNodeID) { _currentNode = NULL; return NULL; } else { _currentNode = _nextsib2(node); return returnNode(makeNodeHandle(node)); } }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
TypedPrecedingSiblingIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int getLast() { if (_last != -1) return _last; setMark(); int node = _currentNode; final int nodeType = _nodeType; final int startNodeID = _startNodeID; int last = 0; if (nodeType != DTM.ELEMENT_NODE) { while (node != NULL && node != startNodeID) { if (_exptype2(node) == nodeType) { last++; } node = _nextsib2(node); } } else { while (node != NULL && node != startNodeID) { if (_exptype2(node) >= DTM.NTYPES) { last++; } node = _nextsib2(node); } } gotoMark(); return (_last = last); }
Return the index of the last node in this iterator.
TypedPrecedingSiblingIterator::getLast
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public boolean isReverse() { return true; }
True if this iterator has a reversed axis. @return true since this iterator is a reversed axis.
PrecedingIterator::isReverse
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public DTMAxisIterator cloneIterator() { _isRestartable = false; try { final PrecedingIterator clone = (PrecedingIterator) super.clone(); final int[] stackCopy = new int[_stack.length]; System.arraycopy(_stack, 0, stackCopy, 0, _stack.length); clone._stack = stackCopy; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); } }
Returns a deep copy of this iterator. The cloned iterator is not reset. @return a deep copy of this iterator.
PrecedingIterator::cloneIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.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) { node = makeNodeIdentity(node); // iterator is not a clone int parent, index; if (_type2(node) == DTM.ATTRIBUTE_NODE) node = _parent2(node); _startNode = node; _stack[index = 0] = node; parent=node; while ((parent = _parent2(parent)) != NULL) { if (++index == _stack.length) { final int[] stack = new int[index*2]; System.arraycopy(_stack, 0, stack, 0, index); _stack = stack; } _stack[index] = parent; } if(index>0) --index; // Pop actual root node (if not start) back off the stack _currentNode=_stack[index]; // Last parent before root node _oldsp = _sp = index; return resetPosition(); } return this; }
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END. @param node Sets the root of the iteration. @return A DTMAxisIterator set to the start of the iteration.
PrecedingIterator::setStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { // Bugzilla 8324: We were forgetting to skip Attrs and NS nodes. // Also recoded the loop controls for clarity and to flatten out // the tail-recursion. for(++_currentNode; _sp>=0; ++_currentNode) { if(_currentNode < _stack[_sp]) { int type = _type2(_currentNode); if(type != ATTRIBUTE_NODE && type != NAMESPACE_NODE) return returnNode(makeNodeHandle(_currentNode)); } else --_sp; } return NULL; }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
PrecedingIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public DTMAxisIterator reset() { _sp = _oldsp; return resetPosition(); }
Resets the iterator to the last start node. @return A DTMAxisIterator, which may or may not be the same as this iterator.
PrecedingIterator::reset
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public TypedPrecedingIterator(int type) { _nodeType = type; }
Constructor TypedPrecedingIterator @param type The extended type ID being requested.
TypedPrecedingIterator::TypedPrecedingIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { int node = _currentNode; final int nodeType = _nodeType; if (nodeType >= DTM.NTYPES) { while (true) { node++; if (_sp < 0) { node = NULL; break; } else if (node >= _stack[_sp]) { if (--_sp < 0) { node = NULL; break; } } else if (_exptype2(node) == nodeType) { break; } } } else { int expType; while (true) { node++; if (_sp < 0) { node = NULL; break; } else if (node >= _stack[_sp]) { if (--_sp < 0) { node = NULL; break; } } else { expType = _exptype2(node); if (expType < DTM.NTYPES) { if (expType == nodeType) { break; } } else { if (m_extendedTypes[expType].getNodeType() == nodeType) { break; } } } } } _currentNode = node; return (node == NULL) ? NULL : returnNode(makeNodeHandle(node)); }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
TypedPrecedingIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.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 = m_traverser.first(node); node = makeNodeIdentity(node); int first; int type = _type2(node); if ((DTM.ATTRIBUTE_NODE == type) || (DTM.NAMESPACE_NODE == type)) { node = _parent2(node); first = _firstch2(node); if (NULL != first) { _currentNode = makeNodeHandle(first); return resetPosition(); } } do { first = _nextsib2(node); if (NULL == first) node = _parent2(node); } while (NULL == first && NULL != node); _currentNode = makeNodeHandle(first); // _currentNode precedes possible following(node) nodes return resetPosition(); } return this; }
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END. @param node Sets the root of the iteration. @return A DTMAxisIterator set to the start of the iteration.
FollowingIterator::setStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { int node = _currentNode; //_currentNode = m_traverser.next(_startNode, _currentNode); int current = makeNodeIdentity(node); while (true) { current++; int type = _type2(current); if (NULL == type) { _currentNode = NULL; return returnNode(node); } if (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type) continue; _currentNode = makeNodeHandle(current); return returnNode(node); } }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
FollowingIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public TypedFollowingIterator(int type) { _nodeType = type; }
Constructor TypedFollowingIterator @param type The extended type ID being requested.
TypedFollowingIterator::TypedFollowingIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { int current; int node; int type; final int nodeType = _nodeType; int currentNodeID = makeNodeIdentity(_currentNode); if (nodeType >= DTM.NTYPES) { do { node = currentNodeID; current = node; do { current++; type = _type2(current); } while (type != NULL && (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type)); currentNodeID = (type != NULL) ? current : NULL; } while (node != DTM.NULL && _exptype2(node) != nodeType); } else { do { node = currentNodeID; current = node; do { current++; type = _type2(current); } while (type != NULL && (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type)); currentNodeID = (type != NULL) ? current : NULL; } while (node != DTM.NULL && (_exptype2(node) != nodeType && _type2(node) != nodeType)); } _currentNode = makeNodeHandle(currentNodeID); return (node == DTM.NULL ? DTM.NULL :returnNode(makeNodeHandle(node))); }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
TypedFollowingIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int getStartNode() { return m_realStartNode; }
Get start to END should 'close' the iterator, i.e. subsequent call to next() should return END. @return The root node of the iteration.
AncestorIterator::getStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public final boolean isReverse() { return true; }
True if this iterator has a reversed axis. @return true since this iterator is a reversed axis.
AncestorIterator::isReverse
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public DTMAxisIterator cloneIterator() { _isRestartable = false; // must set to false for any clone try { final AncestorIterator clone = (AncestorIterator) super.clone(); clone._startNode = _startNode; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); } }
Returns a deep copy of this iterator. The cloned iterator is not reset. @return a deep copy of this iterator.
AncestorIterator::cloneIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public DTMAxisIterator setStartNode(int node) { //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily if (node == DTMDefaultBase.ROOTNODE) node = getDocument(); m_realStartNode = node; if (_isRestartable) { int nodeID = makeNodeIdentity(node); m_size = 0; if (nodeID == DTM.NULL) { _currentNode = DTM.NULL; m_ancestorsPos = 0; return this; } // Start from the current node's parent if // _includeSelf is false. if (!_includeSelf) { nodeID = _parent2(nodeID); node = makeNodeHandle(nodeID); } _startNode = node; while (nodeID != END) { //m_ancestors.addElement(node); if (m_size >= m_ancestors.length) { int[] newAncestors = new int[m_size * 2]; System.arraycopy(m_ancestors, 0, newAncestors, 0, m_ancestors.length); m_ancestors = newAncestors; } m_ancestors[m_size++] = node; nodeID = _parent2(nodeID); node = makeNodeHandle(nodeID); } m_ancestorsPos = m_size - 1; _currentNode = (m_ancestorsPos>=0) ? m_ancestors[m_ancestorsPos] : DTM.NULL; return resetPosition(); } return this; }
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END. @param node Sets the root of the iteration. @return A DTMAxisIterator set to the start of the iteration.
AncestorIterator::setStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public DTMAxisIterator reset() { m_ancestorsPos = m_size - 1; _currentNode = (m_ancestorsPos >= 0) ? m_ancestors[m_ancestorsPos] : DTM.NULL; return resetPosition(); }
Resets the iterator to the last start node. @return A DTMAxisIterator, which may or may not be the same as this iterator.
AncestorIterator::reset
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { int next = _currentNode; int pos = --m_ancestorsPos; _currentNode = (pos >= 0) ? m_ancestors[m_ancestorsPos] : DTM.NULL; return returnNode(next); }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
AncestorIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public TypedAncestorIterator(int type) { _nodeType = type; }
Constructor TypedAncestorIterator @param type The extended type ID being requested.
TypedAncestorIterator::TypedAncestorIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public DTMAxisIterator setStartNode(int node) { //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily if (node == DTMDefaultBase.ROOTNODE) node = getDocument(); m_realStartNode = node; if (_isRestartable) { int nodeID = makeNodeIdentity(node); m_size = 0; if (nodeID == DTM.NULL) { _currentNode = DTM.NULL; m_ancestorsPos = 0; return this; } final int nodeType = _nodeType; if (!_includeSelf) { nodeID = _parent2(nodeID); node = makeNodeHandle(nodeID); } _startNode = node; if (nodeType >= DTM.NTYPES) { while (nodeID != END) { int eType = _exptype2(nodeID); if (eType == nodeType) { if (m_size >= m_ancestors.length) { int[] newAncestors = new int[m_size * 2]; System.arraycopy(m_ancestors, 0, newAncestors, 0, m_ancestors.length); m_ancestors = newAncestors; } m_ancestors[m_size++] = makeNodeHandle(nodeID); } nodeID = _parent2(nodeID); } } else { while (nodeID != END) { int eType = _exptype2(nodeID); if ((eType < DTM.NTYPES && eType == nodeType) || (eType >= DTM.NTYPES && m_extendedTypes[eType].getNodeType() == nodeType)) { if (m_size >= m_ancestors.length) { int[] newAncestors = new int[m_size * 2]; System.arraycopy(m_ancestors, 0, newAncestors, 0, m_ancestors.length); m_ancestors = newAncestors; } m_ancestors[m_size++] = makeNodeHandle(nodeID); } nodeID = _parent2(nodeID); } } m_ancestorsPos = m_size - 1; _currentNode = (m_ancestorsPos>=0) ? m_ancestors[m_ancestorsPos] : DTM.NULL; return resetPosition(); } return this; }
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END. @param node Sets the root of the iteration. @return A DTMAxisIterator set to the start of the iteration.
TypedAncestorIterator::setStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int getNodeByPosition(int position) { if (position > 0 && position <= m_size) { return m_ancestors[position-1]; } else return DTM.NULL; }
Return the node at the given position.
TypedAncestorIterator::getNodeByPosition
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int getLast() { return m_size; }
Returns the position of the last node within the iteration, as defined by XPath.
TypedAncestorIterator::getLast
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.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) { node = makeNodeIdentity(node); _startNode = node; if (_includeSelf) node--; _currentNode = node; return resetPosition(); } return this; }
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END. @param node Sets the root of the iteration. @return A DTMAxisIterator set to the start of the iteration.
DescendantIterator::setStartNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
protected final boolean isDescendant(int identity) { return (_parent2(identity) >= _startNode) || (_startNode == identity); }
Tell if this node identity is a descendant. Assumes that the node info for the element has already been obtained. This one-sided test works only if the parent has been previously tested and is known to be a descendent. It fails if the parent is the _startNode's next sibling, or indeed any node that follows _startNode in document order. That may suffice for this iterator, but it's not really an isDescendent() test. %REVIEW% rename? @param identity The index number of the node in question. @return true if the index is a descendant of _startNode.
DescendantIterator::isDescendant
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { final int startNode = _startNode; if (startNode == NULL) { return NULL; } if (_includeSelf && (_currentNode + 1) == startNode) return returnNode(makeNodeHandle(++_currentNode)); // | m_dtmIdent); int node = _currentNode; int type; // %OPT% If the startNode is the root node, do not need // to do the isDescendant() check. if (startNode == ROOTNODE) { int eType; do { node++; eType = _exptype2(node); if (NULL == eType) { _currentNode = NULL; return END; } } while (eType == TEXT_NODE || (type = m_extendedTypes[eType].getNodeType()) == ATTRIBUTE_NODE || type == NAMESPACE_NODE); } else { do { node++; type = _type2(node); if (NULL == type ||!isDescendant(node)) { _currentNode = NULL; return END; } } while(ATTRIBUTE_NODE == type || TEXT_NODE == type || NAMESPACE_NODE == type); } _currentNode = node; return returnNode(makeNodeHandle(node)); // make handle. }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
DescendantIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public DTMAxisIterator reset() { final boolean temp = _isRestartable; _isRestartable = true; setStartNode(makeNodeHandle(_startNode)); _isRestartable = temp; return this; }
Reset.
DescendantIterator::reset
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public TypedDescendantIterator(int nodeType) { _nodeType = nodeType; }
Constructor TypedDescendantIterator @param nodeType Extended type ID being requested.
TypedDescendantIterator::TypedDescendantIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { final int startNode = _startNode; if (_startNode == NULL) { return NULL; } int node = _currentNode; int expType; final int nodeType = _nodeType; if (nodeType != DTM.ELEMENT_NODE) { do { node++; expType = _exptype2(node); if (NULL == expType || _parent2(node) < startNode && startNode != node) { _currentNode = NULL; return END; } } while (expType != nodeType); } // %OPT% If the start node is root (e.g. in the case of //node), // we can save the isDescendant() check, because all nodes are // descendants of root. else if (startNode == DTMDefaultBase.ROOTNODE) { do { node++; expType = _exptype2(node); if (NULL == expType) { _currentNode = NULL; return END; } } while (expType < DTM.NTYPES || m_extendedTypes[expType].getNodeType() != DTM.ELEMENT_NODE); } else { do { node++; expType = _exptype2(node); if (NULL == expType || _parent2(node) < startNode && startNode != node) { _currentNode = NULL; return END; } } while (expType < DTM.NTYPES || m_extendedTypes[expType].getNodeType() != DTM.ELEMENT_NODE); } _currentNode = node; return returnNode(makeNodeHandle(node)); }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
TypedDescendantIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public TypedSingletonIterator(int nodeType) { _nodeType = nodeType; }
Constructor TypedSingletonIterator @param nodeType The extended type ID being requested.
TypedSingletonIterator::TypedSingletonIterator
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int next() { final int result = _currentNode; if (result == END) return DTM.NULL; _currentNode = END; if (_nodeType >= DTM.NTYPES) { if (_exptype2(makeNodeIdentity(result)) == _nodeType) { return returnNode(result); } } else { if (_type2(makeNodeIdentity(result)) == _nodeType) { return returnNode(result); } } return NULL; }
Get the next node in the iteration. @return The next node handle in the iteration, or END.
TypedSingletonIterator::next
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public SAX2DTM2(DTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing) { this(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory, doIndexing, DEFAULT_BLOCKSIZE, true, true, false); }
Construct a SAX2DTM2 object using the default block size.
TypedSingletonIterator::SAX2DTM2
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public SAX2DTM2(DTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing, int blocksize, boolean usePrevsib, boolean buildIdIndex, boolean newNameTable) { super(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory, doIndexing, blocksize, usePrevsib, newNameTable); // Initialize the values of m_SHIFT and m_MASK. int shift; for(shift=0; (blocksize>>>=1) != 0; ++shift); m_blocksize = 1<<shift; m_SHIFT = shift; m_MASK = m_blocksize - 1; m_buildIdIndex = buildIdIndex; // Some documents do not have attribute nodes. That is why // we set the initial size of this Vector to be small and set // the increment to a bigger number. m_values = new Vector(32, 512); m_maxNodeIndex = 1 << DTMManager.IDENT_DTM_NODE_BITS; // Set the map0 values in the constructor. m_exptype_map0 = m_exptype.getMap0(); m_nextsib_map0 = m_nextsib.getMap0(); m_firstch_map0 = m_firstch.getMap0(); m_parent_map0 = m_parent.getMap0(); }
Construct a SAX2DTM2 object using the given block size.
TypedSingletonIterator::SAX2DTM2
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public final int _exptype(int identity) { return m_exptype.elementAt(identity); }
Override DTMDefaultBase._exptype() by dropping the incremental code. <p>This one is less efficient than _exptype2. It is only used during DTM building. _exptype2 is used after the document is fully built.
TypedSingletonIterator::_exptype
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public final int _exptype2(int identity) { //return m_exptype.elementAt(identity); if (identity < m_blocksize) return m_exptype_map0[identity]; else return m_exptype_map[identity>>>m_SHIFT][identity&m_MASK]; }
The optimized version of DTMDefaultBase._exptype(). @param identity A node identity, which <em>must not</em> be equal to <code>DTM.NULL</code>
TypedSingletonIterator::_exptype2
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public final int _nextsib2(int identity) { //return m_nextsib.elementAt(identity); if (identity < m_blocksize) return m_nextsib_map0[identity]; else return m_nextsib_map[identity>>>m_SHIFT][identity&m_MASK]; }
The optimized version of DTMDefaultBase._nextsib(). @param identity A node identity, which <em>must not</em> be equal to <code>DTM.NULL</code>
TypedSingletonIterator::_nextsib2
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public final int _firstch2(int identity) { //return m_firstch.elementAt(identity); if (identity < m_blocksize) return m_firstch_map0[identity]; else return m_firstch_map[identity>>>m_SHIFT][identity&m_MASK]; }
The optimized version of DTMDefaultBase._firstch(). @param identity A node identity, which <em>must not</em> be equal to <code>DTM.NULL</code>
TypedSingletonIterator::_firstch2
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public final int _parent2(int identity) { //return m_parent.elementAt(identity); if (identity < m_blocksize) return m_parent_map0[identity]; else return m_parent_map[identity>>>m_SHIFT][identity&m_MASK]; }
The optimized version of DTMDefaultBase._parent(). @param identity A node identity, which <em>must not</em> be equal to <code>DTM.NULL</code>
TypedSingletonIterator::_parent2
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public final int _type2(int identity) { //int eType = _exptype2(identity); int eType; if (identity < m_blocksize) eType = m_exptype_map0[identity]; else eType = m_exptype_map[identity>>>m_SHIFT][identity&m_MASK]; if (NULL != eType) return m_extendedTypes[eType].getNodeType(); else return NULL; }
The optimized version of DTMDefaultBase._type(). @param identity A node identity, which <em>must not</em> be equal to <code>DTM.NULL</code>
TypedSingletonIterator::_type2
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public final int getExpandedTypeID2(int nodeHandle) { int nodeID = makeNodeIdentity(nodeHandle); //return (nodeID != NULL) ? _exptype2(nodeID) : NULL; if (nodeID != NULL) { if (nodeID < m_blocksize) return m_exptype_map0[nodeID]; else return m_exptype_map[nodeID>>>m_SHIFT][nodeID&m_MASK]; } else return NULL; }
The optimized version of DTMDefaultBase.getExpandedTypeID(int). <p>This one is only used by DOMAdapter.getExpandedTypeID(int), which is mostly called from the compiled translets.
TypedSingletonIterator::getExpandedTypeID2
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public final int _exptype2Type(int exptype) { if (NULL != exptype) return m_extendedTypes[exptype].getNodeType(); else return NULL; }
Return the node type from the expanded type
TypedSingletonIterator::_exptype2Type
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public int getIdForNamespace(String uri) { int index = m_values.indexOf(uri); if (index < 0) { m_values.addElement(uri); return m_valueIndex++; } else return index; }
Get a prefix either from the uri mapping, or just make one up! @param uri The namespace URI, which may be null. @return The prefix if there is one, or null.
TypedSingletonIterator::getIdForNamespace
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { charactersFlush(); int exName = m_expandedNameTable.getExpandedTypeID(uri, localName, DTM.ELEMENT_NODE); int prefixIndex = (qName.length() != localName.length()) ? m_valuesOrPrefixes.stringToIndex(qName) : 0; int elemNode = addNode(DTM.ELEMENT_NODE, exName, m_parents.peek(), m_previous, prefixIndex, true); if(m_indexing) indexNode(exName, elemNode); m_parents.push(elemNode); int startDecls = m_contextIndexes.peek(); int nDecls = m_prefixMappings.size(); String prefix; if(!m_pastFirstElement) { // SPECIAL CASE: Implied declaration at root element prefix="xml"; String declURL = "http://www.w3.org/XML/1998/namespace"; exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE); m_values.addElement(declURL); int val = m_valueIndex++; addNode(DTM.NAMESPACE_NODE, exName, elemNode, DTM.NULL, val, false); m_pastFirstElement=true; } for (int i = startDecls; i < nDecls; i += 2) { prefix = (String) m_prefixMappings.elementAt(i); if (prefix == null) continue; String declURL = (String) m_prefixMappings.elementAt(i + 1); exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE); m_values.addElement(declURL); int val = m_valueIndex++; addNode(DTM.NAMESPACE_NODE, exName, elemNode, DTM.NULL, val, false); } int n = attributes.getLength(); for (int i = 0; i < n; i++) { String attrUri = attributes.getURI(i); String attrQName = attributes.getQName(i); String valString = attributes.getValue(i); int nodeType; String attrLocalName = attributes.getLocalName(i); if ((null != attrQName) && (attrQName.equals("xmlns") || attrQName.startsWith("xmlns:"))) { prefix = getPrefix(attrQName, attrUri); if (declAlreadyDeclared(prefix)) continue; // go to the next attribute. nodeType = DTM.NAMESPACE_NODE; } else { nodeType = DTM.ATTRIBUTE_NODE; if (m_buildIdIndex && attributes.getType(i).equalsIgnoreCase("ID")) setIDAttribute(valString, elemNode); } // Bit of a hack... if somehow valString is null, stringToIndex will // return -1, which will make things very unhappy. if(null == valString) valString = ""; m_values.addElement(valString); int val = m_valueIndex++; if (attrLocalName.length() != attrQName.length()) { prefixIndex = m_valuesOrPrefixes.stringToIndex(attrQName); int dataIndex = m_data.size(); m_data.addElement(prefixIndex); m_data.addElement(val); val = -dataIndex; } exName = m_expandedNameTable.getExpandedTypeID(attrUri, attrLocalName, nodeType); addNode(nodeType, exName, elemNode, DTM.NULL, val, false); } if (null != m_wsfilter) { short wsv = m_wsfilter.getShouldStripSpace(makeNodeHandle(elemNode), this); boolean shouldStrip = (DTMWSFilter.INHERIT == wsv) ? getShouldStripWhitespace() : (DTMWSFilter.STRIP == wsv); pushShouldStripWhitespace(shouldStrip); } m_previous = DTM.NULL; m_contextIndexes.push(m_prefixMappings.size()); // for the children. }
Override SAX2DTM.startElement() <p>Receive notification of the start of an element. <p>By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).</p> @param uri The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. @param localName The local name (without prefix), or the empty string if Namespace processing is not being performed. @param qName The qualified name (with prefix), or the empty string if qualified names are not available. @param attributes The specified or defaulted attributes. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#startElement
TypedSingletonIterator::startElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public void endElement(String uri, String localName, String qName) throws SAXException { charactersFlush(); // If no one noticed, startPrefixMapping is a drag. // Pop the context for the last child (the one pushed by startElement) m_contextIndexes.quickPop(1); // Do it again for this one (the one pushed by the last endElement). int topContextIndex = m_contextIndexes.peek(); if (topContextIndex != m_prefixMappings.size()) { m_prefixMappings.setSize(topContextIndex); } m_previous = m_parents.pop(); popShouldStripWhitespace(); }
Receive notification of the end of an element. <p>By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).</p> @param uri The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. @param localName The local name (without prefix), or the empty string if Namespace processing is not being performed. @param qName The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#endElement
TypedSingletonIterator::endElement
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public void comment(char ch[], int start, int length) throws SAXException { if (m_insideDTD) // ignore comments if we're inside the DTD return; charactersFlush(); // %OPT% Saving the comment string in a Vector has a lower cost than // saving it in DTMStringPool. m_values.addElement(new String(ch, start, length)); int dataIndex = m_valueIndex++; m_previous = addNode(DTM.COMMENT_NODE, DTM.COMMENT_NODE, m_parents.peek(), m_previous, dataIndex, false); }
Report an XML comment anywhere in the document. <p>This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read).</p> @param ch An array holding the characters in the comment. @param start The starting position in the array. @param length The number of characters to use from the array. @throws SAXException The application may raise an exception.
TypedSingletonIterator::comment
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public void startDocument() throws SAXException { int doc = addNode(DTM.DOCUMENT_NODE, DTM.DOCUMENT_NODE, DTM.NULL, DTM.NULL, 0, true); m_parents.push(doc); m_previous = DTM.NULL; m_contextIndexes.push(m_prefixMappings.size()); // for the next element. }
Receive notification of the beginning of the document. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#startDocument
TypedSingletonIterator::startDocument
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public void endDocument() throws SAXException { super.endDocument(); // Add a NULL entry to the end of the node arrays as // the end indication. m_exptype.addElement(NULL); m_parent.addElement(NULL); m_nextsib.addElement(NULL); m_firstch.addElement(NULL); // Set the cached references after the document is built. m_extendedTypes = m_expandedNameTable.getExtendedTypes(); m_exptype_map = m_exptype.getMap(); m_nextsib_map = m_nextsib.getMap(); m_firstch_map = m_firstch.getMap(); m_parent_map = m_parent.getMap(); }
Receive notification of the end of the document. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#endDocument
TypedSingletonIterator::endDocument
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
protected final int addNode(int type, int expandedTypeID, int parentIndex, int previousSibling, int dataOrPrefix, boolean canHaveFirstChild) { // Common to all nodes: int nodeIndex = m_size++; // Have we overflowed a DTM Identity's addressing range? //if(m_dtmIdent.size() == (nodeIndex>>>DTMManager.IDENT_DTM_NODE_BITS)) if (nodeIndex == m_maxNodeIndex) { addNewDTMID(nodeIndex); m_maxNodeIndex += (1 << DTMManager.IDENT_DTM_NODE_BITS); } m_firstch.addElement(DTM.NULL); m_nextsib.addElement(DTM.NULL); m_parent.addElement(parentIndex); m_exptype.addElement(expandedTypeID); m_dataOrQName.addElement(dataOrPrefix); if (m_prevsib != null) { m_prevsib.addElement(previousSibling); } if (m_locator != null && m_useSourceLocationProperty) { setSourceLocation(); } // Note that nextSibling is not processed until charactersFlush() // is called, to handle successive characters() events. // Special handling by type: Declare namespaces, attach first child switch(type) { case DTM.NAMESPACE_NODE: declareNamespaceInContext(parentIndex,nodeIndex); break; case DTM.ATTRIBUTE_NODE: break; default: if (DTM.NULL != previousSibling) { m_nextsib.setElementAt(nodeIndex,previousSibling); } else if (DTM.NULL != parentIndex) { m_firstch.setElementAt(nodeIndex,parentIndex); } break; } return nodeIndex; }
Construct the node map from the node. @param type raw type ID, one of DTM.XXX_NODE. @param expandedTypeID The expended type ID. @param parentIndex The current parent index. @param previousSibling The previous sibling index. @param dataOrPrefix index into m_data table, or string handle. @param canHaveFirstChild true if the node can have a first child, false if it is atomic. @return The index identity of the node that was added.
TypedSingletonIterator::addNode
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
protected final void charactersFlush() { if (m_textPendingStart >= 0) // -1 indicates no-text-in-progress { int length = m_chars.size() - m_textPendingStart; boolean doStrip = false; if (getShouldStripWhitespace()) { doStrip = m_chars.isWhitespace(m_textPendingStart, length); } if (doStrip) { m_chars.setLength(m_textPendingStart); // Discard accumulated text } else { // Guard against characters/ignorableWhitespace events that // contained no characters. They should not result in a node. if (length > 0) { // If the offset and length do not exceed the given limits // (offset < 2^21 and length < 2^10), then save both the offset // and length in a bitwise encoded value. if (length <= TEXT_LENGTH_MAX && m_textPendingStart <= TEXT_OFFSET_MAX) { m_previous = addNode(m_coalescedTextType, DTM.TEXT_NODE, m_parents.peek(), m_previous, length + (m_textPendingStart << TEXT_LENGTH_BITS), false); } else { // Store offset and length in the m_data array if one exceeds // the given limits. Use a negative dataIndex as an indication. int dataIndex = m_data.size(); m_previous = addNode(m_coalescedTextType, DTM.TEXT_NODE, m_parents.peek(), m_previous, -dataIndex, false); m_data.addElement(m_textPendingStart); m_data.addElement(length); } } } // Reset for next text block m_textPendingStart = -1; m_textType = m_coalescedTextType = DTM.TEXT_NODE; } }
Check whether accumulated text should be stripped; if not, append the appropriate flavor of text/cdata node.
TypedSingletonIterator::charactersFlush
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0
public void processingInstruction(String target, String data) throws SAXException { charactersFlush(); int dataIndex = m_data.size(); m_previous = addNode(DTM.PROCESSING_INSTRUCTION_NODE, DTM.PROCESSING_INSTRUCTION_NODE, m_parents.peek(), m_previous, -dataIndex, false); m_data.addElement(m_valuesOrPrefixes.stringToIndex(target)); m_values.addElement(data); m_data.addElement(m_valueIndex++); }
Override the processingInstruction() interface in SAX2DTM2. <p> %OPT% This one is different from SAX2DTM.processingInstruction() in that we do not use extended types for PI nodes. The name of the PI is saved in the DTMStringPool. Receive notification of a processing instruction. @param target The processing instruction target. @param data The processing instruction data, or null if none is supplied. @throws SAXException Any SAX exception, possibly wrapping another exception. @see org.xml.sax.ContentHandler#processingInstruction
TypedSingletonIterator::processingInstruction
java
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
https://github.com/google/j2objc/blob/master/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
Apache-2.0