org.enhydra.barracuda.core.util.dom
Class CommaSeparatedDOMWriter

java.lang.Object
  extended byorg.enhydra.barracuda.core.util.dom.CommaSeparatedDOMWriter
All Implemented Interfaces:
DOMWriter

public class CommaSeparatedDOMWriter
extends Object
implements DOMWriter

Since:
saw_082603_2
Author:
shawnw@atmreports.com

Field Summary
protected  String contentDisposition
           
protected  String contentType
           
static String DOCUMENT_TYPE
           
static String ELEMENT_COLUMN
           
static String ELEMENT_HEADER
           
static String ELEMENT_ROW
           
protected  boolean leaveWriterOpen
           
protected  int maxAge
           
protected  boolean preventCaching
           
 
Constructor Summary
CommaSeparatedDOMWriter()
          Create a new CommaSeparatedDOMWriter using the default values.
CommaSeparatedDOMWriter(String icontentType, String icontentDisposition)
          Create a new CommaSeparatedDOMWriter with the supplied values.
 
Method Summary
 String getContentDisposition()
          Get the content disposition
 String getContentType()
          Get the content type
 boolean getLeaveWriterOpen()
          Return true if the writer is configured to leave the output stream open
 void prepareResponse(javax.servlet.http.HttpServletResponse resp)
          Prepare the response object
 void setContentDisposition(String icontentDisposition)
          Set the content disposition (ie.
 void setContentType(String icontentType)
          Set the content type (defaults to "text/html" or "text/xml" depending on the document type
 void setLeaveWriterOpen(boolean val)
          Set whether or not to leave the writer open after writing
 void write(Node node, javax.servlet.http.HttpServletResponse resp)
          Write a DOM to a ServletResponse object.
 void write(Node node, OutputStream out)
          Write a DOM to an OutputStream.
 void write(Node node, Writer writer)
          Write a DOM to a Writer.
protected  void writeAll(NodeList nodes, Writer writer)
           
protected  void writeAll(Node node, Writer writer)
           
protected  void writeColumn(NodeList nodes, Writer writer)
           
protected  void writeHeader(NodeList nodes, Writer writer)
           
protected  void writeRow(NodeList nodes, Writer writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCUMENT_TYPE

public static final String DOCUMENT_TYPE
See Also:
Constant Field Values

ELEMENT_ROW

public static final String ELEMENT_ROW
See Also:
Constant Field Values

ELEMENT_HEADER

public static final String ELEMENT_HEADER
See Also:
Constant Field Values

ELEMENT_COLUMN

public static final String ELEMENT_COLUMN
See Also:
Constant Field Values

contentType

protected String contentType

contentDisposition

protected String contentDisposition

preventCaching

protected boolean preventCaching

leaveWriterOpen

protected boolean leaveWriterOpen

maxAge

protected int maxAge
Constructor Detail

CommaSeparatedDOMWriter

public CommaSeparatedDOMWriter()
Create a new CommaSeparatedDOMWriter using the default values. The default content type is "text/plain". The default content disposition is to use none;


CommaSeparatedDOMWriter

public CommaSeparatedDOMWriter(String icontentType,
                               String icontentDisposition)
Create a new CommaSeparatedDOMWriter with the supplied values.

Parameters:
icontentType - The content type to use
icontentDisposition - The content disposition to use
Method Detail

setContentType

public void setContentType(String icontentType)
Set the content type (defaults to "text/html" or "text/xml" depending on the document type


getContentType

public String getContentType()
Get the content type


setContentDisposition

public void setContentDisposition(String icontentDisposition)
Set the content disposition (ie. "inline; filename=foo.txt", defaults to null)


getContentDisposition

public String getContentDisposition()
Get the content disposition


setLeaveWriterOpen

public void setLeaveWriterOpen(boolean val)
Set whether or not to leave the writer open after writing

Specified by:
setLeaveWriterOpen in interface DOMWriter

getLeaveWriterOpen

public boolean getLeaveWriterOpen()
Return true if the writer is configured to leave the output stream open

Specified by:
getLeaveWriterOpen in interface DOMWriter

prepareResponse

public void prepareResponse(javax.servlet.http.HttpServletResponse resp)
                     throws IOException
Prepare the response object

Specified by:
prepareResponse in interface DOMWriter
Parameters:
resp - the HttpServletResponse object
Throws:
IOException

write

public void write(Node node,
                  javax.servlet.http.HttpServletResponse resp)
           throws IOException
Write a DOM to a ServletResponse object. This method will automatically set the content type for you.

Specified by:
write in interface DOMWriter
Parameters:
node - The DOM node to be written out
resp - The HttpServletResponse object to write to
Throws:
IOException

write

public void write(Node node,
                  OutputStream out)
           throws IOException
Write a DOM to an OutputStream.

Specified by:
write in interface DOMWriter
Parameters:
node - The DOM node to be written out
out - The OutputStream to be written to
Throws:
IOException

write

public void write(Node node,
                  Writer writer)
           throws IOException
Write a DOM to a Writer.

Specified by:
write in interface DOMWriter
Parameters:
node - The DOM node to be written out
writer - The writer to be written to
Throws:
IOException

writeAll

protected void writeAll(Node node,
                        Writer writer)
                 throws IOException,
                        DOMException
Throws:
IOException
DOMException

writeAll

protected void writeAll(NodeList nodes,
                        Writer writer)
                 throws IOException,
                        DOMException
Throws:
IOException
DOMException

writeRow

protected void writeRow(NodeList nodes,
                        Writer writer)
                 throws IOException,
                        DOMException
Throws:
IOException
DOMException

writeHeader

protected void writeHeader(NodeList nodes,
                           Writer writer)
                    throws IOException,
                           DOMException
Throws:
IOException
DOMException

writeColumn

protected void writeColumn(NodeList nodes,
                           Writer writer)
                    throws IOException,
                           DOMException
Throws:
IOException
DOMException


Copyright © 2003 BarracudaMVC.org All Rights Reserved.