org.apache.fop.cli

Class CommandLineOptions


public class CommandLineOptions
extends java.lang.Object

Options parses the commandline arguments

Field Summary

static int
AREATREE_INPUT
input: Area Tree XML file
static int
FO_INPUT
input: fo file
static int
IMAGE_INPUT
input: Image file
static int
NOT_SET
(input) not set
static int
RENDER_NONE
Used to indicate that only the result of the XSL transformation should be output
static int
XSLT_INPUT
input: xml+xsl file

Constructor Summary

CommandLineOptions()
Construct a command line option object.

Method Summary

File
getFOFile()
Returns the XSL-FO file if set.
protected FOUserAgent
getFOUserAgent()
Get the FOUserAgent for this Command-Line run
File
getInputFile()
Returns the input file.
InputHandler
getInputHandler()
Log
getLogger()
Get the logger.
File
getOutputFile()
Returns the output file
protected String
getOutputFormat()
File
getUserConfigFile()
Returns the user configuration file to be used.
File
getXMLFile()
Returns the input XML file if set.
File
getXSLFile()
Returns the stylesheet to be used for transformation to XSL-FO.
Boolean
isCoarseAreaXml()
Indicates whether the XML renderer should generate coarse area XML
void
parse(String[] args)
Parse the command line arguments.
static void
printUsage()
shows the commandline syntax including a summary of all available options and some examples

Field Details

AREATREE_INPUT

public static final int AREATREE_INPUT
input: Area Tree XML file
Field Value:
3

FO_INPUT

public static final int FO_INPUT
input: fo file
Field Value:
1

IMAGE_INPUT

public static final int IMAGE_INPUT
input: Image file
Field Value:
4

NOT_SET

public static final int NOT_SET
(input) not set
Field Value:
0

RENDER_NONE

public static final int RENDER_NONE
Used to indicate that only the result of the XSL transformation should be output
Field Value:
-1

XSLT_INPUT

public static final int XSLT_INPUT
input: xml+xsl file
Field Value:
2

Constructor Details

CommandLineOptions

public CommandLineOptions()
Construct a command line option object.

Method Details

getFOFile

public File getFOFile()
Returns the XSL-FO file if set.
Returns:
the XSL-FO file, null if not set

getFOUserAgent

protected FOUserAgent getFOUserAgent()
Get the FOUserAgent for this Command-Line run
Returns:
FOUserAgent instance

getInputFile

public File getInputFile()
Returns the input file.
Returns:
either the fofile or the xmlfile

getInputHandler

public InputHandler getInputHandler()
Returns:
the InputHandler instance defined by the command-line options.

getLogger

public Log getLogger()
Get the logger.
Returns:
the logger

getOutputFile

public File getOutputFile()
Returns the output file
Returns:
the output file

getOutputFormat

protected String getOutputFormat()
            throws FOPException
Returns:
the chosen output format (MIME type)
Throws:
FOPException - for invalid output formats

getUserConfigFile

public File getUserConfigFile()
Returns the user configuration file to be used.
Returns:
the userconfig.xml file

getXMLFile

public File getXMLFile()
Returns the input XML file if set.
Returns:
the input XML file, null if not set

getXSLFile

public File getXSLFile()
Returns the stylesheet to be used for transformation to XSL-FO.
Returns:
stylesheet

isCoarseAreaXml

public Boolean isCoarseAreaXml()
Indicates whether the XML renderer should generate coarse area XML
Returns:
true if coarse area XML is desired

parse

public void parse(String[] args)
            throws FOPException,
                   IOException
Parse the command line arguments.
Parameters:
args - the command line arguments.
Throws:
FOPException - for general errors

printUsage

public static void printUsage()
shows the commandline syntax including a summary of all available options and some examples

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.