KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > olap > QueryPart


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/olap/QueryPart.java#10 $
3 // This software is subject to the terms of the Common Public License
4 // Agreement, available at the following URL:
5 // http://www.opensource.org/licenses/cpl.html.
6 // Copyright (C) 1998-2002 Kana Software, Inc.
7 // Copyright (C) 2001-2006 Julian Hyde and others
8 // All Rights Reserved.
9 // You must accept the terms of that agreement to use this software.
10 //
11 // jhyde, 23 January, 1999
12 */

13
14 package mondrian.olap;
15 import java.io.PrintWriter JavaDoc;
16 import java.io.StringWriter JavaDoc;
17
18 /**
19  * Component of an MDX query (derived classes include Query, Axis, Exp, Level).
20  */

21 public abstract class QueryPart implements Walkable {
22     QueryPart() {
23     }
24
25     /**
26      * Converts this query or expression into an MDX string.
27      *
28      * @deprecated Use {@link Util#unparse(Exp)}; deprecated since 2.1.2.
29      */

30     public String JavaDoc toMdx()
31     {
32         StringWriter JavaDoc sw = new StringWriter JavaDoc();
33         PrintWriter JavaDoc pw = new PrintWriter JavaDoc(sw);
34         unparse(pw);
35         return sw.toString();
36     }
37
38     public void unparse(PrintWriter JavaDoc pw) {
39         pw.print(toString());
40     }
41
42     // implement Walkable
43
public Object JavaDoc[] getChildren() {
44         // By default, a QueryPart is atomic (has no children).
45
return null;
46     }
47
48     protected Object JavaDoc[] getAllowedChildren(CubeAccess cubeAccess) {
49         // By default, a QueryPart is atomic (has no children).
50
return null;
51     }
52 }
53
54 // End QueryPart.java
55
Popular Tags