當前位置: 首頁>>代碼示例>>Java>>正文


Java XPathFilterExpr類代碼示例

本文整理匯總了Java中org.javarosa.xpath.expr.XPathFilterExpr的典型用法代碼示例。如果您正苦於以下問題:Java XPathFilterExpr類的具體用法?Java XPathFilterExpr怎麽用?Java XPathFilterExpr使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XPathFilterExpr類屬於org.javarosa.xpath.expr包,在下文中一共展示了XPathFilterExpr類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: build

import org.javarosa.xpath.expr.XPathFilterExpr; //導入依賴的package包/類
public XPathExpression build() throws XPathSyntaxException {
	XPathExpression[] preds = new XPathExpression[predicates.size()];
	for (int i = 0; i < preds.length; i++)
		preds[i] = predicates.elementAt(i).build();
	
	return new XPathFilterExpr(expr.build(), preds);
}
 
開發者ID:medic,項目名稱:javarosa,代碼行數:8,代碼來源:ASTNodeFilterExpr.java

示例2: build

import org.javarosa.xpath.expr.XPathFilterExpr; //導入依賴的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

示例3: build

import org.javarosa.xpath.expr.XPathFilterExpr; //導入依賴的package包/類
@Override
public XPathExpression build() throws XPathSyntaxException {
    XPathExpression[] preds = new XPathExpression[predicates.size()];
    for (int i = 0; i < preds.length; i++)
        preds[i] = ((ASTNode)predicates.elementAt(i)).build();

    return new XPathFilterExpr(expr.build(), preds);
}
 
開發者ID:dimagi,項目名稱:commcare-j2me,代碼行數:9,代碼來源:ASTNodeFilterExpr.java

示例4: build

import org.javarosa.xpath.expr.XPathFilterExpr; //導入依賴的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

示例5: build

import org.javarosa.xpath.expr.XPathFilterExpr; //導入依賴的package包/類
@Override
public XPathExpression build() throws XPathSyntaxException {
    XPathExpression[] preds = new XPathExpression[predicates.size()];
    for (int i = 0; i < preds.length; i++)
        preds[i] = predicates.elementAt(i).build();

    return new XPathFilterExpr(expr.build(), preds);
}
 
開發者ID:dimagi,項目名稱:commcare-core,代碼行數:9,代碼來源:ASTNodeFilterExpr.java

示例6: build

import org.javarosa.xpath.expr.XPathFilterExpr; //導入依賴的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


注:本文中的org.javarosa.xpath.expr.XPathFilterExpr類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。