001 // Copyright 2006, 2007 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.tapestry.annotations;
016
017 import java.lang.annotation.Documented;
018 import java.lang.annotation.ElementType;
019 import java.lang.annotation.Retention;
020 import static java.lang.annotation.RetentionPolicy.RUNTIME;
021 import java.lang.annotation.Target;
022
023 /**
024 * Marker annotation for methods that should be executed at the start of rendering the component. This usually includes
025 * rendering of the component's start tag.
026 * <p/>
027 * Such methods may optionally take a {@link org.apache.tapestry.MarkupWriter} parameter, and may return void or
028 * boolean. Returning true or void will allow the component to advance into the render template / render body phase. If
029 * a body is present, the {@link org.apache.tapestry.annotations.BeforeRenderBody} phase will execute. If a component
030 * has a template, the {@link BeforeRenderTemplate} phase will execute (and the render body will only occur if the
031 * template directs so).
032 * <p/>
033 * Either way, the {@link org.apache.tapestry.annotations.AfterRender} phase will execute after the template and/or body
034 * have rendered. A component with a body but without a template will still see the {@link
035 * org.apache.tapestry.annotations.BeforeRenderBody} phase execute.
036 * <p/>
037 * Returning false will skip rendering of the template and/or body, and jump directly to the {@link AfterRender} phase.
038 */
039 @Target(ElementType.METHOD)
040 @Retention(RUNTIME)
041 @Documented
042 public @interface BeginRender
043 {
044
045 }