當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。