当前位置: 首页>>代码示例>>Java>>正文


Java DTMAxisIterator类代码示例

本文整理汇总了Java中com.sun.org.apache.xml.internal.dtm.DTMAxisIterator的典型用法代码示例。如果您正苦于以下问题:Java DTMAxisIterator类的具体用法?Java DTMAxisIterator怎么用?Java DTMAxisIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DTMAxisIterator类属于com.sun.org.apache.xml.internal.dtm包,在下文中一共展示了DTMAxisIterator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: referenceToString

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
/**
 * Utility function: used to convert reference to String.
 */
public static String referenceToString(Object obj, DOM dom) {
    if (obj instanceof String) {
        return (String) obj;
    }
    else if (obj instanceof DTMAxisIterator) {
        return dom.getStringValueX(((DTMAxisIterator)obj).reset().next());
    }
    else if (obj instanceof Node) {
        return dom.getStringValueX(((Node)obj).node);
    }
    else if (obj instanceof DOM) {
        return ((DOM) obj).getStringValue();
    }
    else {
        final String className = obj.getClass().getName();
        runTimeError(DATA_CONVERSION_ERR, className, String.class);
        return null;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:BasisLibrary.java

示例2: next

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
public int next() {
    if (_ready) {
        _ready = false;
        return _source.getNodeByPosition(_position);
    }
    return DTMAxisIterator.END;
    /*
    if (_ready && _position > 0) {
        final int pos = _source.isReverse()
                                   ? _source.getLast() - _position + 1
                                   : _position;

        _ready = false;
        int node;
        while ((node = _source.next()) != DTMAxisIterator.END) {
            if (pos == _source.getPosition()) {
                return node;
            }
        }
    }
    return DTMAxisIterator.END;
    */
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:NthIterator.java

示例3: getNamespaceAxisIterator

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
/**
 * Do not think that this returns an iterator for the namespace axis.
 * It returns an iterator with nodes that belong in a certain namespace,
 * such as with <xsl:apply-templates select="blob/foo:*"/>
 * The 'axis' specifies the axis for the base iterator from which the
 * nodes are taken, while 'ns' specifies the namespace URI type.
 */
public DTMAxisIterator getNamespaceAxisIterator(int axis, int ns)
{

    DTMAxisIterator iterator = null;

    if (ns == NO_TYPE) {
        return EMPTYITERATOR;
    }
    else {
        switch (axis) {
            case Axis.CHILD:
                return new NamespaceChildrenIterator(ns);
            case Axis.ATTRIBUTE:
                return new NamespaceAttributeIterator(ns);
            default:
                return new NamespaceWildcardIterator(axis, ns);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:SAXImpl.java

示例4: getAxisIterator

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
public DTMAxisIterator getAxisIterator(final int axis)
{
    switch (axis)
    {
        case Axis.CHILD:
        case Axis.DESCENDANT:
            return new SimpleIterator(SimpleIterator.DIRECTION_DOWN);
        case Axis.PARENT:
        case Axis.ANCESTOR:
            return new SimpleIterator(SimpleIterator.DIRECTION_UP);
        case Axis.ANCESTORORSELF:
            return (new SimpleIterator(SimpleIterator.DIRECTION_UP)).includeSelf();
        case Axis.DESCENDANTORSELF:
            return (new SimpleIterator(SimpleIterator.DIRECTION_DOWN)).includeSelf();
        case Axis.SELF:
            return new SingletonIterator();
        default:
            return EMPTY_ITERATOR;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:SimpleResultTreeImpl.java

示例5: cloneIterator

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
/**
 * Clone a <code>SortingIterator</code> by cloning its source
 * iterator and then sharing the factory and the array of
 * <code>NodeSortRecords</code>.
 */
public DTMAxisIterator cloneIterator() {
    try {
        final SortingIterator clone = (SortingIterator) super.clone();
        clone._source = _source.cloneIterator();
        clone._factory = _factory;          // shared between clones
        clone._data = _data;                // shared between clones
        clone._free = _free;
        clone._current = _current;
        clone.setRestartable(false);
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:SortingIterator.java

示例6: next

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
/**
 * Get the next node in the iteration.
 *
 * @return The next node handle in the iteration, or END.
 */
public int next() {
    int nodeHandle;

    // If at most one key value or at most one string argument to id
    // resulted in nodes being returned, use the IntegerArray
    // stored at _nodes directly.  This relies on the fact that the
    // IntegerArray never includes duplicate nodes and is always stored
    // in document order.
    if (_nodes != null) {
        if (_position < _nodes.cardinality()) {
            nodeHandle = returnNode(_nodes.at(_position));
        } else {
            nodeHandle = DTMAxisIterator.END;
        }
    } else {
        nodeHandle = super.next();
    }

    return nodeHandle;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:KeyIndex.java

示例7: document

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
private static DTMAxisIterator document(DTMAxisIterator arg1,
                                        String baseURI,
                                        AbstractTranslet translet, DOM dom)
throws Exception
{
    UnionIterator union = new UnionIterator(dom);
    int node = DTM.NULL;

    while ((node = arg1.next()) != DTM.NULL) {
        String uri = dom.getStringValueX(node);
        //document(node-set) if true;  document(node-set,node-set) if false
        if (baseURI  == null) {
           baseURI = dom.getDocumentURI(node);
           if (!SystemIDResolver.isAbsoluteURI(baseURI))
                baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI);
        }
        union.addIterator(document(uri, baseURI, translet, dom));
    }
    return(union);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:LoadDocument.java

示例8: cloneIterator

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
/**
 * Returns a deep copy of this iterator. Cloned iterators may not be
 * restartable. The iterator being cloned may or may not become
 * non-restartable as a side effect of this operation.
 *
 * @return a deep copy of this iterator.
 */
public DTMAxisIterator cloneIterator()
{

  try
  {
    final DTMAxisIteratorBase clone = (DTMAxisIteratorBase) super.clone();

    clone._isRestartable = false;

    // return clone.reset();
    return clone;
  }
  catch (CloneNotSupportedException e)
  {
    throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:DTMAxisIteratorBase.java

示例9: item

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
/**
 * Returns the <code>index</code>th item in the collection. If
 * <code>index</code> is greater than or equal to the number of nodes in
 * the list, this returns <code>null</code>.
 * @param index Index into the collection.
 * @return The node at the <code>index</code>th position in the
 *   <code>NodeList</code>, or <code>null</code> if that is not a valid
 *   index.
 */
public Node item(int index) {
    if (m_iter != null) {
        int node = 0;
        int count = m_cachedNodes.size();

        if (count > index) {
            node = m_cachedNodes.elementAt(index);
            return m_dtm.getNode(node);
        } else if (m_last == -1) {
            while (count <= index
                    && ((node = m_iter.next()) != DTMAxisIterator.END)) {
                m_cachedNodes.addElement(node);
                count++;
            }
            if (node == DTMAxisIterator.END) {
                m_last = count;
            } else {
                return m_dtm.getNode(node);
            }
        }
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:33,代码来源:DTMAxisIterNodeList.java

示例10: setStartNode

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
/**
     * 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.
     */
    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;
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:SAX2DTM2.java

示例11: setStartNode

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
public DTMAxisIterator setStartNode(int node) {
    if (_isRestartable) {
        _startNode = node;
        for (int i = 0; i < _free; i++) {
            if(!_heap[i]._isStartSet){
               _heap[i].setStartNode(node);
               _heap[i].step();     // to get the first node
               _heap[i]._isStartSet = true;
            }
        }
        // build heap
        for (int i = (_heapSize = _free)/2; i >= 0; i--) {
            heapify(i);
        }
        _returnedLast = END;
        return resetPosition();
    }
    return this;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:MultiValuedNodeHeapIterator.java

示例12: cloneIterator

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
/**
 * Returns a deep copy of this iterator.   The cloned iterator is not reset.
 *
 * @return a deep copy of this iterator.
 */
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.");
  }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:SAX2DTM2.java

示例13: getTypedAxisIterator

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
public DTMAxisIterator getTypedAxisIterator(final int axis, final int type)
{
    switch (axis)
    {
        case Axis.CHILD:
        case Axis.DESCENDANT:
            return new SimpleIterator(SimpleIterator.DIRECTION_DOWN, type);
        case Axis.PARENT:
        case Axis.ANCESTOR:
            return new SimpleIterator(SimpleIterator.DIRECTION_UP, type);
        case Axis.ANCESTORORSELF:
            return (new SimpleIterator(SimpleIterator.DIRECTION_UP, type)).includeSelf();
        case Axis.DESCENDANTORSELF:
            return (new SimpleIterator(SimpleIterator.DIRECTION_DOWN, type)).includeSelf();
        case Axis.SELF:
            return new SingletonIterator(type);
        default:
            return EMPTY_ITERATOR;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:SimpleResultTreeImpl.java

示例14: setStartNode

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
public DTMAxisIterator setStartNode(int node)
{
    if (_isRestartable) {
        _source.setStartNode(_startNode = node);
        return resetPosition();
    }
    return this;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:SAXImpl.java

示例15: OneStepIterator

import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; //导入依赖的package包/类
/**
 * Create a OneStepIterator object.
 *
 * @param iterator The DTM iterator which this iterator will use.
 * @param axis One of Axis.Child, etc., or -1 if the axis is unknown.
 *
 * @throws javax.xml.transform.TransformerException
 */
public OneStepIterator(DTMAxisIterator iterator, int axis)
        throws javax.xml.transform.TransformerException
{
  super(null);

  m_iterator = iterator;
  m_axis = axis;
  int whatToShow = DTMFilter.SHOW_ALL;
  initNodeTest(whatToShow);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:OneStepIterator.java


注:本文中的com.sun.org.apache.xml.internal.dtm.DTMAxisIterator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。