• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Axis类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setParser

import com.sun.org.apache.xml.internal.dtm.Axis; //导入依赖的package包/类
public void setParser(Parser parser) {
    super.setParser(parser);
    // find all expressions in this Union
    final Vector components = new Vector();
    flatten(components);
    final int size = components.size();
    _components = (Expression[])components.toArray(new Expression[size]);
    for (int i = 0; i < size; i++) {
        _components[i].setParser(parser);
        _components[i].setParent(this);
        if (_components[i] instanceof Step) {
            final Step step = (Step)_components[i];
            final int axis = step.getAxis();
            final int type = step.getNodeType();
            // Put attribute iterators first
            if ((axis == Axis.ATTRIBUTE) || (type == DTM.ATTRIBUTE_NODE)) {
                _components[i] = _components[0];
                _components[0] = step;
            }
            // Check if the union contains a reverse iterator
    if (Axis.isReverse(axis)) _reverse = true;
        }
    }
    // No need to reverse anything if another expression lies on top of this
    if (getParent() instanceof Expression) _reverse = false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:UnionPathExpr.java


示例2: getNamespaceAxisIterator

import com.sun.org.apache.xml.internal.dtm.Axis; //导入依赖的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


示例3: NamespaceWildcardIterator

import com.sun.org.apache.xml.internal.dtm.Axis; //导入依赖的package包/类
/**
 * Constructor NamespaceWildcard
 *
 * @param axis The axis that this iterator will traverse
 * @param nsType The namespace type index
 */
public NamespaceWildcardIterator(int axis, int nsType) {
    m_nsType = nsType;

    // Create a nested iterator that will select nodes of
    // the principal node kind for the selected axis.
    switch (axis) {
        case Axis.ATTRIBUTE: {
            // For "attribute::p:*", the principal node kind is
            // attribute
            m_baseIterator = getAxisIterator(axis);
        }
        case Axis.NAMESPACE: {
            // This covers "namespace::p:*".  It is syntactically
            // correct, though it doesn't make much sense.
            m_baseIterator = getAxisIterator(axis);
        }
        default: {
            // In all other cases, the principal node kind is
            // element
            m_baseIterator = getTypedAxisIterator(axis,
                                                  DTM.ELEMENT_NODE);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:SAXImpl.java


示例4: setStartNode

import com.sun.org.apache.xml.internal.dtm.Axis; //导入依赖的package包/类
public DTMAxisIterator setStartNode(final int node) {
    if (node == DTM.NULL) {
        return this;
    }

    int dom = node >>> DTMManager.IDENT_DTM_NODE_BITS;

    // Get a new source first time and when mask changes
    if (_source == null || _dtmId != dom) {
        if (_type == NO_TYPE) {
            _source = _adapters[dom].getAxisIterator(_axis);
        } else if (_axis == Axis.CHILD) {
            _source = _adapters[dom].getTypedChildren(_type);
        } else {
            _source = _adapters[dom].getTypedAxisIterator(_axis, _type);
        }
    }

    _dtmId = dom;
    _source.setStartNode(node);
    return this;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:MultiDOM.java


示例5: containsKey

import com.sun.org.apache.xml.internal.dtm.Axis; //导入依赖的package包/类
/**
 * <p>Given a context node and the second argument to the XSLT
 * <code>key</code> function, checks whether the context node is in the
 * set of nodes that results from that reference to the <code>key</code>
 * function.  This is used in the implementation of key patterns.</p>
 * <p>This particular {@link KeyIndex} object is the result evaluating the
 * first argument to the <code>key</code> function, so it's not taken into
 * any further account.</p>
 *
 * @param node The context node
 * @param value The second argument to the <code>key</code> function
 * @return <code>1</code> if and only if the context node is in the set of
 *         nodes returned by the reference to the <code>key</code> function;
 *         <code>0</code>, otherwise
 */
public int containsKey(int node, Object value) {
    int rootHandle = _dom.getAxisIterator(Axis.ROOT)
                             .setStartNode(node).next();

    // Get the mapping table for the document containing the context node
    Hashtable index =
                (Hashtable) _rootToIndexMap.get(new Integer(rootHandle));

    // Check whether the context node is present in the set of nodes
    // returned by the key function
    if (index != null) {
        final IntegerArray nodes = (IntegerArray) index.get(value);
        return (nodes != null && nodes.indexOf(node) >= 0) ? 1 : 0;
    }

    // The particular key name identifies no nodes in this document
    return 0;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:KeyIndex.java


示例6: getAxisIterator

import com.sun.org.apache.xml.internal.dtm.Axis; //导入依赖的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:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:SimpleResultTreeImpl.java


示例7: getTypedAxisIterator

import com.sun.org.apache.xml.internal.dtm.Axis; //导入依赖的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:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:SimpleResultTreeImpl.java


示例8: CastExpr

import com.sun.org.apache.xml.internal.dtm.Axis; //导入依赖的package包/类
/**
 * Construct a cast expression and check that the conversion is
 * valid by calling typeCheck().
 */
public CastExpr(Expression left, Type type) throws TypeCheckError {
    _left = left;
    _type = type;           // use inherited field

    if ((_left instanceof Step) && (_type == Type.Boolean)) {
        Step step = (Step)_left;
        if ((step.getAxis() == Axis.SELF) && (step.getNodeType() != -1))
            _typeTest = true;
    }

    // check if conversion is valid
    setParser(left.getParser());
    setParent(left.getParent());
    left.setParent(this);
    typeCheck(left.getParser().getSymbolTable());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:CastExpr.java


示例9: setRoot

import com.sun.org.apache.xml.internal.dtm.Axis; //导入依赖的package包/类
/**
   * Initialize the context values for this expression
   * after it is cloned.
   *
   * @param context The XPath runtime context for this
   * transformation.
   */
  public void setRoot(int context, Object environment)
  {
    super.setRoot(context, environment);
    m_traverser = m_cdtm.getAxisTraverser(Axis.CHILD);

//    String localName = getLocalName();
//    String namespace = getNamespace();
//    int what = m_whatToShow;
//    // System.out.println("what: ");
//    // NodeTest.debugWhatToShow(what);
//    if(DTMFilter.SHOW_ALL == what ||
//       ((DTMFilter.SHOW_ELEMENT & what) == 0)
//       || localName == NodeTest.WILD
//       || namespace == NodeTest.WILD)
//    {
//      m_extendedTypeID = 0;
//    }
//    else
//    {
//      int type = getNodeTypeTest(what);
//      m_extendedTypeID = m_cdtm.getExpandedTypeID(namespace, localName, type);
//    }

  }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:ChildTestIterator.java


示例10: getNamespaceAxisIterator

import com.sun.org.apache.xml.internal.dtm.Axis; //导入依赖的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)
{
    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:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:SAXImpl.java


示例11: containsKey

import com.sun.org.apache.xml.internal.dtm.Axis; //导入依赖的package包/类
/**
 * <p>Given a context node and the second argument to the XSLT
 * <code>key</code> function, checks whether the context node is in the
 * set of nodes that results from that reference to the <code>key</code>
 * function.  This is used in the implementation of key patterns.</p>
 * <p>This particular {@link KeyIndex} object is the result evaluating the
 * first argument to the <code>key</code> function, so it's not taken into
 * any further account.</p>
 *
 * @param node The context node
 * @param value The second argument to the <code>key</code> function
 * @return <code>1</code> if and only if the context node is in the set of
 *         nodes returned by the reference to the <code>key</code> function;
 *         <code>0</code>, otherwise
 */
public int containsKey(int node, Object value) {
    int rootHandle = _dom.getAxisIterator(Axis.ROOT)
                             .setStartNode(node).next();

    // Get the mapping table for the document containing the context node
    Map<String,IntegerArray> index =
                _rootToIndexMap.get(rootHandle);

    // Check whether the context node is present in the set of nodes
    // returned by the key function
    if (index != null) {
        final IntegerArray nodes = index.get(value);
        return (nodes != null && nodes.indexOf(node) >= 0) ? 1 : 0;
    }

    // The particular key name identifies no nodes in this document
    return 0;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:34,代码来源:KeyIndex.java


示例12: containsKey

import com.sun.org.apache.xml.internal.dtm.Axis; //导入依赖的package包/类
/**
 * <p>Given a context node and the second argument to the XSLT
 * <code>key</code> function, checks whether the context node is in the
 * set of nodes that results from that reference to the <code>key</code>
 * function.  This is used in the implementation of key patterns.</p>
 * <p>This particular {@link KeyIndex} object is the result evaluating the
 * first argument to the <code>key</code> function, so it's not taken into
 * any further account.</p>
 *
 * @param node The context node
 * @param value The second argument to the <code>key</code> function
 * @return <code>1</code> if and only if the context node is in the set of
 *         nodes returned by the reference to the <code>key</code> function;
 *         <code>0</code>, otherwise
 */
public int containsKey(int node, Object value) {
    int rootHandle = _dom.getAxisIterator(Axis.ROOT)
                             .setStartNode(node).next();

    // Get the mapping table for the document containing the context node
    Map<String,IntegerArray> index =
                _rootToIndexMap.get(new Integer(rootHandle));

    // Check whether the context node is present in the set of nodes
    // returned by the key function
    if (index != null) {
        final IntegerArray nodes = index.get(value);
        return (nodes != null && nodes.indexOf(node) >= 0) ? 1 : 0;
    }

    // The particular key name identifies no nodes in this document
    return 0;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:34,代码来源:KeyIndex.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PhysicsHandler类代码示例发布时间:2022-05-23
下一篇:
Java ClickableRenderer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap