fr.opensagres.xdocreport.document.textstyling
Class AbstractDocumentHandler

java.lang.Object
  extended by java.io.Writer
      extended by fr.opensagres.xdocreport.document.textstyling.AbstractDocumentHandler
All Implemented Interfaces:
IDocumentHandler, ITransformResult, Closeable, Flushable, Appendable
Direct Known Subclasses:
DocxDocumentHandler, ODTDocumentHandler

public abstract class AbstractDocumentHandler
extends Writer
implements IDocumentHandler

Abstract class for document handler IDocumentHandler.


Nested Class Summary
 
Nested classes/interfaces inherited from interface fr.opensagres.xdocreport.document.textstyling.IDocumentHandler
IDocumentHandler.TextLocation
 
Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Fields inherited from interface fr.opensagres.xdocreport.document.textstyling.ITransformResult
TEXT_BEFORE_PROPERTY, TEXT_BODY_PROPERTY, TEXT_END_PROPERTY
 
Constructor Summary
AbstractDocumentHandler(BufferedElement parent, IContext context, String entryName)
           
 
Method Summary
 void close()
           
protected abstract  void doEndOrderedList()
           
protected abstract  void doEndTable(TableProperties properties)
           
protected abstract  void doEndTableCell()
           
protected abstract  void doEndTableRow()
           
protected abstract  void doEndUnorderedList()
           
protected abstract  void doStartOrderedList(ListProperties properties)
           
protected abstract  void doStartTable(TableProperties properties)
           
protected abstract  void doStartTableCell(TableCellProperties properties)
           
protected abstract  void doStartTableRow(TableRowProperties properties)
           
protected abstract  void doStartUnorderedList(ListProperties properties)
           
 void endOrderedList()
          End ordered list.
 void endTable()
          End table.
 void endTableCell()
          End table cell.
 void endTableRow()
          End table row.
 void endUnorderedList()
          End unordered list.
 void flush()
           
 IContext getContext()
           
protected  int getCurrentListIndex()
           
protected  boolean getCurrentListOrder()
           
 Writer getCurrentWriter()
           
 String getEntryName()
           
 BufferedElement getParent()
           
 String getTextBefore()
           
 String getTextBody()
           
 String getTextEnd()
           
 void handleString(String s)
          Text content.
 void popTempWriter(String before)
           
 void pushTempWriter()
           
 void setTextLocation(IDocumentHandler.TextLocation location)
           
 void startOrderedList(ListProperties properties)
          Start ordered list.
 void startTable(TableProperties properties)
          Start table.
 void startTableCell(TableCellProperties properties)
          Start table cell.
 void startTableRow(TableRowProperties properties)
          Start table row.
 void startUnorderedList(ListProperties properties)
          Start unordered list.
 String toString()
           
 void write(char[] arg0, int arg1, int arg2)
           
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fr.opensagres.xdocreport.document.textstyling.IDocumentHandler
endBold, endDocument, endHeading, endItalics, endListItem, endParagraph, endSpan, endStrike, endSubscript, endSuperscript, endUnderline, handleImage, handleLineBreak, handleReference, startBold, startDocument, startHeading, startItalics, startListItem, startParagraph, startSpan, startStrike, startSubscript, startSuperscript, startUnderline
 

Constructor Detail

AbstractDocumentHandler

public AbstractDocumentHandler(BufferedElement parent,
                               IContext context,
                               String entryName)
Method Detail

handleString

public void handleString(String s)
                  throws IOException
Description copied from interface: IDocumentHandler
Text content.

Specified by:
handleString in interface IDocumentHandler
Throws:
IOException

startOrderedList

public final void startOrderedList(ListProperties properties)
                            throws IOException
Description copied from interface: IDocumentHandler
Start ordered list.

Specified by:
startOrderedList in interface IDocumentHandler
Throws:
IOException

endOrderedList

public final void endOrderedList()
                          throws IOException
Description copied from interface: IDocumentHandler
End ordered list.

Specified by:
endOrderedList in interface IDocumentHandler
Throws:
IOException

