org.apache.fop.cli

## Class CommandLineOptions

- java.lang.Object
- - org.apache.fop.cli.CommandLineOptions

-     public class CommandLineOptions
      extends java.lang.Object

  Options parses the commandline arguments

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `AREATREE_INPUT` input: Area Tree XML file
    `static int` | `FO_INPUT` input: fo file
    `static int` | `IF_INPUT` input: Intermediate Format XML 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

    Constructors
    Constructor and Description
    `CommandLineOptions()` Construct a command line option object.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.io.File` | `getFOFile()` Returns the XSL-FO file if set.
    `protected FOUserAgent` | `getFOUserAgent()` Get the FOUserAgent for this Command-Line run
    `java.io.File` | `getInputFile()` Returns the input file.
    `InputHandler` | `getInputHandler()`
    `org.apache.commons.logging.Log` | `getLogger()` Get the logger.
    `java.io.File` | `getOutputFile()` Returns the output file
    `protected java.lang.String` | `getOutputFormat()`
    `java.io.File` | `getUserConfigFile()` Returns the user configuration file to be used.
    `java.io.File` | `getXMLFile()` Returns the input XML file if set.
    `java.io.File` | `getXSLFile()` Returns the stylesheet to be used for transformation to XSL-FO.
    `java.lang.Boolean` | `isCoarseAreaXml()` Indicates whether the XML renderer should generate coarse area XML
    `boolean` | `isInputFromStdIn()` Indicates whether input comes from standard input (stdin).
    `boolean` | `isOutputToStdOut()` Indicates whether output is sent to standard output (stdout).
    `boolean` | `parse(java.lang.String[] args)` Parses the command line arguments.
    `static void` | `printUsage(java.io.PrintStream out)` Shows the command line syntax including a summary of all available options and some examples.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### RENDER_NONE

          public static final int RENDER_NONE

      Used to indicate that only the result of the XSL transformation should be output
      See Also:
        Constant Field Values

    - #### NOT_SET

          public static final int NOT_SET

      (input) not set
      See Also:
        Constant Field Values

    - #### FO_INPUT

          public static final int FO_INPUT

      input: fo file
      See Also:
        Constant Field Values

    - #### XSLT_INPUT

          public static final int XSLT_INPUT

      input: xml+xsl file
      See Also:
        Constant Field Values

    - #### AREATREE_INPUT

          public static final int AREATREE_INPUT

      input: Area Tree XML file
      See Also:
        Constant Field Values

    - #### IF_INPUT

          public static final int IF_INPUT

      input: Intermediate Format XML file
      See Also:
        Constant Field Values

    - #### IMAGE_INPUT

          public static final int IMAGE_INPUT

      input: Image file
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CommandLineOptions

          public CommandLineOptions()

      Construct a command line option object.

  - ### Method Detail

    - #### parse

          public boolean parse(java.lang.String[] args)
                        throws FOPException,
                               java.io.IOException

      Parses the command line arguments.
      Parameters:
        `args` - the command line arguments.
      Returns:
        true if the processing can continue, false to abort
      Throws:
        `FOPException` - for general errors
        `java.io.IOException` - if the the configuration file could not be loaded

    - #### getInputHandler

          public InputHandler getInputHandler()

      Returns:
        the InputHandler instance defined by the command-line options.

    - #### getLogger

          public org.apache.commons.logging.Log getLogger()

      Get the logger.
      Returns:
        the logger

    - #### getOutputFormat

          protected java.lang.String getOutputFormat()
                                              throws FOPException

      Returns:
        the chosen output format (MIME type)
      Throws:
        `FOPException` - for invalid output formats

    - #### getFOUserAgent

          protected FOUserAgent getFOUserAgent()

      Get the FOUserAgent for this Command-Line run
      Returns:
        FOUserAgent instance

    - #### getFOFile

          public java.io.File getFOFile()

      Returns the XSL-FO file if set.
      Returns:
        the XSL-FO file, null if not set

    - #### getXMLFile

          public java.io.File getXMLFile()

      Returns the input XML file if set.
      Returns:
        the input XML file, null if not set

    - #### getXSLFile

          public java.io.File getXSLFile()

      Returns the stylesheet to be used for transformation to XSL-FO.
      Returns:
        stylesheet

    - #### getOutputFile

          public java.io.File getOutputFile()

      Returns the output file
      Returns:
        the output file

    - #### getUserConfigFile

          public java.io.File getUserConfigFile()

      Returns the user configuration file to be used.
      Returns:
        the userconfig.xml file

    - #### isCoarseAreaXml

          public java.lang.Boolean isCoarseAreaXml()

      Indicates whether the XML renderer should generate coarse area XML
      Returns:
        true if coarse area XML is desired

    - #### isInputFromStdIn

          public boolean isInputFromStdIn()

      Indicates whether input comes from standard input (stdin).
      Returns:
        true if input comes from standard input (stdin)

    - #### isOutputToStdOut

          public boolean isOutputToStdOut()

      Indicates whether output is sent to standard output (stdout).
      Returns:
        true if output is sent to standard output (stdout)

    - #### getInputFile

          public java.io.File getInputFile()

      Returns the input file.
      Returns:
        either the fofile or the xmlfile

    - #### printUsage

          public static void printUsage(java.io.PrintStream out)

      Shows the command line syntax including a summary of all available options and some examples.
      Parameters:
        `out` - the stream to which the message must be printed

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