Package org.apache.fop.tools.anttasks
Class Fop
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.fop.tools.anttasks.Fop
- All Implemented Interfaces:
Cloneable
public class Fop
extends org.apache.tools.ant.Task
Wrapper for FOP which allows it to be accessed from within an Ant task.
Accepts the inputs:
- fofile - formatting objects file to be transformed
- iffile - intermediate format input file to be transformed
- outputFormat - MIME type of the format to generate ex. "application/pdf"
- inputFormat - Input file format (like "fo","xml","if")
- outfile - output filename
- baseDir - directory to work from
- relativebase - (true | false) control whether to use each FO's directory as base directory. false uses the baseDir parameter.
- userconfig - file with user configuration (same as the "-c" command line option)
- messagelevel - (error | warn | info | verbose | debug) level to output non-error messages
- logFiles - Controls whether the names of the files that are processed are logged or not
-
Field Summary
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFileset
(org.apache.tools.ant.types.FileSet set) Adds a set of XSL-FO files (nested fileset attribute).void
execute()
Gets the base directory.Returns the current list of filesets.Gets the input XSL-FO file.boolean
getForce()
Gets the force attributeGets the output format (MIME type).boolean
Returns True if the filename of each file processed should be logged.int
Returns the message type corresponding to Project.MSG_* representing the current message level.Gets the output directory.Gets the output file.boolean
Gets the relative base attributeboolean
Gets the throw exceptions attributeReturns the file for the userconfig.xml.Gets the input XML file.Gets the input XSLT file.Gets the XSLT parametersvoid
setBasedir
(File baseDir) Sets the base directory for single FO file (non-fileset) usagevoid
Sets the input XSL-FO file.void
setForce
(boolean force) Set whether to check dependencies, or to always generate; optional, default is false.void
Sets output format (MIME type).void
setLogFiles
(boolean logFiles) Controls whether the filenames of the files that are processed are logged or not.void
setMessagelevel
(String messageLevel) Sets the message level to be used while processing.void
Sets the output directory.void
setOutfile
(File outFile) Sets the output file.void
setRelativebase
(boolean relbase) Set whether to include files (external-graphics, instream-foreign-object) from a path relative to the .fo file (true) or the working directory (false, default) only useful for filesetsvoid
setThrowexceptions
(boolean throwExceptions) Set whether exceptions are thrown.void
setUserconfig
(File userConfig) Sets the filename for the userconfig.xml.void
setXmlFile
(File xmlFile) Sets the input XML file.void
setXsltFile
(File xsltFile) Sets the input XSLT file.void
setXsltParams
(String xsltParams) Sets the XSLT parametersMethods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
Fop
public Fop()
-
-
Method Details
-
setUserconfig
Sets the filename for the userconfig.xml.- Parameters:
userConfig
- Configuration to use
-
getUserconfig
Returns the file for the userconfig.xml.- Returns:
- the userconfig.xml file
-
setFofile
Sets the input XSL-FO file.- Parameters:
foFile
- input XSL-FO file
-
getFofile
Gets the input XSL-FO file.- Returns:
- input XSL-FO file
-
getXmlFile
Gets the input XML file.- Returns:
- the input XML file.
-
setXmlFile
Sets the input XML file.- Parameters:
xmlFile
- the input XML file.
-
getXsltFile
Gets the input XSLT file.- Returns:
- the input XSLT file.
-
setXsltFile
Sets the input XSLT file.- Parameters:
xsltFile
- the input XSLT file.
-
getXsltParams
Gets the XSLT parameters- Returns:
- the XSLT parameters
-
setXsltParams
Sets the XSLT parameters- Parameters:
xsltParams
- the XSLT parameters
-
addFileset
public void addFileset(org.apache.tools.ant.types.FileSet set) Adds a set of XSL-FO files (nested fileset attribute).- Parameters:
set
- a fileset
-
getFilesets
Returns the current list of filesets.- Returns:
- the filesets
-
setRelativebase
public void setRelativebase(boolean relbase) Set whether to include files (external-graphics, instream-foreign-object) from a path relative to the .fo file (true) or the working directory (false, default) only useful for filesets- Parameters:
relbase
- true if paths are relative to file.
-
getRelativebase
public boolean getRelativebase()Gets the relative base attribute- Returns:
- the relative base attribute
-
setForce
public void setForce(boolean force) Set whether to check dependencies, or to always generate; optional, default is false.- Parameters:
force
- true if always generate.
-
getForce
public boolean getForce()Gets the force attribute- Returns:
- the force attribute
-
setOutfile
Sets the output file.- Parameters:
outFile
- File to output to
-
getOutfile
Gets the output file.- Returns:
- the output file
-
setOutdir
Sets the output directory.- Parameters:
outDir
- Directory to output to
-
getOutdir
Gets the output directory.- Returns:
- the output directory
-
setFormat
Sets output format (MIME type).- Parameters:
format
- the output format
-
getFormat
Gets the output format (MIME type).- Returns:
- the output format
-
setThrowexceptions
public void setThrowexceptions(boolean throwExceptions) Set whether exceptions are thrown. default is false.- Parameters:
throwExceptions
- true if exceptions should be thrown
-
getThrowexceptions
public boolean getThrowexceptions()Gets the throw exceptions attribute- Returns:
- the throw exceptions attribute
-
setMessagelevel
Sets the message level to be used while processing.- Parameters:
messageLevel
- (error | warn| info | verbose | debug)
-
getMessageType
public int getMessageType()Returns the message type corresponding to Project.MSG_* representing the current message level.- Returns:
- message type
- See Also:
-
Project
-
setBasedir
Sets the base directory for single FO file (non-fileset) usage- Parameters:
baseDir
- File to use as a working directory
-
getBasedir
Gets the base directory.- Returns:
- the base directory
-
setLogFiles
public void setLogFiles(boolean logFiles) Controls whether the filenames of the files that are processed are logged or not.- Parameters:
logFiles
- True if the feature should be enabled
-
getLogFiles
public boolean getLogFiles()Returns True if the filename of each file processed should be logged.- Returns:
- True if the filenames should be logged.
-
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
-