com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary Java Examples

The following examples show how to use com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SAXImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator()
{
    try {
        NodeValueIterator clone = (NodeValueIterator)super.clone();
        clone._isRestartable = false;
        clone._source = _source.cloneIterator();
        clone._value = _value;
        clone._op = _op;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #2
Source File: SAXImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator()
{
    try {
        NodeValueIterator clone = (NodeValueIterator)super.clone();
        clone._isRestartable = false;
        clone._source = _source.cloneIterator();
        clone._value = _value;
        clone._op = _op;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #3
Source File: MultiValuedNodeHeapIterator.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator() {
    _isRestartable = false;
    final HeapNode[] heapCopy = new HeapNode[_heap.length];
    try {
        MultiValuedNodeHeapIterator clone =
                (MultiValuedNodeHeapIterator)super.clone();

        for (int i = 0; i < _free; i++) {
            heapCopy[i] = _heap[i].cloneHeapNode();
        }
        clone.setRestartable(false);
        clone._heap = heapCopy;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #4
Source File: SAXImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator()
{
    try {
        NodeValueIterator clone = (NodeValueIterator)super.clone();
        clone._isRestartable = false;
        clone._source = _source.cloneIterator();
        clone._value = _value;
        clone._op = _op;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #5
Source File: StepIterator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator() {
    _isRestartable = false;
    try {
        final StepIterator clone = (StepIterator) super.clone();
        clone._source = _source.cloneIterator();
        clone._iterator = _iterator.cloneIterator();
        clone._iterator.setRestartable(true);       // must be restartable
        clone._isRestartable = false;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #6
Source File: SAXImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Returns a deep copy of this iterator.  The cloned iterator is not
 * reset.
 *
 * @return a deep copy of this iterator.
 */
public DTMAxisIterator cloneIterator() {
    try {
        DTMAxisIterator nestedClone = m_baseIterator.cloneIterator();
        NamespaceWildcardIterator clone =
            (NamespaceWildcardIterator) super.clone();

        clone.m_baseIterator = nestedClone;
        clone.m_nsType = m_nsType;
        clone._isRestartable = false;

        return clone;
    } catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #7
Source File: MultiValuedNodeHeapIterator.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator() {
    _isRestartable = false;
    final HeapNode[] heapCopy = new HeapNode[_heap.length];
    try {
        MultiValuedNodeHeapIterator clone =
                (MultiValuedNodeHeapIterator)super.clone();

        for (int i = 0; i < _free; i++) {
            heapCopy[i] = _heap[i].cloneHeapNode();
        }
        clone.setRestartable(false);
        clone._heap = heapCopy;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #8
Source File: SortingIterator.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * 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;
    }
}
 
Example #9
Source File: SAXImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns a deep copy of this iterator.  The cloned iterator is not
 * reset.
 *
 * @return a deep copy of this iterator.
 */
public DTMAxisIterator cloneIterator() {
    try {
        DTMAxisIterator nestedClone = m_baseIterator.cloneIterator();
        NamespaceWildcardIterator clone =
            (NamespaceWildcardIterator) super.clone();

        clone.m_baseIterator = nestedClone;
        clone.m_nsType = m_nsType;
        clone._isRestartable = false;

        return clone;
    } catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #10
Source File: MultiValuedNodeHeapIterator.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator() {
    _isRestartable = false;
    final HeapNode[] heapCopy = new HeapNode[_heap.length];
    try {
        MultiValuedNodeHeapIterator clone =
                (MultiValuedNodeHeapIterator)super.clone();

        for (int i = 0; i < _free; i++) {
            heapCopy[i] = _heap[i].cloneHeapNode();
        }
        clone.setRestartable(false);
        clone._heap = heapCopy;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #11
Source File: MultiValuedNodeHeapIterator.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a deep copy of this {@link HeapNode}.  The clone is not
 * reset from the current position of the original.
 *
 * @return the cloned heap node
 */
public HeapNode cloneHeapNode() {
    HeapNode clone;

    try {
        clone = (HeapNode) super.clone();
    } catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }

    clone._node = _node;
    clone._markedNode = _node;

    return clone;
}
 
Example #12
Source File: MultiValuedNodeHeapIterator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator() {
    _isRestartable = false;
    final HeapNode[] heapCopy = new HeapNode[_heap.length];
    try {
        MultiValuedNodeHeapIterator clone =
                (MultiValuedNodeHeapIterator)super.clone();

        for (int i = 0; i < _free; i++) {
            heapCopy[i] = _heap[i].cloneHeapNode();
        }
        clone.setRestartable(false);
        clone._heap = heapCopy;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #13
Source File: SAXImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Lookup a namespace URI from a prefix starting at node. This method
 * is used in the execution of xsl:element when the prefix is not known
 * at compile time.
 */
public String lookupNamespace(int node, String prefix)
    throws TransletException
{
    int anode, nsnode;
    final AncestorIterator ancestors = new AncestorIterator();

    if (isElement(node)) {
        ancestors.includeSelf();
    }

    ancestors.setStartNode(node);
    while ((anode = ancestors.next()) != DTM.NULL) {
        final NamespaceIterator namespaces = new NamespaceIterator();

        namespaces.setStartNode(anode);
        while ((nsnode = namespaces.next()) != DTM.NULL) {
            if (getLocalName(nsnode).equals(prefix)) {
                return getNodeValue(nsnode);
            }
        }
    }

    BasisLibrary.runTimeError(BasisLibrary.NAMESPACE_PREFIX_ERR, prefix);
    return null;
}
 
Example #14
Source File: MultiValuedNodeHeapIterator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator() {
    _isRestartable = false;
    final HeapNode[] heapCopy = new HeapNode[_heap.length];
    try {
        MultiValuedNodeHeapIterator clone =
                (MultiValuedNodeHeapIterator)super.clone();

        for (int i = 0; i < _free; i++) {
            heapCopy[i] = _heap[i].cloneHeapNode();
        }
        clone.setRestartable(false);
        clone._heap = heapCopy;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #15
Source File: SAXImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public DTMAxisIterator cloneIterator()
{
    try {
        NodeValueIterator clone = (NodeValueIterator)super.clone();
        clone._isRestartable = false;
        clone._source = _source.cloneIterator();
        clone._value = _value;
        clone._op = _op;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #16
Source File: SAXImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Lookup a namespace URI from a prefix starting at node. This method
 * is used in the execution of xsl:element when the prefix is not known
 * at compile time.
 */
public String lookupNamespace(int node, String prefix)
    throws TransletException
{
    int anode, nsnode;
    final AncestorIterator ancestors = new AncestorIterator();

    if (isElement(node)) {
        ancestors.includeSelf();
    }

    ancestors.setStartNode(node);
    while ((anode = ancestors.next()) != DTM.NULL) {
        final NamespaceIterator namespaces = new NamespaceIterator();

        namespaces.setStartNode(anode);
        while ((nsnode = namespaces.next()) != DTM.NULL) {
            if (getLocalName(nsnode).equals(prefix)) {
                return getNodeValue(nsnode);
            }
        }
    }

    BasisLibrary.runTimeError(BasisLibrary.NAMESPACE_PREFIX_ERR, prefix);
    return null;
}
 
Example #17
Source File: SAXImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator()
{
    try {
        NodeValueIterator clone = (NodeValueIterator)super.clone();
        clone._isRestartable = false;
        clone._source = _source.cloneIterator();
        clone._value = _value;
        clone._op = _op;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #18
Source File: MultiValuedNodeHeapIterator.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a deep copy of this {@link HeapNode}.  The clone is not
 * reset from the current position of the original.
 *
 * @return the cloned heap node
 */
public HeapNode cloneHeapNode() {
    HeapNode clone;

    try {
        clone = (HeapNode) super.clone();
    } catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }

    clone._node = _node;
    clone._markedNode = _node;

    return clone;
}
 
Example #19
Source File: StepIterator.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator() {
    _isRestartable = false;
    try {
        final StepIterator clone = (StepIterator) super.clone();
        clone._source = _source.cloneIterator();
        clone._iterator = _iterator.cloneIterator();
        clone._iterator.setRestartable(true);       // must be restartable
        clone._isRestartable = false;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #20
Source File: SortingIterator.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
    }
}
 
Example #21
Source File: SAXImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator()
{
    try {
        NodeValueIterator clone = (NodeValueIterator)super.clone();
        clone._isRestartable = false;
        clone._source = _source.cloneIterator();
        clone._value = _value;
        clone._op = _op;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #22
Source File: SAXImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Lookup a namespace URI from a prefix starting at node. This method
 * is used in the execution of xsl:element when the prefix is not known
 * at compile time.
 */
public String lookupNamespace(int node, String prefix)
    throws TransletException
{
    int anode, nsnode;
    final AncestorIterator ancestors = new AncestorIterator();

    if (isElement(node)) {
        ancestors.includeSelf();
    }

    ancestors.setStartNode(node);
    while ((anode = ancestors.next()) != DTM.NULL) {
        final NamespaceIterator namespaces = new NamespaceIterator();

        namespaces.setStartNode(anode);
        while ((nsnode = namespaces.next()) != DTM.NULL) {
            if (getLocalName(nsnode).equals(prefix)) {
                return getNodeValue(nsnode);
            }
        }
    }

    BasisLibrary.runTimeError(BasisLibrary.NAMESPACE_PREFIX_ERR, prefix);
    return null;
}
 
Example #23
Source File: StepIterator.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public DTMAxisIterator cloneIterator() {
    _isRestartable = false;
    try {
        final StepIterator clone = (StepIterator) super.clone();
        clone._source = _source.cloneIterator();
        clone._iterator = _iterator.cloneIterator();
        clone._iterator.setRestartable(true);       // must be restartable
        clone._isRestartable = false;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #24
Source File: SAXImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This is a shortcut to the iterators that implement the
 * supported XPath axes (only namespace::) is not supported.
 * Returns a bare-bones iterator that must be initialized
 * with a start node (using iterator.setStartNode()).
 */
public DTMAxisIterator getAxisIterator(final int axis)
{
    switch (axis)
    {
        case Axis.SELF:
            return new SingletonIterator();
        case Axis.CHILD:
            return new ChildrenIterator();
        case Axis.PARENT:
            return new ParentIterator();
        case Axis.ANCESTOR:
            return new AncestorIterator();
        case Axis.ANCESTORORSELF:
            return (new AncestorIterator()).includeSelf();
        case Axis.ATTRIBUTE:
            return new AttributeIterator();
        case Axis.DESCENDANT:
            return new DescendantIterator();
        case Axis.DESCENDANTORSELF:
            return (new DescendantIterator()).includeSelf();
        case Axis.FOLLOWING:
            return new FollowingIterator();
        case Axis.PRECEDING:
            return new PrecedingIterator();
        case Axis.FOLLOWINGSIBLING:
            return new FollowingSiblingIterator();
        case Axis.PRECEDINGSIBLING:
            return new PrecedingSiblingIterator();
        case Axis.NAMESPACE:
            return new NamespaceIterator();
        case Axis.ROOT:
            return new RootIterator();
        default:
            BasisLibrary.runTimeError(BasisLibrary.AXIS_SUPPORT_ERR,
                    Axis.getNames(axis));
    }
    return null;
}
 
Example #25
Source File: SAXImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This is a shortcut to the iterators that implement the
 * supported XPath axes (only namespace::) is not supported.
 * Returns a bare-bones iterator that must be initialized
 * with a start node (using iterator.setStartNode()).
 */
public DTMAxisIterator getAxisIterator(final int axis)
{
    switch (axis)
    {
        case Axis.SELF:
            return new SingletonIterator();
        case Axis.CHILD:
            return new ChildrenIterator();
        case Axis.PARENT:
            return new ParentIterator();
        case Axis.ANCESTOR:
            return new AncestorIterator();
        case Axis.ANCESTORORSELF:
            return (new AncestorIterator()).includeSelf();
        case Axis.ATTRIBUTE:
            return new AttributeIterator();
        case Axis.DESCENDANT:
            return new DescendantIterator();
        case Axis.DESCENDANTORSELF:
            return (new DescendantIterator()).includeSelf();
        case Axis.FOLLOWING:
            return new FollowingIterator();
        case Axis.PRECEDING:
            return new PrecedingIterator();
        case Axis.FOLLOWINGSIBLING:
            return new FollowingSiblingIterator();
        case Axis.PRECEDINGSIBLING:
            return new PrecedingSiblingIterator();
        case Axis.NAMESPACE:
            return new NamespaceIterator();
        case Axis.ROOT:
            return new RootIterator();
        default:
            BasisLibrary.runTimeError(BasisLibrary.AXIS_SUPPORT_ERR,
                    Axis.getNames(axis));
    }
    return null;
}
 
Example #26
Source File: ForwardPositionIterator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public DTMAxisIterator cloneIterator() {
    try {
        final ForwardPositionIterator clone =
            (ForwardPositionIterator) super.clone();
        clone._source = _source.cloneIterator();
        clone._isRestartable = false;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #27
Source File: AbsoluteIterator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public DTMAxisIterator cloneIterator() {
    try {
        final AbsoluteIterator clone = (AbsoluteIterator) super.clone();
        clone._source = _source.cloneIterator();    // resets source
        clone.resetPosition();
        clone._isRestartable = false;
        return clone;
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #28
Source File: DupFilterIterator.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public DTMAxisIterator cloneIterator() {
    try {
        final DupFilterIterator clone =
            (DupFilterIterator) super.clone();
        clone._nodes = (IntegerArray) _nodes.clone();
        clone._source = _source.cloneIterator();
        clone._isRestartable = false;
        return clone.reset();
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}
 
Example #29
Source File: FilterIterator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public DTMAxisIterator cloneIterator() {

        try {
            final FilterIterator clone = (FilterIterator) super.clone();
            clone._source = _source.cloneIterator();
            clone._isRestartable = false;
            return clone.reset();
        }
        catch (CloneNotSupportedException e) {
            BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                      e.toString());
            return null;
        }
    }
 
Example #30
Source File: AbsoluteIterator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public DTMAxisIterator cloneIterator() {
    try {
        final AbsoluteIterator clone = (AbsoluteIterator) super.clone();
        clone._source = _source.cloneIterator();    // resets source
        clone.resetPosition();
        clone._isRestartable = false;
        return clone;
    }
    catch (CloneNotSupportedException e) {
        BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR,
                                  e.toString());
        return null;
    }
}