001    // Copyright 2006, 2008, 2009, 2011 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.tapestry5.model;
016    
017    import org.apache.tapestry5.annotations.Parameter;
018    
019    /**
020     * Model for a <em>formal</em> parameter of a component.
021     *
022     * @see Parameter
023     */
024    public interface ParameterModel
025    {
026        /**
027         * The name of the parameter.
028         */
029        String getName();
030    
031        /**
032         * If true, the parameter is required.
033         */
034        boolean isRequired();
035    
036        /**
037         * If true, then no check is needed. If false, then the bound value must not be null.
038         */
039        boolean isAllowNull();
040    
041        /**
042         * The default binding prefix for the parameter, usually "prop".
043         */
044        String getDefaultBindingPrefix();
045    
046        /**
047         * @return true if the bound-value is cached in the component during rendering.
048         * @since 5.2.0.0
049         */
050        boolean isCached();
051    
052        /**
053         * Identifies the component model in which the parameter is defined.
054         *
055         * @return component model defining the parameter
056         * @since 5.3
057         */
058        ComponentModel getComponentModel();
059    }