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


Java XPathStep类代码示例

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


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

示例1: validateAxisName

import org.javarosa.xpath.expr.XPathStep; //导入依赖的package包/类
public static int validateAxisName (String axisName) {
	int axis = -1;

	if      (axisName.equals("child"))              axis = XPathStep.AXIS_CHILD;
	else if (axisName.equals("descendant"))         axis = XPathStep.AXIS_DESCENDANT;
	else if (axisName.equals("parent"))             axis = XPathStep.AXIS_PARENT;
	else if (axisName.equals("ancestor"))           axis = XPathStep.AXIS_ANCESTOR;
	else if (axisName.equals("following-sibling"))  axis = XPathStep.AXIS_FOLLOWING_SIBLING;
	else if (axisName.equals("preceding-sibling"))  axis = XPathStep.AXIS_PRECEDING_SIBLING;
	else if (axisName.equals("following"))          axis = XPathStep.AXIS_FOLLOWING;
	else if (axisName.equals("preceding"))          axis = XPathStep.AXIS_PRECEDING;
	else if (axisName.equals("attribute"))          axis = XPathStep.AXIS_ATTRIBUTE;
	else if (axisName.equals("namespace"))          axis = XPathStep.AXIS_NAMESPACE;
	else if (axisName.equals("self"))               axis = XPathStep.AXIS_SELF;
	else if (axisName.equals("descendant-or-self")) axis = XPathStep.AXIS_DESCENDANT_OR_SELF;
	else if (axisName.equals("ancestor-or-self"))   axis = XPathStep.AXIS_ANCESTOR_OR_SELF;

	return axis;
}
 
开发者ID:medic,项目名称:javarosa,代码行数:20,代码来源:ASTNodePathStep.java

示例2: validateAxisName