startUnorderedList

public final void startUnorderedList(ListProperties properties)
                              throws IOException
Description copied from interface: IDocumentHandler
Start unordered list.

Specified by:
startUnorderedList in interface IDocumentHandler
Throws:
IOException

endUnorderedList

public final void endUnorderedList()
                            throws IOException
Description copied from interface: IDocumentHandler
End unordered list.

Specified by:
endUnorderedList in interface IDocumentHandler
Throws:
IOException

getCurrentListOrder

protected boolean getCurrentListOrder()

getCurrentListIndex

protected int getCurrentListIndex()

startTable

public final void startTable(TableProperties properties)
                      throws IOException
Description copied from interface: IDocumentHandler
Start table.

Specified by:
startTable in interface IDocumentHandler
Throws:
IOException

endTable

public final void endTable()
                    throws IOException
Description copied from interface: IDocumentHandler
End table.

Specified by:
endTable in interface IDocumentHandler
Throws:
IOException

startTableRow

public final void startTableRow(TableRowProperties properties)
                         throws IOException
Description copied from interface: IDocumentHandler
Start table row.

Specified by:
startTableRow in interface IDocumentHandler
Parameters:
properties - table row properties.
Throws:
IOException

endTableRow

public final void endTableRow()
                       throws IOException
Description copied from interface: IDocumentHandler
End table row.

Specified by:
endTableRow in interface IDocumentHandler
Throws:
IOException

startTableCell

public final void startTableCell(TableCellProperties properties)
                          throws IOException
Description copied from interface: IDocumentHandler
Start table cell.

Specified by:
startTableCell in interface IDocumentHandler
Parameters:
properties - table cell propertie.
Throws:
IOException

endTableCell

public final void endTableCell()
                        throws IOException
Description copied from interface: IDocumentHandler
End table cell.

Specified by:
endTableCell in interface IDocumentHandler
Throws:
IOException

getParent

public BufferedElement getParent()

getContext

public IContext getContext()

getTextBefore

public String getTextBefore()
Specified by:
getTextBefore in interface ITransformResult

getTextBody

public String getTextBody()
Specified by:
getTextBody in interface ITransformResult

getTextEnd

public String getTextEnd()
Specified by:
getTextEnd in interface ITransformResult

setTextLocation

public void setTextLocation(IDocumentHandler.TextLocation location)

pushTempWriter

public void pushTempWriter()

popTempWriter

public void popTempWriter(String before)
                   throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class Writer
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Specified by:
flush in class Writer
Throws:
IOException

write

public void write(char[] arg0,
                  int arg1,
                  int arg2)
           throws IOException
Specified by:
write in class Writer
Throws:
IOException

getCurrentWriter

public Writer getCurrentWriter()

getEntryName

public String getEntryName()

toString

public String toString()
Overrides:
toString in class Object

doStartUnorderedList

protected abstract void doStartUnorderedList(ListProperties properties)
                                      throws IOException
Throws:
IOException

doStartOrderedList

protected abstract void doStartOrderedList(ListProperties properties)
                                    throws IOException
Throws:
IOException

doEndUnorderedList

protected abstract void doEndUnorderedList()
                                    throws IOException
Throws:
IOException

doEndOrderedList

protected abstract void doEndOrderedList()
                                  throws IOException
Throws:
IOException

doStartTable

protected abstract void doStartTable(TableProperties properties)
                              throws IOException
Throws:
IOException

doEndTable

protected abstract void doEndTable(TableProperties properties)
                            throws IOException
Throws:
IOException

doStartTableRow

protected abstract void doStartTableRow(TableRowProperties properties)
                                 throws IOException
Throws:
IOException

doEndTableRow

protected abstract void doEndTableRow()
                               throws IOException
Throws:
IOException

doStartTableCell

protected abstract void doStartTableCell(TableCellProperties properties)
                                  throws IOException
Throws:
IOException

doEndTableCell

protected abstract void doEndTableCell()
                                throws IOException
Throws:
IOException


Copyright © 2013. All rights reserved.