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 * A class-level annotation that identifies a class as a component. Note that values defined by this 25 * annotation will <strong>override</strong> corresponding values in the XML component 26 * specification. At this time it is still necessary to have a component specification, even if it 27 * is empty (this limitation may be lifted before the final 4.0 release). 28 * 29 * @author Howard Lewis Ship 30 * @since 4.0 31 */ 32 @Target( 33 { ElementType.TYPE }) 34 @Retention(RetentionPolicy.RUNTIME) 35 @Documented 36 public @interface ComponentClass { 37 38 /** 39 * If true (the default), then the defined component will allow and use it's body. Otherwise the 40 * body is discarded (which may cause errors if the body contains components). 41 */ 42 43 boolean allowBody() default true; 44 45 /** 46 * If true (the default), then the component accepts informal parameters. Generally, informal 47 * parameters become additional attributes of the element rendered by this component. 48 */ 49 50 boolean allowInformalParameters() default true; 51 52 /** 53 * A comma-seperated list of parameter names that can not be bound informally. These represent 54 * attributes generated internally by the component, and this is used to prevent name conflicts. 55 * Comparison of informal parameter name against reserved parameter name is caseless. Note also 56 * that all formal parameters are automatically part of the list of reserved parameters. 57 */ 58 String reservedParameters() default ""; 59 60 } 61