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


Java XPath类代码示例

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


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

示例1: XPathMatcher

import com.sun.org.apache.xerces.internal.impl.xpath.XPath; //导入依赖的package包/类
/**
 * Constructs an XPath matcher that implements a document fragment
 * handler.
 *
 * @param xpath   The xpath.
 */
public XPathMatcher(XPath xpath) {
    fLocationPaths = xpath.getLocationPaths();
    fStepIndexes = new IntStack[fLocationPaths.length];
    for(int i=0; i<fStepIndexes.length; i++) fStepIndexes[i] = new IntStack();
    fCurrentStep = new int[fLocationPaths.length];
    fNoMatchDepth = new int[fLocationPaths.length];
    fMatched = new int[fLocationPaths.length];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:XPathMatcher.java

示例2: toString

import com.sun.org.apache.xerces.internal.impl.xpath.XPath; //导入依赖的package包/类
/** Returns a string representation of this object. */
public String toString() {
    /***
    return fLocationPath.toString();
    /***/
    StringBuffer str = new StringBuffer();
    String s = super.toString();
    int index2 = s.lastIndexOf('.');
    if (index2 != -1) {
        s = s.substring(index2 + 1);
    }
    str.append(s);
    for(int i =0;i<fLocationPaths.length; i++) {
        str.append('[');
        XPath.Step[] steps = fLocationPaths[i].steps;
        for (int j = 0; j < steps.length; j++) {
            if (j == fCurrentStep[i]) {
                str.append('^');
            }
            str.append(steps[j].toString());
            if (j < steps.length - 1) {
                str.append('/');
            }
        }
        if (fCurrentStep[i] == steps.length) {
            str.append('^');
        }
        str.append(']');
        str.append(',');
    }
    return str.toString();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:XPathMatcher.java


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