|
|||||||||||||||||||
30 day Evaluation License registered to hlship@comcast.net Your 30 day evaluation period has expired. Please visit http://www.cenqua.com to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
NullWriter.java | 100% | 57.1% | 38.5% | 45.7% |
|
1 | // Copyright 2004, 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.engine; | |
16 | ||
17 | import org.apache.tapestry.IMarkupWriter; | |
18 | import org.apache.tapestry.NestedMarkupWriter; | |
19 | ||
20 | /** | |
21 | * A {@link IMarkupWriter}that does absolutely <em>nothing</em>; this is used during the rewind | |
22 | * phase of the request cycle when output is discarded anyway. | |
23 | * | |
24 | * @author Howard Lewis Ship, David Solis | |
25 | * @since 0.2.9 | |
26 | */ | |
27 | ||
28 | public class NullWriter implements NestedMarkupWriter | |
29 | { | |
30 | private static IMarkupWriter shared; | |
31 | ||
32 | 25 | public static IMarkupWriter getSharedInstance() |
33 | { | |
34 | 25 | if (shared == null) |
35 | 1 | shared = new NullWriter(); |
36 | ||
37 | 25 | return shared; |
38 | } | |
39 | ||
40 | 0 | public String getBuffer() |
41 | { | |
42 | 0 | return null; |
43 | } | |
44 | ||
45 | 147 | public void printRaw(char[] buffer, int offset, int length) |
46 | { | |
47 | } | |
48 | ||
49 | 0 | public void printRaw(String value) |
50 | { | |
51 | } | |
52 | ||
53 | 19 | public void println() |
54 | { | |
55 | } | |
56 | ||
57 | 0 | public void print(char[] data, int offset, int length) |
58 | { | |
59 | } | |
60 | ||
61 | 0 | public void print(char value) |
62 | { | |
63 | } | |
64 | ||
65 | 0 | public void print(int value) |
66 | { | |
67 | } | |
68 | ||
69 | 0 | public void print(String value) |
70 | { | |
71 | } | |
72 | ||
73 | /** | |
74 | * Returns <code>this</code>: since a NullWriter doesn't actually do anything, one is as good | |
75 | * as another!. | |
76 | */ | |
77 | ||
78 | 11 | public NestedMarkupWriter getNestedWriter() |
79 | { | |
80 | 11 | return this; |
81 | } | |
82 | ||
83 | 0 | public String getContentType() |
84 | { | |
85 | 0 | return null; |
86 | } | |
87 | ||
88 | 0 | public void flush() |
89 | { | |
90 | } | |
91 | ||
92 | 9 | public void end() |
93 | { | |
94 | } | |
95 | ||
96 | 0 | public void end(String name) |
97 | { | |
98 | } | |
99 | ||
100 | 0 | public void comment(String value) |
101 | { | |
102 | } | |
103 | ||
104 | 1 | public void closeTag() |
105 | { | |
106 | } | |
107 | ||
108 | 6 | public void close() |
109 | { | |
110 | } | |
111 | ||
112 | /** | |
113 | * Always returns false. | |
114 | */ | |
115 | ||
116 | 0 | public boolean checkError() |
117 | { | |
118 | 0 | return false; |
119 | } | |
120 | ||
121 | 17 | public void beginEmpty(String name) |
122 | { | |
123 | } | |
124 | ||
125 | 11 | public void begin(String name) |
126 | { | |
127 | } | |
128 | ||
129 | 0 | public void attribute(String name, int value) |
130 | { | |
131 | } | |
132 | ||
133 | 61 | public void attribute(String name, String value) |
134 | { | |
135 | } | |
136 | ||
137 | /** | |
138 | * @see org.apache.tapestry.IMarkupWriter#attribute(java.lang.String, boolean) | |
139 | * @since 3.0 | |
140 | */ | |
141 | ||
142 | 0 | public void attribute(String name, boolean value) |
143 | { | |
144 | } | |
145 | ||
146 | /** | |
147 | * @see org.apache.tapestry.IMarkupWriter#attributeRaw(java.lang.String, java.lang.String) | |
148 | * @since 3.0 | |
149 | */ | |
150 | ||
151 | 0 | public void attributeRaw(String name, String value) |
152 | { | |
153 | } | |
154 | ||
155 | 0 | public void print(char[] data, int offset, int length, boolean raw) |
156 | { | |
157 | } | |
158 | ||
159 | 0 | public void print(String value, boolean raw) |
160 | { | |
161 | } | |
162 | } |
|