import org.javarosa.xpath.expr.XPathStep; //导入依赖的package包/类
public static int validateAxisName(String axisName) {
    int axis = -1;

    if (axisName.equals("child")) axis = XPathStep.AXIS_CHILD;
    else if (axisName.equals("descendant")) axis = XPathStep.AXIS_DESCENDANT;
    else if (axisName.equals("parent")) axis = XPathStep.AXIS_PARENT;
    else if (axisName.equals("ancestor")) axis = XPathStep.AXIS_ANCESTOR;
    else if (axisName.equals("following-sibling")) axis = XPathStep.AXIS_FOLLOWING_SIBLING;
    else if (axisName.equals("preceding-sibling")) axis = XPathStep.AXIS_PRECEDING_SIBLING;
    else if (axisName.equals("following")) axis = XPathStep.AXIS_FOLLOWING;
    else if (axisName.equals("preceding")) axis = XPathStep.AXIS_PRECEDING;
    else if (axisName.equals("attribute")) axis = XPathStep.AXIS_ATTRIBUTE;
    else if (axisName.equals("namespace")) axis = XPathStep.AXIS_NAMESPACE;
    else if (axisName.equals("self")) axis = XPathStep.AXIS_SELF;
    else if (axisName.equals("descendant-or-self")) axis = XPathStep.AXIS_DESCENDANT_OR_SELF;
    else if (axisName.equals("ancestor-or-self")) axis = XPathStep.AXIS_ANCESTOR_OR_SELF;

    return axis;
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:20,代码来源:ASTNodePathStep.java

示例3: build

import org.javarosa.xpath.expr.XPathStep; //导入依赖的package包/类
public XPathExpression build() throws XPathSyntaxException {
	Vector<XPathStep> steps = new Vector<XPathStep>();
	XPathExpression filtExpr = null;
	int offset = isAbsolute() ? 1 : 0;
	for (int i = 0; i < clauses.size() + offset; i++) {
		if (offset == 0 || i > 0) {
			if (clauses.elementAt(i - offset) instanceof ASTNodePathStep) {
				steps.addElement(((ASTNodePathStep)clauses.elementAt(i - offset)).getStep());
			} else {
				filtExpr = clauses.elementAt(i - offset).build();
			}
		}
			
		if (i < separators.size()) {
			if (Parser.vectInt(separators, i) == Token.DBL_SLASH) {
				steps.addElement(XPathStep.ABBR_DESCENDANTS());
			}
		}
	}

	XPathStep[] stepArr = new XPathStep[steps.size()];
	for (int i = 0; i < stepArr.length; i++)
		stepArr[i] = steps.elementAt(i);
	
	if (filtExpr == null) {
		return new XPathPathExpr(isAbsolute() ? XPathPathExpr.INIT_CONTEXT_ROOT : XPathPathExpr.INIT_CONTEXT_RELATIVE, stepArr);
	} else {
		if (filtExpr instanceof XPathFilterExpr) {
			return new XPathPathExpr((XPathFilterExpr)filtExpr, stepArr);
		} else {
			return new XPathPathExpr(new XPathFilterExpr(filtExpr, new XPathExpression[0]), stepArr);
		}
	}		
}
 
开发者ID:medic,项目名称:javarosa,代码行数:35,代码来源:ASTNodeLocPath.java

示例4: stopTerning

import org.javarosa.xpath.expr.XPathStep; //导入依赖的package包/类
public static void stopTerning() {
	oldterning = ExtUtil.interning;
	otrt = TreeReferenceLevel.treeRefLevelInterningEnabled;
	oldxpath = XPathStep.XPathStepInterningEnabled;
	ExtUtil.interning = false;
	TreeReferenceLevel.treeRefLevelInterningEnabled = false;
	XPathStep.XPathStepInterningEnabled = false;
}
 
开发者ID:medic,项目名称:javarosa,代码行数:9,代码来源:MemoryUtils.java

示例5: init

import org.javarosa.xpath.expr.XPathStep; //导入依赖的package包/类
public static void init() {
    treeRefLevels = new Interner<TreeReferenceLevel>();
    xpathSteps = new Interner<XPathStep>();
    appStringCache= new Interner<String>();
    TreeReferenceLevel.attachCacheTable(treeRefLevels);
    XPathStep.attachInterner(xpathSteps);
    ExtUtil.attachCacheTable(appStringCache);

    XFormUtils.setXFormParserFactory(new XFormParserFactory(appStringCache));
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:11,代码来源:CommCareStatic.java

示例6: build

import org.javarosa.xpath.expr.XPathStep; //导入依赖的package包/类
public XPathExpression build() throws XPathSyntaxException {
    Vector<XPathStep> steps = new Vector<XPathStep>();
    XPathExpression filtExpr = null;
    int offset = isAbsolute() ? 1 : 0;
    for (int i = 0; i < clauses.size() + offset; i++) {
        if (offset == 0 || i > 0) {
            if (clauses.elementAt(i - offset) instanceof ASTNodePathStep) {
                steps.addElement(((ASTNodePathStep)clauses.elementAt(i - offset)).getStep());
            } else {
                filtExpr = clauses.elementAt(i - offset).build();
            }
        }

        if (i < separators.size()) {
            if (Parser.vectInt(separators, i) == Token.DBL_SLASH) {
                steps.addElement(XPathStep.ABBR_DESCENDANTS());
            }
        }
    }

    XPathStep[] stepArr = new XPathStep[steps.size()];
    for (int i = 0; i < stepArr.length; i++)
        stepArr[i] = steps.elementAt(i);

    if (filtExpr == null) {
        return new XPathPathExpr(isAbsolute() ? XPathPathExpr.INIT_CONTEXT_ROOT : XPathPathExpr.INIT_CONTEXT_RELATIVE, stepArr);
    } else {
        if (filtExpr instanceof XPathFilterExpr) {
            return new XPathPathExpr((XPathFilterExpr)filtExpr, stepArr);
        } else {
            return new XPathPathExpr(new XPathFilterExpr(filtExpr, new XPathExpression[0]), stepArr);
        }
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:35,代码来源:ASTNodeLocPath.java

示例7: stopTerning

import org.javarosa.xpath.expr.XPathStep; //导入依赖的package包/类
public static void stopTerning() {
    oldterning = ExtUtil.interning;
    otrt = TreeReferenceLevel.treeRefLevelInterningEnabled;
    oldxpath = XPathStep.XPathStepInterningEnabled;
    ExtUtil.interning = false;
    TreeReferenceLevel.treeRefLevelInterningEnabled = false;
    XPathStep.XPathStepInterningEnabled = false;
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:9,代码来源:MemoryUtils.java

示例8: build

import org.javarosa.xpath.expr.XPathStep; //导入依赖的package包/类
@Override
public XPathExpression build() throws XPathSyntaxException {
    Vector<XPathStep> steps = new Vector<>();
    XPathExpression filtExpr = null;
    int offset = isAbsolute() ? 1 : 0;
    for (int i = 0; i < clauses.size() + offset; i++) {
        if (offset == 0 || i > 0) {
            if (clauses.elementAt(i - offset) instanceof ASTNodePathStep) {
                steps.addElement(((ASTNodePathStep)clauses.elementAt(i - offset)).getStep());
            } else {
                filtExpr = clauses.elementAt(i - offset).build();
            }
        }

        if (i < separators.size()) {
            if (separators.get(i) == Token.DBL_SLASH) {
                steps.addElement(XPathStep.ABBR_DESCENDANTS());
            }
        }
    }

    XPathStep[] stepArr = new XPathStep[steps.size()];
    for (int i = 0; i < stepArr.length; i++)
        stepArr[i] = steps.elementAt(i);

    if (filtExpr == null) {
        return new XPathPathExpr(isAbsolute() ? XPathPathExpr.INIT_CONTEXT_ROOT : XPathPathExpr.INIT_CONTEXT_RELATIVE, stepArr);
    } else {
        if (filtExpr instanceof XPathFilterExpr) {
            return new XPathPathExpr((XPathFilterExpr)filtExpr, stepArr);
        } else {
            return new XPathPathExpr(new XPathFilterExpr(filtExpr, new XPathExpression[0]), stepArr);
        }
    }
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:36,代码来源:ASTNodeLocPath.java

示例9: revertTerning

import org.javarosa.xpath.expr.XPathStep; //导入依赖的package包/类
public static void revertTerning() {
	ExtUtil.interning = oldterning;
	TreeReferenceLevel.treeRefLevelInterningEnabled = otrt;
	XPathStep.XPathStepInterningEnabled = oldxpath;
}
 
开发者ID:medic,项目名称:javarosa,代码行数:6,代码来源:MemoryUtils.java

示例10: revertTerning

import org.javarosa.xpath.expr.XPathStep; //导入依赖的package包/类
public static void revertTerning() {
    ExtUtil.interning = oldterning;
    TreeReferenceLevel.treeRefLevelInterningEnabled = otrt;
    XPathStep.XPathStepInterningEnabled = oldxpath;
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:6,代码来源:MemoryUtils.java


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