KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > core > Model


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.core;
14
15 import java.util.Locale JavaDoc;
16 import java.util.Map JavaDoc;
17
18 import com.tonbeller.wcf.bookmarks.Bookmarkable;
19
20 /**
21  * A Model provides core functionality. It may be extended by optional
22  * <code>Extension</code>s.
23  */

24
25 public interface Model extends Bookmarkable {
26   /**
27    * returns the extension if this model instance supports it. Returns null
28    * if the extension is not supported.
29    */

30   Extension getExtension(String JavaDoc id);
31
32   /**
33    * returns a Map containing all extensions JSP scripting.
34    * Key is the extension id, value is the extension.
35    */

36   Map JavaDoc getExtensions();
37     
38   /**
39    * sets the locale for messages, data display etc
40    */

41   void setLocale(Locale JavaDoc locale);
42   
43   /**
44    * adds an extension to this model. Must call extension.setModel(this) to
45    * set the model reference.
46    */

47   public void addExtension(Extension extension);
48   
49   /**
50    * adds a model change listener
51    */

52   void addModelChangeListener(ModelChangeListener l);
53   
54   /**
55    * removes a model change listener
56    */

57   void removeModelChangeListener(ModelChangeListener l);
58
59   /**
60    * Returns the top element of the decorator chain. If any extensions decorate the model, a decorator
61    * chain is built and its head is returned. Otherwise this is returned
62    */

63   public Model getTopDecorator();
64   
65   /**
66    * Returns the bottom element of the decorator chain. The returned model does not decorate any other model,
67    * its the end of the chain.
68    */

69   public Model getRootModel();
70   
71 }
72
Popular Tags