Coverage Report - org.apache.tapestry.annotations.Component
 
Classes in this File Line Coverage Branch Coverage Complexity
Component
N/A
N/A
0
 
 1  
 // Copyright 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.annotations;
 16  
 
 17  
 import java.lang.annotation.Documented;
 18  
 import java.lang.annotation.ElementType;
 19  
 import java.lang.annotation.Retention;
 20  
 import java.lang.annotation.RetentionPolicy;
 21  
 import java.lang.annotation.Target;
 22  
 
 23  
 /**
 24  
  * Annotation used within a page or component class to define a contained component (which will
 25  
  * typically match up against a component reference in the template). This annotation is attached to
 26  
  * an accessor method.
 27  
  * 
 28  
  * @author Howard Lewis Ship
 29  
  * @since 4.0
 30  
  */
 31  
 @Target(
 32  
 { ElementType.METHOD })
 33  
 @Retention(RetentionPolicy.RUNTIME)
 34  
 @Documented
 35  
 public @interface Component {
 36  
 
 37  
     /**
 38  
      * The component's id. Defaults to the property name if left unspecified.
 39  
      */
 40  
 
 41  
     String id() default "";
 42  
 
 43  
     /**
 44  
      * The component type. Defaults to the return type class name if left unspecified.
 45  
      */
 46  
 
 47  
     String type() default "";
 48  
     
 49  
     /**
 50  
      * The name of a previously defined component. 
 51  
      * The type and bindings of that component will be copied to this component. 
 52  
      * Either type or copy-of must be specified. 
 53  
      */
 54  
 
 55  
     String copyOf() default "";    
 56  
 
 57  
     /**
 58  
      * If true, then the component inherits informal parameters from its container.
 59  
      */
 60  
 
 61  
     boolean inheritInformalParameters() default false;
 62  
 
 63  
     /**
 64  
      * Bindings for the component. Each binding string is of the format
 65  
      * <code><em>name</em>=<em>binding reference</em></code>, where the binding reference is
 66  
      * the same kind of string (possibly with a prefix such as "ognl:" or "message:" as would appear
 67  
      * in a specification.
 68  
      * 
 69  
      * @Binding annotations.
 70  
      */
 71  
 
 72  
     String[] bindings() default {};
 73  
 
 74  
     /**
 75  
      * Inherited bindings bind a parameter of the component to a parameter
 76  
      * of the container. Each binding string is of the format
 77  
      * <code><em>parameter-name</em>=<em>container-parameter-name</em></code>, where the former is
 78  
      * the name of the component parameter and the latter is the name of the container parameter to bind
 79  
      * the parameter to.
 80  
      * In case both names are the same, it's possible to just use <code><em>parameter-name</em></code>.
 81  
      */
 82  
 
 83  
     String[] inheritedBindings() default {};
 84  
 }