01: /* Generated By:JJTree: Do not edit this line. ASTRDFLiteral.java */
02:
03: package org.openrdf.query.parser.sparql.ast;
04:
05: public class ASTRDFLiteral extends SimpleNode {
06:
07: private String lang;
08:
09: public ASTRDFLiteral(int id) {
10: super (id);
11: }
12:
13: public ASTRDFLiteral(SyntaxTreeBuilder p, int id) {
14: super (p, id);
15: }
16:
17: @Override
18: public Object jjtAccept(SyntaxTreeBuilderVisitor visitor,
19: Object data) throws VisitorException {
20: return visitor.visit(this , data);
21: }
22:
23: public String getLang() {
24: return lang;
25: }
26:
27: public void setLang(String lang) {
28: this .lang = lang;
29: }
30:
31: public ASTString getLabel() {
32: return (ASTString) children.get(0);
33: }
34:
35: public ASTIRI getDatatype() {
36: if (children.size() >= 2) {
37: return (ASTIRI) children.get(1);
38: }
39: return null;
40: }
41:
42: @Override
43: public String toString() {
44: String result = super .toString();
45:
46: if (lang != null) {
47: result += " (lang=" + lang + ")";
48: }
49:
50: return result;
51: }
52: }
|