01: /*
02: * Copyright 2005 Paul Hinds
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.tp23.antinstaller.renderer.text;
17:
18: import java.io.BufferedReader;
19: import java.io.IOException;
20: import java.io.PrintStream;
21:
22: import org.tp23.antinstaller.InstallException;
23: import org.tp23.antinstaller.InstallerContext;
24: import org.tp23.antinstaller.input.OutputField;
25:
26: /**
27: *
28: * <p>Renders text OutputFields, TextOutputFieldRenderer should provide a no args constructor. </p>
29: * <p>The package name for TextOutputFieldRenderer is critical</p>
30: * BufferedInputStream is used for input to prevent new Buffered reader swallowing more input from the
31: * input stream than is strictly required
32: * <p>Copyright: Copyright (c) 2004</p>
33: * <p>Company: tp23</p>
34: * @author Paul Hinds
35: * @version $Id: TextOutputFieldRenderer.java,v 1.4 2006/12/21 00:03:01 teknopaul Exp $
36: */
37: public interface TextOutputFieldRenderer {
38: public void setContext(InstallerContext ctx);
39:
40: public void renderOutput(OutputField field, BufferedReader reader,
41: PrintStream out) throws InstallException, IOException;
42:
43: /**
44: * Called when validation fails
45: * @param field InputField
46: * @param in InputStream
47: * @param out PrintStream
48: * @throws IOException
49: */
50: public void renderError(OutputField field, BufferedReader reader,
51: PrintStream out) throws IOException;
52:
53: /** fields have abort for text since each field has its own input line*/
54: public boolean isAbort();
55: }
|