KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infohazard > maverick > transform > XMLTransformStep


1 /*
2  * $Id: XMLTransformStep.java,v 1.3 2003/10/27 11:00:50 thusted Exp $
3  * $Source: /cvsroot/mav/maverick/src/java/org/infohazard/maverick/transform/XMLTransformStep.java,v $
4  */

5
6 package org.infohazard.maverick.transform;
7
8 import org.infohazard.maverick.flow.*;
9 import java.io.*;
10 import javax.servlet.ServletException JavaDoc;
11 import javax.xml.transform.Source JavaDoc;
12 import org.xml.sax.ContentHandler JavaDoc;
13
14 /**
15  * Helper class for transform steps that are basically XML by nature.
16  * Funnels all method calls into the XML routines.
17  */

18 public abstract class XMLTransformStep extends AbstractTransformStep
19 {
20     /**
21      */

22     public XMLTransformStep(TransformContext tctx) throws ServletException JavaDoc
23     {
24         super(tctx);
25     }
26     
27     /**
28      * You implement this.
29      */

30     public abstract ContentHandler JavaDoc getSAXHandler() throws IOException, ServletException JavaDoc;
31     
32     /**
33      * You implement this.
34      */

35     public abstract void done() throws IOException, ServletException JavaDoc;
36
37     /**
38      * You implement this.
39      */

40     public abstract void go(Source JavaDoc input) throws IOException, ServletException JavaDoc;
41
42     /**
43      * Funnels output to go(Source)
44      */

45     public void go(Reader input) throws IOException, ServletException JavaDoc
46     {
47         this.go(new javax.xml.transform.stream.StreamSource JavaDoc(input));
48     }
49
50     /**
51      * Funnels output to go(Source)
52      */

53     public void go(String JavaDoc input) throws IOException, ServletException JavaDoc
54     {
55         this.go(new StringReader(input));
56     }
57 }
58
Popular Tags