01: /*
02: * Copyright (C) 2004 TiongHiang Lee
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: * Email: thlee@onemindsoft.org
19: */
20:
21: package org.onemind.swingweb.templaterender.peerdelegate;
22:
23: import java.io.Writer;
24: import java.util.logging.Level;
25: import java.util.logging.Logger;
26: import org.onemind.awtbridge.peer.BridgePeer;
27: import org.onemind.awtbridge.render.*;
28: import org.onemind.swingweb.templaterender.TemplateRenderContext;
29:
30: /**
31: * The template render delegate
32: * @author TiongHiang Lee (thlee@onemindsoft.org)
33: *
34: */
35: public abstract class TemplateRenderDelegate implements RenderDelegate {
36:
37: /** the logger * */
38: private static final Logger _logger = Logger
39: .getLogger(TemplateRenderDelegate.class.getName());
40:
41: /**
42: * Constructor
43: */
44: protected TemplateRenderDelegate() {
45: }
46:
47: /**
48: * {@inheritDoc}
49: */
50: public void render(BridgePeer peer, BridgeRenderContext context,
51: Object renderObject) throws RenderingException {
52: if (_logger.isLoggable(Level.FINEST)) {
53: _logger.finest("Render " + peer + " with delegate " + this );
54: }
55: ((TemplateRenderContext) context).renderTemplate(peer,
56: (Writer) renderObject);
57: }
58: }
|