KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > model > MetaData


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.model;
8
9
10 import java.util.Map JavaDoc;
11
12
13 /**
14  * <p>
15  * This interface is the MetaData the describes the model
16  * definition itself and any extra parameters that may be
17  * needed for the MVC system to build or locate the model
18  * object. This can optionally store the Model Object since
19  * it should be at most request scoped.
20  * </p>
21  *
22  * <p>
23  * This interface should not be confused with the {@link
24  * ModelMVCInfo ModelMVCInfo} class. That class is used
25  * by the MVC system to determine the handler, resolver,
26  * definition and extra parameters to use when decoding
27  * a MVC request. This class is used by MVC model
28  * implementations to describe how the model can be resolved
29  * and handled.
30  * </p>
31  *
32  * @author Brian Pontarelli
33  * @since 2.0
34  * @version 2.0
35  */

36 public interface MetaData {
37
38     /**
39      * Returns the unique identifier for this object for this request. This is
40      * generally the key that the object is stored under in the request, session
41      * or application contexts, but could be anything
42      */

43     String JavaDoc getID();
44
45     /**
46      * Returns the definition string that will be written out to the view. This
47      * is built however the implementor sees fit.
48      *
49      * @return The definition string
50      */

51     String JavaDoc getDefinition();
52
53     /**
54      * Returns the extra parameters for this model definition
55      *
56      * @return A Map of extra parameters for the definition. This can be null
57      */

58     Map JavaDoc getExtraParams();
59
60     /**
61      * Gets the property of the meta data. This is used mainly by the view classes
62      * so that the property can be set into the MetaData after it is created.
63      *
64      * @return The name of the property
65      */

66     String JavaDoc getProperty();
67
68     /**
69      * Sets the property of the meta data. This is used mainly by the view classes
70      * so that the property can be set into the MetaData after it is created.
71      *
72      * @param property The property of this MetaData
73      */

74     void setProperty(String JavaDoc property);
75
76     /**
77      * Returns the ModelHandler that can be used in conjunction with this MetaData
78      * in order to retrieve the property value. This is tight coupling between
79      * the definition and the ModelHandler, but this provides a easy mechanism
80      * for the view to retrieve the value properly.
81      *
82      * @return The ModelHandler that uses or accepts the MetaData
83      */

84     ModelHandler getModelHandler();
85
86     /**
87      * Returns the name of the MVC model system that this MetaData is associated
88      * with. This is also the name that the {@link ModelHandler} and
89      * {@link ModelResolver} are stored in the {@link
90      * com.inversoft.verge.mvc.MVCRegistry MVCRegistry} under.
91      *
92      * @return The name of the model system
93      */

94     String JavaDoc getModelSystem();
95 }
Popular Tags