1 // Copyright 2006, 2007, 2008 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.tapestry5.services; 16 17 import org.apache.tapestry5.ContentType; 18 import org.apache.tapestry5.MarkupWriter; 19 20 /** 21 * Source for {@link org.apache.tapestry5.MarkupWriter} instances. 22 */ 23 public interface MarkupWriterFactory 24 { 25 /** 26 * Creates a markup writer for a particular content type. 27 * 28 * @param contentType type of content generated by the markup write; used to control the type of {@link 29 * org.apache.tapestry5.dom.MarkupModel} used with the {@link org.apache.tapestry5.dom.Document} 30 * the backs the markup writer. 31 */ 32 MarkupWriter newMarkupWriter(ContentType contentType); 33 34 /** 35 * Creates a markup writer for a particular content type, configured for <em>partial page rendering</em> (i.e., for 36 * a response to an Ajax request). 37 * 38 * @param contentType type of content generated by the markup write; used to control the type of {@link 39 * org.apache.tapestry5.dom.MarkupModel} used with the {@link org.apache.tapestry5.dom.Document} 40 * the backs the markup writer. 41 */ 42 MarkupWriter newPartialMarkupWriter(ContentType contentType); 43 44 /** 45 * Obtains a markup writer that will render the content for the provided logical page name. 46 * 47 * @param pageName logical page name 48 * @return writer configured for the page 49 */ 50 MarkupWriter newMarkupWriter(String pageName); 51 }