KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > olap > model > OlapModelDecorator


1 /*
2  * ====================================================================
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) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.jpivot.olap.model;
14
15 import java.util.Locale JavaDoc;
16 import java.util.Map JavaDoc;
17
18 import javax.servlet.ServletContext JavaDoc;
19
20 import com.tonbeller.jpivot.core.Extension;
21 import com.tonbeller.jpivot.core.ExtensionSupport;
22 import com.tonbeller.jpivot.core.Model;
23 import com.tonbeller.jpivot.core.ModelChangeListener;
24
25 /**
26  * a default decorator that delegates everything
27  *
28  * @author av
29  */

30 public class OlapModelDecorator extends ExtensionSupport implements OlapModel {
31
32   protected OlapModel delegate;
33
34   public String JavaDoc getID() {
35     return delegate.getID();
36   }
37   public void setID(String JavaDoc ID) {
38     delegate.setID(ID);
39   }
40
41   /**
42    * default ctor
43    * @see #setDelegate
44    * @see #decorate
45    */

46   public OlapModelDecorator() {
47   }
48
49   public OlapModelDecorator(OlapModel delegate) {
50     this.delegate = delegate;
51   }
52
53   public Result getResult() throws OlapException {
54     return delegate.getResult();
55   }
56
57   public Dimension[] getDimensions() {
58     return delegate.getDimensions();
59   }
60
61   public Member[] getMeasures() {
62     return delegate.getMeasures();
63   }
64
65   public Extension getExtension(String JavaDoc id) {
66     return delegate.getExtension(id);
67   }
68
69   public Map JavaDoc getExtensions() {
70     return delegate.getExtensions();
71   }
72
73   public void setLocale(Locale JavaDoc locale) {
74     delegate.setLocale(locale);
75   }
76
77   public void addExtension(Extension extension) {
78     delegate.addExtension(extension);
79   }
80
81   public void addModelChangeListener(ModelChangeListener l) {
82     delegate.addModelChangeListener(l);
83   }
84
85   public void removeModelChangeListener(ModelChangeListener l) {
86     delegate.removeModelChangeListener(l);
87   }
88
89   public Object JavaDoc getBookmarkState(int levelOfDetail) {
90     return delegate.getBookmarkState(levelOfDetail);
91   }
92
93   public void setBookmarkState(Object JavaDoc state) {
94     delegate.setBookmarkState(state);
95   }
96
97   /**
98    * returns the top of the decorator chain
99    */

100   public Model getTopDecorator() {
101     return delegate.getTopDecorator();
102   }
103
104   public Model getRootModel() {
105     return delegate.getRootModel();
106   }
107   /**
108    * decorates the <code>modelToDecorate</code> with this
109    */

110   public Model decorate(Model modelToDecorate) {
111     this.delegate = (OlapModel) modelToDecorate;
112     return this;
113   }
114
115   /**
116    * sets the decorated model
117    */

118   public void setDelegate(OlapModel modelToDecorate) throws OlapException {
119     this.delegate = modelToDecorate;
120   }
121
122   /**
123    * gets the decorated model. This is the immediate child in the decorator chain
124    * @see #getRootDecoree
125    * @see #getTopDecorator
126    */

127   public OlapModel getDelegate() {
128     return delegate;
129   }
130
131   public void initialize() throws OlapException {
132     delegate.initialize();
133
134   }
135
136   public void destroy() {
137     delegate.destroy();
138   }
139   
140   public void setServletContext(ServletContext JavaDoc servletContext) {
141     delegate.setServletContext(servletContext);
142   }
143 }
144
Popular Tags