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