Clover coverage report - Code Coverage for tapestry release 3.1-alpha-1
Coverage timestamp: Mon Feb 21 2005 09:16:14 EST
file stats: LOC: 290   Methods: 0
NCLOC: 44   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
IComponentSpecification.java - - - -
coverage
 1   
 // Copyright 2004, 2005 The Apache Software Foundation
 2   
 //
 3   
 // Licensed under the Apache License, Version 2.0 (the "License");
 4   
 // you may not use this file except in compliance with the License.
 5   
 // You may obtain a copy of the License at
 6   
 //
 7   
 //     http://www.apache.org/licenses/LICENSE-2.0
 8   
 //
 9   
 // Unless required by applicable law or agreed to in writing, software
 10   
 // distributed under the License is distributed on an "AS IS" BASIS,
 11   
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12   
 // See the License for the specific language governing permissions and
 13   
 // limitations under the License.
 14   
 
 15   
 package org.apache.tapestry.spec;
 16   
 
 17   
 import java.util.Collection;
 18   
 import java.util.List;
 19   
 
 20   
 import org.apache.hivemind.Locatable;
 21   
 import org.apache.hivemind.LocationHolder;
 22   
 import org.apache.hivemind.Resource;
 23   
 import org.apache.tapestry.util.IPropertyHolder;
 24   
 
 25   
 /**
 26   
  * A specification for a component, as read from an XML specification file.
 27   
  * <p>
 28   
  * A specification consists of
 29   
  * <ul>
 30   
  * <li>An implementing class
 31   
  * <li>An optional template
 32   
  * <li>An optional description
 33   
  * <li>A set of contained components
 34   
  * <li>Bindings for the properties of each contained component
 35   
  * <li>A set of named assets
 36   
  * <li>Definitions for helper beans
 37   
  * <li>Any reserved names (used for HTML attributes)
 38   
  * </ul>
 39   
  * <p>
 40   
  * From this information, an actual component may be instantiated and initialized. Instantiating a
 41   
  * component is usually a recursive process, since to initialize a container component, it is
 42   
  * necessary to instantiate and initialize its contained components as well.
 43   
  * 
 44   
  * @see org.apache.tapestry.IComponent
 45   
  * @see IContainedComponent
 46   
  * @see IComponentSpecification
 47   
  * @see org.apache.tapestry.engine.IPageLoader
 48   
  * @author glongman@intelligentworks.com
 49   
  */
 50   
 public interface IComponentSpecification extends IPropertyHolder, LocationHolder, Locatable
 51   
 {
 52   
     /**
 53   
      * @throws IllegalArgumentException
 54   
      *             if the name already exists.
 55   
      */
 56   
     public void addAsset(String name, IAssetSpecification asset);
 57   
 
 58   
     /**
 59   
      * @throws IllegalArgumentException
 60   
      *             if the id is already defined.
 61   
      */
 62   
     public void addComponent(String id, IContainedComponent component);
 63   
 
 64   
     /**
 65   
      * Adds the parameter. The name is added as a reserved name.
 66   
      * 
 67   
      * @throws IllegalArgumentException
 68   
      *             if the name already exists.
 69   
      */
 70   
     public void addParameter(String name, IParameterSpecification spec);
 71   
 
 72   
     /**
 73   
      * Returns true if the component is allowed to wrap other elements (static HTML or other
 74   
      * components). The default is true.
 75   
      * 
 76   
      * @see #setAllowBody(boolean)
 77   
      */
 78   
     public boolean getAllowBody();
 79   
 
 80   
     /**
 81   
      * Returns true if the component allows informal parameters (parameters not formally defined).
 82   
      * Informal parameters are generally used to create additional HTML attributes for an HTML tag
 83   
      * rendered by the component. This is often used to specify JavaScript event handlers or the
 84   
      * class of the component (for Cascarding Style Sheets).
 85   
      * <p>
 86   
      * The default value is true.
 87   
      * 
 88   
      * @see #setAllowInformalParameters(boolean)
 89   
      */
 90   
     public boolean getAllowInformalParameters();
 91   
 
 92   
     /**
 93   
      * Returns the {@link IAssetSpecification}with the given name, or null if no such specification
 94   
      * exists.
 95   
      * 
 96   
      * @see #addAsset(String,IAssetSpecification)
 97   
      */
 98   
     public IAssetSpecification getAsset(String name);
 99   
 
 100   
     /**
 101   
      * Returns a <code>List</code> of the String names of all assets, in alphabetical order
 102   
      */
 103   
     public List getAssetNames();
 104   
 
 105   
     /**
 106   
      * Returns the specification of a contained component with the given id, or null if no such
 107   
      * contained component exists.
 108   
      * 
 109   
      * @see #addComponent(String, IContainedComponent)
 110   
      */
 111   
     public IContainedComponent getComponent(String id);
 112   
 
 113   
     public String getComponentClassName();
 114   
 
 115   
     /**
 116   
      * Returns an <code>List</code> of the String names of the {@link IContainedComponent}s for
 117   
      * this component.
 118   
      * 
 119   
      * @see #addComponent(String, IContainedComponent)
 120   
      */
 121   
     public List getComponentIds();
 122   
 
 123   
     /**
 124   
      * Returns the specification of a parameter with the given name, or null if no such parameter
 125   
      * exists.
 126   
      * 
 127   
      * @see #addParameter(String, IParameterSpecification)
 128   
      */
 129   
     public IParameterSpecification getParameter(String name);
 130   
 
 131   
     /**
 132   
      * Returns a List of of String names of all parameters. This list is in alphabetical order.
 133   
      * 
 134   
      * @see #addParameter(String, IParameterSpecification)
 135   
      */
 136   
     public List getParameterNames();
 137   
 
 138   
     public void setAllowBody(boolean value);
 139   
 
 140   
     public void setAllowInformalParameters(boolean value);
 141   
 
 142   
     public void setComponentClassName(String value);
 143   
 
 144   
     /**
 145   
      * @since 1.0.4
 146   
      * @throws IllegalArgumentException
 147   
      *             if the bean already has a specification.
 148   
      */
 149   
     public void addBeanSpecification(String name, IBeanSpecification specification);
 150   
 
 151   
     /**
 152   
      * Returns the {@link IBeanSpecification}for the given name, or null if not such specification
 153   
      * exists.
 154   
      * 
 155   
      * @since 1.0.4
 156   
      */
 157   
     public IBeanSpecification getBeanSpecification(String name);
 158   
 
 159   
     /**
 160   
      * Returns an unmodifiable collection of the names of all beans.
 161   
      */
 162   
     public Collection getBeanNames();
 163   
 
 164   
     /**
 165   
      * Adds the value as a reserved name. Reserved names are not allowed as the names of informal
 166   
      * parameters. Since the comparison is caseless, the value is converted to lowercase before
 167   
      * being stored.
 168   
      * 
 169   
      * @since 1.0.5
 170   
      */
 171   
     public void addReservedParameterName(String value);
 172   
 
 173   
     /**
 174   
      * Returns true if the value specified is in the reserved name list. The comparison is caseless.
 175   
      * All formal parameters are automatically in the reserved name list, as well as any additional
 176   
      * reserved names specified in the component specification. The latter refer to HTML attributes
 177   
      * generated directly by the component.
 178   
      * 
 179   
      * @since 1.0.5
 180   
      */
 181   
     public boolean isReservedParameterName(String value);
 182   
 
 183   
     /**
 184   
      * Returns the documentation for this component.
 185   
      * 
 186   
      * @since 1.0.9
 187   
      */
 188   
     public String getDescription();
 189   
 
 190   
     /**
 191   
      * Sets the documentation for this component.
 192   
      * 
 193   
      * @since 1.0.9
 194   
      */
 195   
     public void setDescription(String description);
 196   
 
 197   
     /**
 198   
      * Returns the XML Public Id for the specification file, or null if not applicable.
 199   
      * <p>
 200   
      * This method exists as a convienience for the Spindle plugin. A previous method used an
 201   
      * arbitrary version string, the public id is more useful and less ambiguous.
 202   
      * 
 203   
      * @since 2.2
 204   
      */
 205   
     public String getPublicId();
 206   
 
 207   
     /** @since 2.2 * */
 208   
     public void setPublicId(String publicId);
 209   
 
 210   
     /**
 211   
      * Returns true if the specification is known to be a page specification and not a component
 212   
      * specification. Earlier versions of the framework did not distinguish between the two, but
 213   
      * starting in 2.2, there are seperate XML entities for pages and components. Pages omit several
 214   
      * attributes and entities related to parameters, as parameters only make sense for components.
 215   
      * 
 216   
      * @since 2.2
 217   
      */
 218   
     public boolean isPageSpecification();
 219   
 
 220   
     /** @since 2.2 * */
 221   
     public void setPageSpecification(boolean pageSpecification);
 222   
 
 223   
     /** @since 3.0 * */
 224   
     public Resource getSpecificationLocation();
 225   
 
 226   
     /** @since 3.0 * */
 227   
     public void setSpecificationLocation(Resource specificationLocation);
 228   
 
 229   
     /**
 230   
      * Adds a new property specification. The name of the property must not already be defined (and
 231   
      * must not change after being added).
 232   
      * 
 233   
      * @since 3.0
 234   
      */
 235   
     public void addPropertySpecification(IPropertySpecification spec);
 236   
 
 237   
     /**
 238   
      * Returns a sorted, immutable list of the names of all
 239   
      * {@link org.apache.tapestry.spec.IPropertySpecification}s.
 240   
      * 
 241   
      * @since 3.0
 242   
      */
 243   
     public List getPropertySpecificationNames();
 244   
 
 245   
     /**
 246   
      * Returns the named {@link org.apache.tapestry.spec.IPropertySpecification}, or null if no
 247   
      * such specification exist.
 248   
      * 
 249   
      * @since 3.0
 250   
      * @see #addPropertySpecification(IPropertySpecification)
 251   
      */
 252   
     public IPropertySpecification getPropertySpecification(String name);
 253   
 
 254   
     /**
 255   
      * Adds a {@link InjectSpecification}.
 256   
      * 
 257   
      * @since 3.1
 258   
      */
 259   
 
 260   
     public void addInjectSpecification(InjectSpecification spec);
 261   
 
 262   
     /**
 263   
      * Returns the list of {@link InjectSpecification}. Will return an empty list if no
 264   
      * specifications have been added.
 265   
      * 
 266   
      * @since 3.1
 267   
      */
 268   
 
 269   
     public List getInjectSpecifications();
 270   
     
 271   
     /**
 272   
      * Adds a {@link org.apache.tapestry.spec.InjectStateSpecification}s.
 273   
      * 
 274   
      * @since 3.1
 275   
      */
 276   
     
 277   
     public void addInjectStateSpecification(InjectStateSpecification spec);
 278   
     
 279   
     /**
 280   
      * Returns the list of {@link org.apache.tapestry.spec.InjectStateSpecification}s.  Returns
 281   
      * an empty list if no specifications have been added.
 282   
      * 
 283   
      * @since 3.1
 284   
      * 
 285   
      */
 286   
     
 287   
     public List getInjectStateSpecifications();
 288   
     
 289   
     
 290   
 }