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. 021 * 022 * @author glongman@intelligentworks.com 023 */ 024 public interface IPropertySpecification extends LocationHolder 025 { 026 027 /** 028 * Returns the initial value for this property, as a binding reference. May 029 * return null if the property has no initial value. The initial value is 030 * from finishLoad() and re-applied in pageDetached(). 031 */ 032 033 String getInitialValue(); 034 035 String getName(); 036 037 /** 038 * Returns true if {@link #getPersistence()}is null. 039 */ 040 boolean isPersistent(); 041 042 String getType(); 043 044 void setInitialValue(String initialValue); 045 046 /** 047 * Sets the name of the property. This should not be changed once this 048 * IPropertySpecification is added to a 049 * {@link org.apache.tapestry.spec.IComponentSpecification}. 050 */ 051 void setName(String name); 052 053 void setType(String type); 054 055 /** 056 * Sets whether or not this property represents a concrete generic type. 057 * 058 * @param isGeneric 059 */ 060 void setGeneric(boolean isGeneric); 061 062 /** 063 * Checks if the type represented by this property is in a generic declaration. 064 * 065 * @return True if it is generic, false otherwise. 066 */ 067 boolean isGeneric(); 068 069 /** 070 * Checks if this property has previously had it's type information examined to 071 * determine if it is elligable for proxying. Meaning {@link #canProxy()} should 072 * be a real value. 073 * 074 * @return True if the proxy type has been checked, false otherwise. 075 */ 076 boolean isProxyChecked(); 077 078 /** 079 * Sets the state of this property so that it is known whether or not the type 080 * it represents has been checked as being compatible with proxying or not. 081 * 082 * @param checked 083 */ 084 void setProxyChecked(boolean checked); 085 086 /** 087 * Checks if this parameter can be proxied. 088 * 089 * @return True if the type can be proxied, false otherwise. 090 */ 091 boolean canProxy(); 092 093 /** 094 * Sets whether or not this property can be proxied. 095 * 096 * @param canProxy 097 */ 098 void setCanProxy(boolean canProxy); 099 100 /** 101 * A string indicating how the property is persisted. 102 * 103 * @since 4.0 104 */ 105 106 void setPersistence(String persistence); 107 108 /** 109 * If null, then the property is not persistent. 110 * 111 * @since 4.0 112 */ 113 String getPersistence(); 114 115 }