org.pz.platypus.commands
Class CodeWithOptions

java.lang.Object
  extended by org.pz.platypus.commands.CodeWithOptions
Direct Known Subclasses:
PdfCodeWithOptions

public abstract class CodeWithOptions
extends java.lang.Object

Abstract class for handling code listing.

Author:
alb

Field Summary
protected  java.lang.String[] params
          command parameters: starting line#, which line #s to print
protected  java.lang.String root
           
protected  java.lang.String tokenParam
          the parameter data for the token
 
Constructor Summary
CodeWithOptions()
           
 
Method Summary
 java.lang.String getRoot()
           
private  void invalidParameterErrMessage(GDD gdd, Source source)
           
private  void invalidSkipLineNumberErrMessage(GDD gdd, Source source)
           
private  void invalidStartingLineNumberErrMessage(GDD gdd, Source source)
           
protected  int parseSkipLineNumber(java.lang.String num, GDD gdd, Source source)
          Extracts the line numbers on which to print line numbers in the listings.
protected  int parseStartingLineNumber(java.lang.String num, GDD gdd, Source source)
          Extracts the starting line number from the passed parameters.
protected  int preProcess(IOutputContext context, Token tok, int tokNum)
          Basic command housekeeing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

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

tokenParam

protected java.lang.String tokenParam
the parameter data for the token


params

protected java.lang.String[] params
command parameters: starting line#, which line #s to print

Constructor Detail

CodeWithOptions

public CodeWithOptions()
Method Detail

preProcess

protected int preProcess(IOutputContext context,
                         Token tok,
                         int tokNum)
Basic command housekeeing.

Parameters:
context - the document data container
tok - the token and parameters
tokNum - the token number
Returns:
Returns 0 if we're done, 1 if we keep going.

parseSkipLineNumber

protected int parseSkipLineNumber(java.lang.String num,
                                  GDD gdd,
                                  Source source)
Extracts the line numbers on which to print line numbers in the listings.

Parameters:
num - the passed parameter, as a string
gdd - Global document data (used primarily for accessing literals engine)
source - where the parameter was specified
Returns:
the starting line number. In case of error, set to 1 (line numbers on every line).

parseStartingLineNumber

protected int parseStartingLineNumber(java.lang.String num,
                                      GDD gdd,
                                      Source source)
Extracts the starting line number from the passed parameters.

Parameters:
num - the passed parameter, as a string
gdd - Global document data (used primarily for accessing literals engine)
source - where the parameter was specified
Returns:
the starting line number. If == 0, means: continue from previous listing line numbers.

invalidSkipLineNumberErrMessage

private void invalidSkipLineNumberErrMessage(GDD gdd,
                                             Source source)

invalidStartingLineNumberErrMessage

private void invalidStartingLineNumberErrMessage(GDD gdd,
                                                 Source source)

invalidParameterErrMessage

private void invalidParameterErrMessage(GDD gdd,
                                        Source source)

getRoot

public java.lang.String getRoot()


Copyright © 2008-10 Pacific Data Works LLC