1 38 39 40 package org.jvnet.fastinfoset; 41 42 import java.io.OutputStream ; 43 import org.xml.sax.ContentHandler ; 44 import org.xml.sax.ext.LexicalHandler ; 45 import javax.xml.transform.sax.SAXResult ; 46 import com.sun.xml.fastinfoset.sax.SAXDocumentSerializer; 47 48 68 public class FastInfosetResult extends SAXResult { 69 70 OutputStream _outputStream; 71 72 public FastInfosetResult(OutputStream outputStream) { 73 _outputStream = outputStream; 74 } 75 76 public ContentHandler getHandler() { 77 ContentHandler handler = super.getHandler(); 78 if (handler == null) { 79 handler = new SAXDocumentSerializer(); 80 setHandler(handler); 81 } 82 ((SAXDocumentSerializer) handler).setOutputStream(_outputStream); 83 return handler; 84 } 85 86 public LexicalHandler getLexicalHandler() { 87 return (LexicalHandler ) getHandler(); 88 } 89 90 public OutputStream getOutputStream() { 91 return _outputStream; 92 } 93 94 public void setOutputStream(OutputStream outputStream) { 95 _outputStream = outputStream; 96 } 97 } 98 | Popular Tags |