|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.ConsoleObject
adams.core.option.AbstractOptionHandler
adams.core.io.AbstractPdfProclet
public abstract class AbstractPdfProclet
Abstract ancestor for processors that add the content of files to a PDF
document. Derived classes only require to implement the
doProcess(Document,File) method.
| Nested Class Summary | |
|---|---|
static class |
AbstractPdfProclet.DocumentState
Container class for storing state information about the document currently being processed. |
| Field Summary | |
|---|---|
protected boolean |
m_AddFilename
add the filename as header. |
protected Color |
m_ColorFilename
the color for the filename header. |
protected PdfFont |
m_FontFilename
the font for the filename header. |
protected int |
m_NumFilesPerPage
the number of files per page. |
protected boolean |
m_PageBreakAfter
whether to add a page-break after adding the file. |
protected boolean |
m_PageBreakBefore
whether to add a page-break before adding the file. |
static String |
MATCH_ALL_EXTENSION
the "match-all" file extension. |
| Fields inherited from class adams.core.option.AbstractOptionHandler |
|---|
m_DebugLevel, m_OptionManager |
| Constructor Summary | |
|---|---|
AbstractPdfProclet()
|
|
| Method Summary | |
|---|---|
protected boolean |
addFilename(com.itextpdf.text.Document doc,
AbstractPdfProclet.DocumentState state,
File file)
Adds the filename to the page as header, if necessary. |
String |
addFilenameTipText()
Returns the tip text for this property. |
boolean |
canProcess(AbstractPdfProclet.DocumentState state,
File file)
Whether the processor can handle this particular file. |
String |
colorFilenameTipText()
Returns the tip text for this property. |
void |
defineOptions()
Adds options to the internal list of options. |
protected abstract boolean |
doProcess(com.itextpdf.text.Document doc,
AbstractPdfProclet.DocumentState state,
File file)
The actual processing of the document. |
String |
fontFilenameTipText()
Returns the tip text for this property. |
boolean |
getAddFilename()
Returns whether to output the filename as well. |
Color |
getColorFilename()
Returns the color to use for adding the filename header. |
abstract BaseString[] |
getExtensions()
Returns the extensions that the processor can process. |
PdfFont |
getFontFilename()
Returns the font to use for adding the filename header. |
int |
getNumFilesPerPage()
Returns the number of files to put on a single page. |
boolean |
getPageBreakAfter()
Returns whether a page break is added after the file is inserted. |
boolean |
getPageBreakBefore()
Returns whether a page break is added before the file is inserted. |
String |
numFilesPerPageTipText()
Returns the tip text for this property. |
String |
pageBreakAfterTipText()
Returns the tip text for this property. |
String |
pageBreakBeforeTipText()
Returns the tip text for this property. |
protected boolean |
postProcess(com.itextpdf.text.Document doc,
AbstractPdfProclet.DocumentState state,
File file)
For post-processing the document. |
protected boolean |
preProcess(com.itextpdf.text.Document doc,
AbstractPdfProclet.DocumentState state,
File file)
For pre-processing the document. |
boolean |
process(com.itextpdf.text.Document doc,
AbstractPdfProclet.DocumentState state,
File file)
Processes the given file. |
void |
setAddFilename(boolean value)
Sets whether to output the filename as well. |
void |
setColorFilename(Color value)
Sets the color to use for adding the filename header. |
void |
setFontFilename(PdfFont value)
Sets the font to use for adding the filename header. |
void |
setNumFilesPerPage(int value)
Sets the number of files per page. |
void |
setPageBreakAfter(boolean value)
Whether to add a page break after the file is inserted. |
void |
setPageBreakBefore(boolean value)
Whether to add a page break before the file is inserted. |
| Methods inherited from class adams.core.option.AbstractOptionHandler |
|---|
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, globalInfo, initialize, isDebugOn, newOptionManager, reset, setDebugLevel, toCommandLine, toString |
| Methods inherited from class adams.core.ConsoleObject |
|---|
getDebugging, getSystemErr, getSystemOut, sizeOf |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String MATCH_ALL_EXTENSION
protected boolean m_PageBreakBefore
protected boolean m_PageBreakAfter
protected int m_NumFilesPerPage
protected boolean m_AddFilename
protected PdfFont m_FontFilename
protected Color m_ColorFilename
| Constructor Detail |
|---|
public AbstractPdfProclet()
| Method Detail |
|---|
public void defineOptions()
defineOptions in interface OptionHandlerdefineOptions in class AbstractOptionHandlerpublic abstract BaseString[] getExtensions()
public void setPageBreakBefore(boolean value)
value - if true then a page-break is added before the file
is insertedpublic boolean getPageBreakBefore()
public String pageBreakBeforeTipText()
public void setPageBreakAfter(boolean value)
value - if true then a page-break is added after the file
is insertedpublic boolean getPageBreakAfter()
public String pageBreakAfterTipText()
public void setNumFilesPerPage(int value)
value - the number of filespublic int getNumFilesPerPage()
public String numFilesPerPageTipText()
public void setAddFilename(boolean value)
value - if true then the filename gets added as wellpublic boolean getAddFilename()
public String addFilenameTipText()
public void setFontFilename(PdfFont value)
value - the fontpublic PdfFont getFontFilename()
public String fontFilenameTipText()
public void setColorFilename(Color value)
value - the colorpublic Color getColorFilename()
public String colorFilenameTipText()
protected boolean addFilename(com.itextpdf.text.Document doc,
AbstractPdfProclet.DocumentState state,
File file)
throws Exception
doc - the document to processstate - the current document statefile - the plain text file
Exception - if something goes wrong
protected boolean preProcess(com.itextpdf.text.Document doc,
AbstractPdfProclet.DocumentState state,
File file)
throws Exception
doc - the PDF document to add the file content tostate - the current document statefile - the file to add
Exception - if something goes wrong
protected abstract boolean doProcess(com.itextpdf.text.Document doc,
AbstractPdfProclet.DocumentState state,
File file)
throws Exception
doc - the PDF document to add the file content tostate - the current document statefile - the file to add
Exception - if something goes wrong
protected boolean postProcess(com.itextpdf.text.Document doc,
AbstractPdfProclet.DocumentState state,
File file)
throws Exception
doc - the PDF document to add the file content tostate - the current document statefile - the file to add
Exception - if something goes wrong
public boolean canProcess(AbstractPdfProclet.DocumentState state,
File file)
state - the document statefile - the file to check
public boolean process(com.itextpdf.text.Document doc,
AbstractPdfProclet.DocumentState state,
File file)
doc - the PDF document to add the file content tostate - the current document statefile - the file to add
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||