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
022     * information to create a subclass with the necessary instance variables and
023     * methods.
024     * 
025     * @author glongman@intelligentworks.com
026     */
027    public interface IPropertySpecification extends LocationHolder
028    {
029    
030        /**
031         * Returns the initial value for this property, as a binding reference. May
032         * return null if the property has no initial value. The initial value is
033         * from finishLoad() and re-applied in pageDetached().
034         */
035    
036        String getInitialValue();
037    
038        String getName();
039    
040        /**
041         * Returns true if {@link #getPersistence()}is null.
042         */
043        boolean isPersistent();
044    
045        String getType();
046    
047        void setInitialValue(String initialValue);
048    
049        /**
050         * Sets the name of the property. This should not be changed once this
051         * IPropertySpecification is added to a
052         * {@link org.apache.tapestry.spec.IComponentSpecification}.
053         */
054        void setName(String name);
055    
056        void setType(String type);
057    
058        /**
059         * A string indicating how the property is persisted.
060         * 
061         * @since 4.0
062         */
063    
064        void setPersistence(String persistence);
065    
066        /**
067         * If null, then the property is not persistent.
068         * 
069         * @since 4.0
070         */
071        String getPersistence();
072    
073    }