Class XmlToXXX

  • Direct Known Subclasses:
    XmlToHtml, XmlToPdf, XmlToRtf

    public abstract class XmlToXXX
    extends java.lang.Object
    Generates an specific file from an iText XML file.
    Version:
    1.0
    Author:
    Matt Benson
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Rectangle pageSize  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        XmlToXXX()
      Construct an XmlToXXX with the default page size.
      private XmlToXXX​(Rectangle pageSize)  
        XmlToXXX​(java.lang.String pageSize)
      Construct an XmlToXXX with the specified page size.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void addWriter​(Document doc, java.io.OutputStream out)
      Add a DocWriter for the specified Document and OutputStream.
      private static Rectangle getPageSize​(java.lang.String pageSize)  
      void parse​(java.io.InputStream in, java.io.OutputStream out)
      Parse the XML from the specified InputStream, writing to the specified OutputStream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XmlToXXX

        public XmlToXXX()
        Construct an XmlToXXX with the default page size.
      • XmlToXXX

        public XmlToXXX​(java.lang.String pageSize)
        Construct an XmlToXXX with the specified page size.
        Parameters:
        pageSize - String page size name from com.lowagie.text.PageSize.
      • XmlToXXX

        private XmlToXXX​(Rectangle pageSize)
    • Method Detail

      • parse

        public final void parse​(java.io.InputStream in,
                                java.io.OutputStream out)
                         throws DocumentException
        Parse the XML from the specified InputStream, writing to the specified OutputStream.
        Parameters:
        in - the InputStream from which the XML is read.
        out - the OutputStream to which the result is written.
        Throws:
        DocumentException - if document errors occur.
      • getPageSize

        private static Rectangle getPageSize​(java.lang.String pageSize)
      • addWriter

        protected abstract void addWriter​(Document doc,
                                          java.io.OutputStream out)
                                   throws DocumentException
        Add a DocWriter for the specified Document and OutputStream.
        Parameters:
        doc - The document to which content will be added
        out - The outputstream to which the document will be sent
        Throws:
        DocumentException - if document errors occur.