|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pz.platypus.plugin.pdf.Start
public class Start
Main line for PDF plugin. Error-handling convention: Output plugins handle all their own errors. Platypus is made aware of a problem only by the value returned from calling process(). However, it does not issue any user message(s) as a result of this.
Field Summary | |
---|---|
private PdfCommandTable |
commandTable
the command table indexed by command root |
private PdfOutfile |
outfile
the outputfile we write to |
private PdfData |
pdfData
contains state data for the pdf file |
Constructor Summary | |
---|---|
Start()
Start() is always called first by Platypus, followed by a call to process() Any plugin initialization code should go in here. |
|
Start(PdfOutfile newOutfile,
PdfCommandTable newCommandTable)
Constructor that is only ever used in unit testing |
Method Summary | |
---|---|
private void |
errMsgUnrecognizedCommand(Token tok,
GDD gdd)
Output error message to logger for unrecognized command |
(package private) boolean |
isNextTokenCr(int currTokNumber,
TokenList tokList)
Determines if the next token in the token list is the command [cr] |
void |
process(GDD gdd,
CommandLineArgs clArgs)
This is the main line of the plug-in. |
(package private) int |
processCommand(Token tok,
PdfData pdfData,
int tokNum)
Principal method for implementing command tokens |
(package private) int |
processCompoundCommand(GDD gdd,
int startTokNumber)
Handle compount commands. |
(package private) void |
processMacro(GDD gdd,
Token tok,
int tokNum)
Look up the macro and insert a new token with the text right after the present token |
(package private) void |
processSymbol(java.lang.String filename,
Token tok,
int tokNum,
PdfData pdd)
Process a symbol or foreign character |
(package private) void |
processText(GDD gdd,
java.lang.String filename,
java.lang.String text)
Process a token consisting of a text item |
void |
processTokens(PdfData pdfData,
java.lang.String outfileName)
Where the token stream is translated into text and actions. |
(package private) void |
setUpDataItems(GDD gdd)
set up various data items needed in processing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private PdfData pdfData
private PdfOutfile outfile
private PdfCommandTable commandTable
Constructor Detail |
---|
public Start()
public Start(PdfOutfile newOutfile, PdfCommandTable newCommandTable)
newOutfile
- the outfile for this PDFnewCommandTable
- command table for this PDFMethod Detail |
---|
public void process(GDD gdd, CommandLineArgs clArgs)
process
in interface IPlugin
gdd
- The Global Document DataclArgs
- command-line arguments in a hash map (key = argument, value = parameters)void setUpDataItems(GDD gdd)
gdd
- the GDDpublic void processTokens(PdfData pdfData, java.lang.String outfileName) throws java.io.IOException
pdfData
- state info about the PDF fileoutfileName
- the file being written to
java.io.IOException
- in the event the file can't be written toboolean isNextTokenCr(int currTokNumber, TokenList tokList)
currTokNumber
- the number of the current tokentokList
- the list of tokens
int processCommand(Token tok, PdfData pdfData, int tokNum)
tok
- command token to processpdfData
- document state datatokNum
- the number of the token in the token list
private void errMsgUnrecognizedCommand(Token tok, GDD gdd)
tok
- the command tokengdd
- the GDDint processCompoundCommand(GDD gdd, int startTokNumber)
gdd
- the GDDstartTokNumber
- the number of the opening token in the compound command
void processMacro(GDD gdd, Token tok, int tokNum)
gdd
- GDD datatok
- current token (the macro)tokNum
- the number of the current tokenvoid processSymbol(java.lang.String filename, Token tok, int tokNum, PdfData pdd) throws java.io.IOException
filename
- name of the output file (in the event the output file is not open yet)tok
- the Token containing the symbol infotokNum
- the number of the tokenpdd
- the PDF document data
java.io.IOException
- if any error occurredvoid processText(GDD gdd, java.lang.String filename, java.lang.String text) throws java.io.IOException
gdd
- the GDDfilename
- name of the output file (in the event the output file is not open yettext
- the text to output
java.io.IOException
- if any error occurred
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |