KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > spec > PropertySpecification


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.spec;
16
17 import org.apache.hivemind.impl.BaseLocatable;
18
19 /**
20  * Defines a transient or persistant property of a component or page. A
21  * {@link org.apache.tapestry.engine.IComponentClassEnhancer}uses this information to create a
22  * subclass with the necessary instance variables and methods.
23  *
24  * @author Howard Lewis Ship
25  * @since 3.0
26  */

27
28 public class PropertySpecification extends BaseLocatable implements IPropertySpecification
29 {
30     private String JavaDoc _name;
31
32     private String JavaDoc _type;
33
34     private String JavaDoc _initialValue;
35
36     private String JavaDoc _persistence;
37
38     public String JavaDoc getInitialValue()
39     {
40         return _initialValue;
41     }
42
43     public String JavaDoc getName()
44     {
45         return _name;
46     }
47
48     public boolean isPersistent()
49     {
50         return _persistence != null;
51     }
52
53     /**
54      * The type of property to create, or null if no type was specified. The value is the name of a
55      * primitive type, a fully qualified class name, or an array name for either. Type is only
56      * specified for 3.0 DTDs, in 4.0 the only behavior is for the new property to match the type
57      * defined by an abstract accessor, or to be java.lang.Object.
58      */

59     public String JavaDoc getType()
60     {
61         return _type;
62     }
63
64     public void setInitialValue(String JavaDoc initialValue)
65     {
66         _initialValue = initialValue;
67     }
68
69     /**
70      * Sets the name of the property. This should not be changed once this IPropertySpecification is
71      * added to a {@link org.apache.tapestry.spec.ComponentSpecification}.
72      */

73
74     public void setName(String JavaDoc name)
75     {
76         _name = name;
77     }
78
79     public void setType(String JavaDoc type)
80     {
81         _type = type;
82     }
83
84     /** @since 4.0 */
85     public String JavaDoc getPersistence()
86     {
87         return _persistence;
88     }
89
90     /** @since 4.0 */
91     public void setPersistence(String JavaDoc persistence)
92     {
93         _persistence = persistence;
94     }
95 }
Popular Tags