Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
MarkupWriterSource |
|
| 1.0;1 |
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.markup; |
|
16 | ||
17 | import java.io.PrintWriter; |
|
18 | ||
19 | import org.apache.tapestry.IMarkupWriter; |
|
20 | import org.apache.tapestry.json.IJSONWriter; |
|
21 | import org.apache.tapestry.util.ContentType; |
|
22 | ||
23 | /** |
|
24 | * Service interface for <code>tapestry.markup.MarkupWriterSource</code> service. A factory |
|
25 | * service that creates new instances of {@link org.apache.tapestry.IMarkupWriter}, configured for |
|
26 | * different content types; |
|
27 | * |
|
28 | * @author Howard M. Lewis Ship |
|
29 | * @since 4.0 |
|
30 | */ |
|
31 | public interface MarkupWriterSource |
|
32 | { |
|
33 | /** |
|
34 | * Creates and returns a new instance of {@link org.apache.tapestry.IMarkupWriter}. The content |
|
35 | * type is used to find the proper implemenation. Any additional content type data (after a ';') |
|
36 | * is ignored. |
|
37 | * |
|
38 | * @param writer |
|
39 | * The {@link PrintWriter} to which the markup writer should send output. |
|
40 | * @param contentType |
|
41 | * Used to locate the correct markup writer implementation (used to select a |
|
42 | * {@link MarkupFilter}. |
|
43 | * @return The configured markup writer instance. |
|
44 | */ |
|
45 | ||
46 | IMarkupWriter newMarkupWriter(PrintWriter writer, ContentType contentType); |
|
47 | ||
48 | /** |
|
49 | * Creates and returns a new instance of {@link IJSONWriter}. The content type is used |
|
50 | * to find the proper implementation. Any additional content type data (after a ';') |
|
51 | * is ignored. |
|
52 | * |
|
53 | * @param writer |
|
54 | * The {@link PrintWriter} to which the markup writer should send output. |
|
55 | * @param contentType |
|
56 | * Used to locate the correct markup writer implementation (used to select a |
|
57 | * {@link MarkupFilter}. |
|
58 | * @return The configured json writer instance. |
|
59 | */ |
|
60 | IJSONWriter newJSONWriter(PrintWriter writer, ContentType contentType); |
|
61 | } |