01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.render;
19:
20: import java.io.IOException;
21: import java.io.Writer;
22: import java.util.Collection;
23: import java.util.Map;
24:
25: import de.finix.contelligent.CallData;
26: import de.finix.contelligent.exception.ContelligentException;
27:
28: /**
29: * A <code>Renderer</code> may write arbitrary output when its {@link #render}
30: * method gets called. It is usually associated with a {@link Renderable}
31: * component and then renders the representation of that component.
32: */
33: public interface Renderer {
34:
35: /**
36: * Returns a array of {@link ParameterDescription} instances containing all
37: * informations about the parameters used by the {@link #render} method of
38: * this renderer. If the renderer does not need any parameters this method
39: * may return null as well as an empty array. <BR>
40: * Note that the Contelligent system <B>does not</B> check whether any
41: * {@link ParameterDescription#isRequired required} parameter is contained
42: * within the parameter map passed to the render method. If the
43: * implementation want's to check this it may either implement the check
44: * itself or use {@link RenderUtils#checkParameters}.
45: */
46: public ParameterDescription[] getParameterDescription();
47:
48: /**
49: * Actually performs the rendering, that is writing anything to the given
50: * writer.
51: *
52: * @exception IOException
53: * if an error occurs while writing anything to the writer.
54: * @exception MissingParameterException
55: * if a required parameter is not contained within the
56: * <tt>parameterMap</tt>.
57: * @exception ContelligentException
58: * to signalize any internal error during rendering.
59: */
60: public void render(Writer writer, Map parameterMap,
61: CallData callData) throws IOException,
62: MissingParameterException, ContelligentException;
63:
64: /**
65: * Returns a collection containing the
66: * {@link de.finix.contelligent.category.Category categories} this renderer
67: * supports or null or an empty collection if none are supported.
68: */
69: public Collection getSensitiveCategories();
70:
71: }
|