001: /*
002: * Copyright Aduna (http://www.aduna-software.com/) (c) 2008.
003: *
004: * Licensed under the Aduna BSD-style license.
005: */
006: package org.openrdf.sail.rdbms.algebra.factories;
007:
008: import org.openrdf.query.algebra.ValueExpr;
009: import org.openrdf.sail.rdbms.algebra.base.SqlExpr;
010: import org.openrdf.sail.rdbms.exceptions.UnsupportedRdbmsOperatorException;
011:
012: /**
013: * Boolean SQL expression factory. This factory can convert a number of core
014: * algebra nodes into an SQL expression.
015: *
016: * @author James Leigh
017: *
018: */
019: public class SqlExprFactory {
020: private BNodeExprFactory bnode;
021: private BooleanExprFactory bool;
022: private DatatypeExprFactory datatype;
023: private LabelExprFactory label;
024: private LanguageExprFactory language;
025: private NumericExprFactory numeric;
026: private TimeExprFactory time;
027: private URIExprFactory uri;
028: private ZonedExprFactory zoned;
029: private HashExprFactory hash;
030:
031: public void setBNodeExprFactory(BNodeExprFactory bnode) {
032: this .bnode = bnode;
033: }
034:
035: public void setBooleanExprFactory(BooleanExprFactory bool) {
036: this .bool = bool;
037: }
038:
039: public void setDatatypeExprFactory(DatatypeExprFactory datatype) {
040: this .datatype = datatype;
041: }
042:
043: public void setLabelExprFactory(LabelExprFactory label) {
044: this .label = label;
045: }
046:
047: public void setLanguageExprFactory(LanguageExprFactory language) {
048: this .language = language;
049: }
050:
051: public void setNumericExprFactory(NumericExprFactory numeric) {
052: this .numeric = numeric;
053: }
054:
055: public void setTimeExprFactory(TimeExprFactory time) {
056: this .time = time;
057: }
058:
059: public void setURIExprFactory(URIExprFactory uri) {
060: this .uri = uri;
061: }
062:
063: public void setZonedExprFactory(ZonedExprFactory zoned) {
064: this .zoned = zoned;
065: }
066:
067: public void setHashExprFactory(HashExprFactory hash) {
068: this .hash = hash;
069: }
070:
071: public SqlExpr createBNodeExpr(ValueExpr arg)
072: throws UnsupportedRdbmsOperatorException {
073: return bnode.createBNodeExpr(arg);
074: }
075:
076: public SqlExpr createBooleanExpr(ValueExpr arg)
077: throws UnsupportedRdbmsOperatorException {
078: return bool.createBooleanExpr(arg);
079: }
080:
081: public SqlExpr createLabelExpr(ValueExpr arg)
082: throws UnsupportedRdbmsOperatorException {
083: return label.createLabelExpr(arg);
084: }
085:
086: public SqlExpr createLanguageExpr(ValueExpr arg)
087: throws UnsupportedRdbmsOperatorException {
088: return language.createLanguageExpr(arg);
089: }
090:
091: public SqlExpr createNumericExpr(ValueExpr arg)
092: throws UnsupportedRdbmsOperatorException {
093: return numeric.createNumericExpr(arg);
094: }
095:
096: public SqlExpr createTimeExpr(ValueExpr arg)
097: throws UnsupportedRdbmsOperatorException {
098: return time.createTimeExpr(arg);
099: }
100:
101: public SqlExpr createZonedExpr(ValueExpr arg)
102: throws UnsupportedRdbmsOperatorException {
103: return zoned.createZonedExpr(arg);
104: }
105:
106: public SqlExpr createDatatypeExpr(ValueExpr arg)
107: throws UnsupportedRdbmsOperatorException {
108: return datatype.createDatatypeExpr(arg);
109: }
110:
111: public SqlExpr createUriExpr(ValueExpr arg)
112: throws UnsupportedRdbmsOperatorException {
113: return uri.createUriExpr(arg);
114: }
115:
116: public SqlExpr createHashExpr(ValueExpr arg)
117: throws UnsupportedRdbmsOperatorException {
118: return hash.createHashExpr(arg);
119: }
120: }
|