01: /*
02: * Created on 24-May-2006
03: */
04: package uk.org.ponder.rsf.renderer.scr;
05:
06: import uk.org.ponder.rsf.renderer.ComponentRenderer;
07: import uk.org.ponder.rsf.renderer.RenderUtil;
08: import uk.org.ponder.rsf.template.XMLLump;
09: import uk.org.ponder.streamutil.write.PrintOutputStream;
10: import uk.org.ponder.xml.XMLWriter;
11:
12: /** Default null SCR used on discovering an unrecognised SCR tag.
13: * Minimal behaviour of writing the existing open tag, treating it as a
14: * trunk tag.
15: * @author Antranig Basman (antranig@caret.cam.ac.uk)
16: *
17: */
18:
19: public class NullRewriteSCR implements BasicSCR {
20:
21: public static final BasicSCR instance = new NullRewriteSCR();
22:
23: public String getName() {
24: return "null";
25: }
26:
27: public int render(XMLLump lump, XMLWriter xmlw) {
28: PrintOutputStream pos = xmlw.getInternalWriter();
29: XMLLump endopen = lump.open_end;
30: RenderUtil.dumpTillLump(lump.parent.lumps, lump.lumpindex,
31: endopen.lumpindex + 1, pos);
32: return ComponentRenderer.NESTING_TAG;
33: }
34:
35: }
|