001 // Copyright 2004, 2005 The Apache Software Foundation
002 //
003 // Licensed under the Apache License, Version 2.0 (the "License");
004 // you may not use this file except in compliance with the License.
005 // You may obtain a copy of the License at
006 //
007 // http://www.apache.org/licenses/LICENSE-2.0
008 //
009 // Unless required by applicable law or agreed to in writing, software
010 // distributed under the License is distributed on an "AS IS" BASIS,
011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012 // See the License for the specific language governing permissions and
013 // limitations under the License.
014
015 package org.apache.tapestry.spec;
016
017 import org.apache.hivemind.LocationHolder;
018
019 /**
020 * Defines a transient or persistant property of a component or page. A
021 * {@link org.apache.tapestry.enhance.ComponentClassFactory}uses this information to create a
022 * subclass with the necessary instance variables and methods.
023 *
024 * @author glongman@intelligentworks.com
025 */
026 public interface IPropertySpecification extends LocationHolder
027 {
028 /**
029 * Returns the initial value for this property, as a binding reference. May return null if the
030 * property has no initial value. The initial value is from finishLoad() and re-applied in
031 * pageDetached().
032 */
033
034 public String getInitialValue();
035
036 public String getName();
037
038 /**
039 * Returns true if {@link #getPersistence()}is null.
040 */
041 public boolean isPersistent();
042
043 public String getType();
044
045 public void setInitialValue(String initialValue);
046
047 /**
048 * Sets the name of the property. This should not be changed once this IPropertySpecification is
049 * added to a {@link org.apache.tapestry.spec.IComponentSpecification}.
050 */
051 public void setName(String name);
052
053 public void setType(String type);
054
055 /**
056 * A string indicating how the property is persisted.
057 *
058 * @since 4.0
059 */
060
061 public void setPersistence(String persistence);
062
063 /**
064 * If null, then the property is not persistent.
065 *
066 * @since 4.0
067 */
068 public String getPersistence();
069
070 }