All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bigdata.rdf.sail.sparql.ast.ASTRDFLiteral Maven / Gradle / Ivy

/* Generated By:JJTree: Do not edit this line. ASTRDFLiteral.java */

package com.bigdata.rdf.sail.sparql.ast;

import com.bigdata.rdf.sail.sparql.ast.ASTIRI;
import com.bigdata.rdf.sail.sparql.ast.ASTRDFValue;
import com.bigdata.rdf.sail.sparql.ast.ASTString;
import com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilder;
import com.bigdata.rdf.sail.sparql.ast.SyntaxTreeBuilderVisitor;
import com.bigdata.rdf.sail.sparql.ast.VisitorException;

public class ASTRDFLiteral extends ASTRDFValue {

	private String lang;

	public ASTRDFLiteral(int id) {
		super(id);
	}

	public ASTRDFLiteral(SyntaxTreeBuilder p, int id) {
		super(p, id);
	}

	@Override
	public Object jjtAccept(SyntaxTreeBuilderVisitor visitor, Object data)
		throws VisitorException
	{
		return visitor.visit(this, data);
	}

	public String getLang() {
		return lang;
	}

	public void setLang(String lang) {
		this.lang = lang;
	}

	public ASTString getLabel() {
		return (ASTString)children.get(0);
	}

	public ASTIRI getDatatype() {
		if (children.size() >= 2) {
			return (ASTIRI)children.get(1);
		}
		return null;
	}

	@Override
	public String toString()
	{
		String result = super.toString();

		if (lang != null) {
			result += " (lang=" + lang + ")";
		}

		return result;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy