001 // Copyright 2004, 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
015 package org.apache.tapestry;
016
017 /**
018 * An element that may be asked to render itself to an
019 * {@link IMarkupWriter} using a {@link IRequestCycle}.
020 *
021 * <p>This primarily includes {@link IComponent} and {@link IPage},
022 * but also extends to other things, such as objects responsible for
023 * rendering static markup text.
024 *
025 * @author Howard Lewis Ship
026 *
027 **/
028
029 public interface IRender
030 {
031 /**
032 * The principal rendering/rewinding method. This will cause
033 * the receiving component to render its top level elements (HTML
034 * text and components).
035 *
036 * <p>Renderring and rewinding are the exact same process. The
037 * same code that renders must be able to restore state by going
038 * through the exact same operations (even though the output is
039 * discarded).
040 *
041 **/
042
043 void render(IMarkupWriter writer, IRequestCycle cycle);
044
045 }