01: package org.apache.ojb.jdo.jdoql;
02:
03: /* Copyright 2003-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * The 'this' expression.
20: *
21: * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
22: */
23: public class ThisExpression extends Expression {
24: /** The resolved type (which is the type search type of the query) */
25: private Class _type;
26:
27: /**
28: * Creates a new this expression object.
29: */
30: public ThisExpression() {
31: }
32:
33: /* (non-Javadoc)
34: * @see org.apache.ojb.jdo.jdoql.Acceptor#accept(org.apache.ojb.jdo.jdoql.Visitor)
35: */
36: public void accept(Visitor visitor) {
37: visitor.visit(this );
38: }
39:
40: /* (non-Javadoc)
41: * @see java.lang.Object#toString()
42: */
43: public String toString() {
44: return "this";
45: }
46:
47: /**
48: * Sets the type of this expression.
49: *
50: * @param type The type
51: */
52: public void setType(Class type) {
53: _type = type;
54: }
55:
56: /* (non-Javadoc)
57: * @see org.apache.ojb.jdo.jdoql.Expression#getType()
58: */
59: public Class getType() {
60: return _type;
61: }
62: }
|