001// Copyright 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.annotations; 016 017import java.lang.annotation.Documented; 018import java.lang.annotation.ElementType; 019import java.lang.annotation.Inherited; 020import java.lang.annotation.Retention; 021import java.lang.annotation.RetentionPolicy; 022import java.lang.annotation.Target; 023 024/** 025 * A class-level annotation that identifies a class as a component. Note that values defined by this 026 * annotation will <strong>override</strong> corresponding values in the XML component 027 * specification. At this time it is still necessary to have a component specification, even if it 028 * is empty (this limitation may be lifted before the final 4.0 release). 029 * 030 * @author Howard Lewis Ship 031 * @since 4.0 032 */ 033@Target( 034{ ElementType.TYPE }) 035@Retention(RetentionPolicy.RUNTIME) 036@Documented 037@Inherited 038public @interface ComponentClass { 039 040 /** 041 * If true (the default), then the defined component will allow and use it's body. Otherwise the 042 * body is discarded (which may cause errors if the body contains components). 043 */ 044 045 boolean allowBody() default true; 046 047 /** 048 * If true (the default), then the component accepts informal parameters. Generally, informal 049 * parameters become additional attributes of the element rendered by this component. 050 */ 051 052 boolean allowInformalParameters() default true; 053 054 /** 055 * A comma-seperated list of parameter names that can not be bound informally. These represent 056 * attributes generated internally by the component, and this is used to prevent name conflicts. 057 * Comparison of informal parameter name against reserved parameter name is caseless. Note also 058 * that all formal parameters are automatically part of the list of reserved parameters. 059 */ 060 String reservedParameters() default ""; 061 062}