本文整理汇总了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;
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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));
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
}
示例9: revertTerning
import org.javarosa.xpath.expr.XPathStep; //导入依赖的package包/类
public static void revertTerning() {
ExtUtil.interning = oldterning;
TreeReferenceLevel.treeRefLevelInterningEnabled = otrt;
XPathStep.XPathStepInterningEnabled = oldxpath;
}
示例10: revertTerning
import org.javarosa.xpath.expr.XPathStep; //导入依赖的package包/类
public static void revertTerning() {
ExtUtil.interning = oldterning;
TreeReferenceLevel.treeRefLevelInterningEnabled = otrt;
XPathStep.XPathStepInterningEnabled = oldxpath;
}