01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.backend.list.sqlexpr.constant;
16:
17: import org.araneaframework.backend.list.SqlExpression;
18:
19: public class SqlStringExpression implements SqlExpression {
20: private String string;
21:
22: private Object[] values;
23:
24: public SqlStringExpression(String string, Object[] values) {
25: if (string == null) {
26: throw new RuntimeException("String can not be null");
27: }
28: if (values == null) {
29: throw new RuntimeException("Values array can not be null");
30: }
31: this .string = string;
32: this .values = values;
33: }
34:
35: public SqlStringExpression(String string) {
36: this (string, new Object[0]);
37: }
38:
39: public String toSqlString() {
40: return this .string;
41: }
42:
43: public Object[] getValues() {
44: return this.values;
45: }
46: }
|