org.pz.platypus.commands
Class UrlWithCoverText

java.lang.Object
  extended by org.pz.platypus.commands.UrlWithCoverText
All Implemented Interfaces:
IOutputCommand
Direct Known Subclasses:
PdfUrlWithCoverText

public abstract class UrlWithCoverText
extends java.lang.Object
implements IOutputCommand

Abstract portion of command for URL with cover text

Author:
alb

Field Summary
private  java.lang.String root
           
private  int tokensToSkip
          how many tokens do we consume reading the cover text? Should generally be 2.
 
Constructor Summary
UrlWithCoverText()
           
 
Method Summary
(package private)  java.lang.String getCoverText(IOutputContext context, int startingNum)
          Go down the list of tokens looking for text and a [-url] token pair.
 java.lang.String getRoot()
          get the root of the command.
protected abstract  void outputUrl(IOutputContext context, java.lang.String url, java.lang.String coverText)
           
 int process(IOutputContext context, Token tok, int tokNum)
          method for processing this command in the output plugin.
private  void showNoCoverTextlErrorMsg(Token tok, IOutputContext context)
           
private  void showNullUrlErrorMsg(Token tok, IOutputContext context)
          Show error message, giving location in Platypus input file
private  void showUnclosedUrlCoverTextErrorMsg(Token tok, GDD gdd)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

private final java.lang.String root
See Also:
Constant Field Values

tokensToSkip

private int tokensToSkip
how many tokens do we consume reading the cover text? Should generally be 2.

Constructor Detail

UrlWithCoverText

public UrlWithCoverText()
Method Detail

outputUrl

protected abstract void outputUrl(IOutputContext context,
                                  java.lang.String url,
                                  java.lang.String coverText)

process

public int process(IOutputContext context,
                   Token tok,
                   int tokNum)
Description copied from interface: IOutputCommand
method for processing this command in the output plugin.

Specified by:
process in interface IOutputCommand
Parameters:
context - the context/state of the output document
tok - the command token as found in the token stream
tokNum - the number of the token in the token list

getCoverText

java.lang.String getCoverText(IOutputContext context,
                              int startingNum)
Go down the list of tokens looking for text and a [-url] token pair. These are the cover text. If you find anything else, issue a warning and handle the error.

Parameters:
context - the PDF document data
startingNum - the number of the current token in the list
Returns:
a string containing the cover text

getRoot

public java.lang.String getRoot()
Description copied from interface: IOutputCommand
get the root of the command. For example, fsize: in [fsize:12pt]

Specified by:
getRoot in interface IOutputCommand
Returns:
the root as a string

showNullUrlErrorMsg

private void showNullUrlErrorMsg(Token tok,
                                 IOutputContext context)
Show error message, giving location in Platypus input file

Parameters:
tok - contains the location data
context - contains the location of the logger and literals file

showNoCoverTextlErrorMsg

private void showNoCoverTextlErrorMsg(Token tok,
                                      IOutputContext context)

showUnclosedUrlCoverTextErrorMsg

private void showUnclosedUrlCoverTextErrorMsg(Token tok,
                                              GDD gdd)


Copyright © 2008-10 Pacific Data Works LLC