01: /**
02: * Copyright (C) 2006 NetMind Consulting Bt.
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 3 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package hu.netmind.persistence.parser;
18:
19: import java.util.List;
20:
21: /**
22: * The parser uses this interface to resolve an attribute chain.
23: * @author Brautigam Robert
24: * @version Revision: $Revision$
25: */
26: public interface Resolver {
27: /**
28: * Resolve main table name.
29: * @param specifier Specifier to resolve.
30: * @param selected Whether class denoted by specifier will be
31: * returned.
32: */
33: TableTerm resolve(ClassSpecifier specifier, boolean selected);
34:
35: /**
36: * This method should resolve the attribute chain given to a term.
37: * The parser supplies a chain of references, containing a ClassSpecifier
38: * on the 0 position, and subsequently 0 or more AttributeSpecifiers.
39: * The object returned will be added to the current Expression.
40: * @param selected Whether the attribute denoted by specifier will be
41: * returned.
42: */
43: ReferenceTerm resolve(ClassSpecifier specifier,
44: List attributeSpecifiers, boolean selected);
45:
46: /**
47: * Fix primitive expressions.
48: */
49: void fixPrimitiveExpression(Expression expr);
50:
51: /**
52: * Generate the final expression. This is called if the where clause
53: * was parsed successfully.
54: */
55: QueryStatementList generate(QueryStatement stmt);
56: }
|