Coverage Report - org.apache.tapestry.engine.NullWriter
 
Classes in this File Line Coverage Branch Coverage Complexity
NullWriter
0%
0/38
0%
0/2
1.029
 
 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  
 import org.apache.tapestry.markup.Attribute;
 20  
 
 21  
 /**
 22  
  * A {@link IMarkupWriter}that does absolutely <em>nothing</em>; this is used during the rewind
 23  
  * phase of the request cycle when output is discarded anyway.
 24  
  * 
 25  
  * @author Howard Lewis Ship, David Solis
 26  
  * @since 0.2.9
 27  
  */
 28  
 
 29  0
 public class NullWriter implements NestedMarkupWriter
 30  
 {
 31  
     private static IMarkupWriter shared;
 32  
 
 33  
     public static IMarkupWriter getSharedInstance()
 34  
     {
 35  0
         if (shared == null)
 36  0
             shared = new NullWriter();
 37  
 
 38  0
         return shared;
 39  
     }
 40  
 
 41  
     public String getBuffer()
 42  
     {
 43  0
         return null;
 44  
     }
 45  
 
 46  
     public void printRaw(char[] buffer, int offset, int length)
 47  
     {
 48  0
     }
 49  
 
 50  
     public void printRaw(String value)
 51  
     {
 52  0
     }
 53  
 
 54  
     public void println()
 55  
     {
 56  0
     }
 57  
 
 58  
     public void print(char[] data, int offset, int length)
 59  
     {
 60  0
     }
 61  
 
 62  
     public void print(char value)
 63  
     {
 64  0
     }
 65  
 
 66  
     public void print(int value)
 67  
     {
 68  0
     }
 69  
 
 70  
     public void print(String value)
 71  
     {
 72  0
     }
 73  
 
 74  
     /**
 75  
      * Returns <code>this</code>: since a NullWriter doesn't actually do anything, one is as good
 76  
      * as another!.
 77  
      */
 78  
 
 79  
     public NestedMarkupWriter getNestedWriter()
 80  
     {
 81  0
         return this;
 82  
     }
 83  
 
 84  
     public String getContentType()
 85  
     {
 86  0
         return null;
 87  
     }
 88  
 
 89  
     public void flush()
 90  
     {
 91  0
     }
 92  
 
 93  
     public void end()
 94  
     {
 95  0
     }
 96  
 
 97  
     public void end(String name)
 98  
     {
 99  0
     }
 100  
 
 101  
     public void comment(String value)
 102  
     {
 103  0
     }
 104  
 
 105  
     public void closeTag()
 106  
     {
 107  0
     }
 108  
 
 109  
     public void close()
 110  
     {
 111  0
     }
 112  
 
 113  
     /**
 114  
      * Always returns false.
 115  
      */
 116  
 
 117  
     public boolean checkError()
 118  
     {
 119  0
         return false;
 120  
     }
 121  
 
 122  
     public void beginEmpty(String name)
 123  
     {
 124  0
     }
 125  
 
 126  
     public void begin(String name)
 127  
     {
 128  0
     }
 129  
 
 130  
     public void attribute(String name, int value)
 131  
     {
 132  0
     }
 133  
 
 134  
     public void attribute(String name, String value)
 135  
     {
 136  0
     }
 137  
     
 138  
     public void attribute(String name, boolean value)
 139  
     {
 140  0
     }
 141  
     
 142  
     public void attributeRaw(String name, String value)
 143  
     {
 144  0
     }
 145  
     
 146  
     public void attribute(String value)
 147  
     {
 148  0
     }
 149  
     
 150  
     public void appendAttribute(String name, boolean value)
 151  
     {
 152  0
     }
 153  
     
 154  
     public void appendAttribute(String name, int value)
 155  
     {
 156  0
     }
 157  
     
 158  
     public void appendAttribute(String name, String value)
 159  
     {
 160  0
     }
 161  
     
 162  
     public void appendAttributeRaw(String name, String value)
 163  
     {
 164  0
     }
 165  
     
 166  
     public Attribute getAttribute(String name)
 167  
     {
 168  0
         return null;
 169  
     }
 170  
     
 171  
     public boolean hasAttribute(String name)
 172  
     {
 173  0
         return false;
 174  
     }
 175  
     
 176  
     public Attribute removeAttribute(String name)
 177  
     {
 178  0
         return null;
 179  
     }
 180  
     
 181  
     public void clearAttributes()
 182  
     {
 183  0
     }
 184  
     
 185  
     public void print(char[] data, int offset, int length, boolean raw)
 186  
     {
 187  0
     }
 188  
 
 189  
     public void print(String value, boolean raw)
 190  
     {
 191  0
     }
 192  
 }