View Javadoc
1   /*
2    * #%L
3    * wcm.io
4    * %%
5    * Copyright (C) 2019 wcm.io
6    * %%
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * #L%
19   */
20  package io.wcm.wcm.ui.granite.pathfield.impl.util;
21  
22  import java.io.IOException;
23  
24  import javax.servlet.jsp.JspWriter;
25  
26  /**
27   * Workaround because {@link com.adobe.granite.ui.components.ComponentHelper} always tries
28   * to access the JspWriter from the dummy page context.
29   */
30  class DummyJspWriter extends JspWriter {
31  
32    DummyJspWriter() {
33      super(0, false);
34    }
35  
36  
37    // --- unsupported methods ---
38  
39    @Override
40    public void newLine() throws IOException {
41      throw new UnsupportedOperationException();
42    }
43  
44    @Override
45    public void print(boolean b) throws IOException {
46      throw new UnsupportedOperationException();
47    }
48  
49    @Override
50    public void print(char c) throws IOException {
51      throw new UnsupportedOperationException();
52    }
53  
54    @Override
55    public void print(int i) throws IOException {
56      throw new UnsupportedOperationException();
57    }
58  
59    @Override
60    public void print(long l) throws IOException {
61      throw new UnsupportedOperationException();
62    }
63  
64    @Override
65    public void print(float f) throws IOException {
66      throw new UnsupportedOperationException();
67    }
68  
69    @Override
70    public void print(double d) throws IOException {
71      throw new UnsupportedOperationException();
72    }
73  
74    @Override
75    public void print(char[] s) throws IOException {
76      throw new UnsupportedOperationException();
77    }
78  
79    @Override
80    public void print(String s) throws IOException {
81      throw new UnsupportedOperationException();
82    }
83  
84    @Override
85    public void print(Object obj) throws IOException {
86      throw new UnsupportedOperationException();
87    }
88  
89    @Override
90    public void println() throws IOException {
91      throw new UnsupportedOperationException();
92    }
93  
94    @Override
95    public void println(boolean x) throws IOException {
96      throw new UnsupportedOperationException();
97    }
98  
99    @Override
100   public void println(char x) throws IOException {
101     throw new UnsupportedOperationException();
102   }
103 
104   @Override
105   public void println(int x) throws IOException {
106     throw new UnsupportedOperationException();
107   }
108 
109   @Override
110   public void println(long x) throws IOException {
111     throw new UnsupportedOperationException();
112   }
113 
114   @Override
115   public void println(float x) throws IOException {
116     throw new UnsupportedOperationException();
117   }
118 
119   @Override
120   public void println(double x) throws IOException {
121     throw new UnsupportedOperationException();
122   }
123 
124   @Override
125   public void println(char[] x) throws IOException {
126     throw new UnsupportedOperationException();
127   }
128 
129   @Override
130   public void println(String x) throws IOException {
131     throw new UnsupportedOperationException();
132   }
133 
134   @Override
135   public void println(Object x) throws IOException {
136     throw new UnsupportedOperationException();
137   }
138 
139   @Override
140   public void clear() throws IOException {
141     throw new UnsupportedOperationException();
142   }
143 
144   @Override
145   public void clearBuffer() throws IOException {
146     throw new UnsupportedOperationException();
147   }
148 
149   @Override
150   public void flush() throws IOException {
151     throw new UnsupportedOperationException();
152   }
153 
154   @Override
155   public void close() throws IOException {
156     throw new UnsupportedOperationException();
157   }
158 
159   @Override
160   public int getRemaining() {
161     throw new UnsupportedOperationException();
162   }
163 
164   @Override
165   public void write(char[] cbuf, int off, int len) throws IOException {
166     throw new UnsupportedOperationException();
167   }
168 
169 }