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 java.util.Collection; 018 019 import org.apache.hivemind.Locatable; 020 import org.apache.hivemind.LocationHolder; 021 import org.apache.tapestry.util.IPropertyHolder; 022 023 /** 024 * Defines a contained component. This includes the information needed to get 025 * the contained component's specification, as well as any bindings for the 026 * component. 027 * 028 * @author glongman@intelligentworks.com 029 */ 030 public interface IContainedComponent extends IPropertyHolder, LocationHolder, 031 Locatable, PropertyInjectable 032 { 033 034 /** 035 * Returns the named binding, or null if the binding does not exist. 036 */ 037 IBindingSpecification getBinding(String name); 038 039 /** 040 * Returns an umodifiable <code>Collection</code> of Strings, each the 041 * name of one binding for the component. 042 */ 043 Collection getBindingNames(); 044 045 String getType(); 046 047 void setBinding(String name, IBindingSpecification spec); 048 049 void setType(String value); 050 051 /** 052 * Sets the String Id of the component being copied from. For use by IDE 053 * tools like Spindle. 054 * 055 * @since 1.0.9 056 */ 057 void setCopyOf(String id); 058 059 /** 060 * Returns the id of the component being copied from. For use by IDE tools 061 * like Spindle. 062 * 063 * @since 1.0.9 064 */ 065 String getCopyOf(); 066 067 /** 068 * Returns whether the contained component will inherit the informal 069 * parameters of its parent. 070 * 071 * @since 3.0 072 */ 073 boolean getInheritInformalParameters(); 074 075 /** 076 * Sets whether the contained component will inherit the informal parameters 077 * of its parent. 078 * 079 * @since 3.0 080 */ 081 void setInheritInformalParameters(boolean value); 082 083 /** 084 * Returns the name of the property to be created for this component, or 085 * null if no property should be created. 086 * 087 * @since 4.0 088 */ 089 String getPropertyName(); 090 091 /** 092 * @since 4.0 093 */ 094 095 void setPropertyName(String propertyName); 096 }