本文整理匯總了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;
}
}