本文整理汇总了Java中org.javarosa.xpath.parser.Token.STR属性的典型用法代码示例。如果您正苦于以下问题:Java Token.STR属性的具体用法?Java Token.STR怎么用?Java Token.STR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.javarosa.xpath.parser.Token
的用法示例。
在下文中一共展示了Token.STR属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
public XPathExpression build() throws XPathSyntaxException {
if (content.size() == 1) {
if (getType(0) == CHILD) {
return ((ASTNode)content.elementAt(0)).build();
} else {
switch (getTokenType(0)) {
case Token.NUM: return new XPathNumericLiteral((Double)getToken(0).val);
case Token.STR: return new XPathStringLiteral((String)getToken(0).val);
case Token.VAR: return new XPathVariableReference((XPathQName)getToken(0).val);
default: throw new XPathSyntaxException();
}
}
} else {
throw new XPathSyntaxException();
}
}
示例2: build
public XPathExpression build() throws XPathSyntaxException {
if (content.size() == 1) {
if (getType(0) == CHILD) {
return ((ASTNode)content.elementAt(0)).build();
} else {
switch (getTokenType(0)) {
case Token.NUM:
return new XPathNumericLiteral((Double)getToken(0).val);
case Token.STR:
return new XPathStringLiteral((String)getToken(0).val);
case Token.VAR:
return new XPathVariableReference((XPathQName)getToken(0).val);
default:
throw new XPathSyntaxException();
}
}
} else {
throw new XPathSyntaxException();
}
}
示例3: build
@Override
public XPathExpression build() throws XPathSyntaxException {
if (size() == 1) {
if (getType(0) == CHILD) {
return ((ASTNode)content.get(0)).build();
} else {
switch (getTokenType(0)) {
case Token.NUM:
return new XPathNumericLiteral((Double)getToken(0).val);
case Token.STR:
return new XPathStringLiteral((String)getToken(0).val);
case Token.VAR:
return new XPathVariableReference((XPathQName)getToken(0).val);
default:
throw new XPathSyntaxException();
}
}
} else {
throw new XPathSyntaxException();
}
}
示例4: isTerminal
public boolean isTerminal () {
if (content.size() == 1) {
int type = getTokenType(0);
return (type == Token.NUM || type == Token.STR || type == Token.VAR);
} else {
return false;
}
}
示例5: validateNodeTypeTest
public static boolean validateNodeTypeTest (ASTNodeFunctionCall f) {
String name = f.name.toString();
if (name.equals("node") || name.equals("text") || name.equals("comment") || name.equals("processing-instruction")) {
if (f.args.size() == 0) {
return true;
} else if (name.equals("processing-instruction") && f.args.size() == 1) {
ASTNodeAbstractExpr x = (ASTNodeAbstractExpr)f.args.elementAt(0);
return x.content.size() == 1 && x.getTokenType(0) == Token.STR;
} else {
return false;
}
} else {
return false;
}
}
示例6: isTerminal
public boolean isTerminal() {
if (content.size() == 1) {
int type = getTokenType(0);
return (type == Token.NUM || type == Token.STR || type == Token.VAR);
} else {
return false;
}
}
示例7: validateNodeTypeTest
public static boolean validateNodeTypeTest(ASTNodeFunctionCall f) {
String name = f.name.toString();
if (name.equals("node") || name.equals("text") || name.equals("comment") || name.equals("processing-instruction")) {
if (f.args.size() == 0) {
return true;
} else if (name.equals("processing-instruction") && f.args.size() == 1) {
ASTNodeAbstractExpr x = (ASTNodeAbstractExpr)f.args.elementAt(0);
return x.content.size() == 1 && x.getTokenType(0) == Token.STR;
} else {
return false;
}
} else {
return false;
}
}
示例8: isTerminal
private boolean isTerminal() {
if (size() == 1) {
int type = getTokenType(0);
return (type == Token.NUM || type == Token.STR || type == Token.VAR);
} else {
return false;
}
}
示例9: validateNodeTypeTest
public static boolean validateNodeTypeTest(ASTNodeFunctionCall f) {
String name = f.name.toString();
if (name.equals("node") || name.equals("text") || name.equals("comment") || name.equals("processing-instruction")) {
if (f.args.size() == 0) {
return true;
} else if (name.equals("processing-instruction") && f.args.size() == 1) {
ASTNodeAbstractExpr x = (ASTNodeAbstractExpr)f.args.get(0);
return x.size() == 1 && x.getTokenType(0) == Token.STR;
} else {
return false;
}
} else {
return false;
}
}