01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.query.parser.sparql;
07:
08: import org.openrdf.query.QueryLanguage;
09: import org.openrdf.query.parser.QueryParser;
10: import org.openrdf.query.parser.QueryParserFactory;
11:
12: /**
13: * A {@link QueryParserFactory} for SPARQL parsers.
14: *
15: * @author Arjohn Kampman
16: */
17: public class SPARQLParserFactory implements QueryParserFactory {
18:
19: private SPARQLParser sharedParser = null;
20:
21: /**
22: * Returns {@link QueryLanguage#SPARQL}.
23: */
24: public QueryLanguage getQueryLanguage() {
25: return QueryLanguage.SPARQL;
26: }
27:
28: /**
29: * Returns a shared, thread-safe, instance of SPARQLParser.
30: */
31: public QueryParser getParser() {
32: if (sharedParser == null) {
33: sharedParser = new SPARQLParser();
34: }
35:
36: return sharedParser;
37: }
38: }
|