com.itextpdf.tool.itextdoc.site
Class SiteWriter

java.lang.Object
  extended by com.itextpdf.tool.itextdoc.site.SiteWriter

@Experimental
public class SiteWriter
extends Object

Author:
redlab_b http://www.redlab.be/

Constructor Summary
SiteWriter()
           
 
Method Summary
 SiteWriter write(OutputStream out, String str)
           
 SiteWriter writeBodyClose(OutputStream out)
           
 SiteWriter writeContent(OutputStream out, InputStream in)
           
 SiteWriter writeDivContent(OutputStream out, InputStream in, String wrapId)
           
 SiteWriter writeHeadCloseBodyOpen(OutputStream out)
           
 SiteWriter writeHeadOpen(OutputStream out, String encoding)
          Writes something like <?
 SiteWriter writeLF(OutputStream out)
          Writes a linefeed/carriage return
 SiteWriter writeScript(OutputStream out, String src)
           
 SiteWriter writeStyleLink(OutputStream out, String href)
           
 SiteWriter writeTitle(OutputStream out, String title)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteWriter

public SiteWriter()
Method Detail

writeHeadOpen

public SiteWriter writeHeadOpen(OutputStream out,
                                String encoding)
                         throws IOException
Writes something like
 <?xml version="1.0" encoding="ISO-8859-1" ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
 

Parameters:
out - the OutputStream to write to.
encoding - the encoding to use
Returns:
this the instance of SiteWriter
Throws:
IOException - if something could not be written

writeTitle

public SiteWriter writeTitle(OutputStream out,
                             String title)
                      throws IOException
Parameters:
out - the OutputStream to write to.
title - the title of the site
Returns:
this this instance of XMLWorker
Throws:
IOException - if something could not be written

writeLF

public SiteWriter writeLF(OutputStream out)
                   throws IOException
Writes a linefeed/carriage return

Parameters:
out - the OutputStream to write to.
Returns:
this this instance of XMLWorker
Throws:
IOException - if something could not be written

write

public SiteWriter write(OutputStream out,
                        String str)
                 throws IOException
Parameters:
out - the OutputStream to write to.
str - the String to write
Returns:
this this instance of XMLWorker
Throws:
IOException - if something could not be written

writeScript

public SiteWriter writeScript(OutputStream out,
                              String src)
                       throws IOException
Parameters:
out - the OutputStream to write to.
src - the link to the JavaScript file
Returns:
this this instance of XMLWorker
Throws:
IOException - if something could not be written

writeStyleLink

public SiteWriter writeStyleLink(OutputStream out,
                                 String href)
                          throws IOException
Parameters:
out - the OutputStream to write to.
href - the link to the stylesheet file
Returns:
this this instance of XMLWorker
Throws:
IOException - if something could not be written

writeHeadCloseBodyOpen

public SiteWriter writeHeadCloseBodyOpen(OutputStream out)
                                  throws IOException
Parameters:
out - the OutputStream to write to.
Returns:
this this instance of XMLWorker
Throws:
IOException - if something could not be written

writeDivContent

public SiteWriter writeDivContent(OutputStream out,
                                  InputStream in,
                                  String wrapId)
                           throws IOException
Parameters:
out - the OutputStream to write to.
in - content
wrapId - the id of the div used for wrapping, if null, no wrapping is done
Returns:
this this instance of XMLWorker
Throws:
IOException - if something could not be written

writeContent

public SiteWriter writeContent(OutputStream out,
                               InputStream in)
                        throws IOException
Parameters:
out - the OutputStream to write to.
in - the InputStream to read content from, it's closed after use.
Returns:
this this instance of XMLWorker
Throws:
IOException - if something could not be written

writeBodyClose

public SiteWriter writeBodyClose(OutputStream out)
                          throws IOException
Parameters:
out - the OutputStream to write to.
Returns:
this this instance of XMLWorker
Throws:
IOException - if something could not be written


Copyright © 2011 1T3XT BVBA. All Rights Reserved.