<property name="severity" value="warning"/>
</module>
<module name="ConstantNameCheck">
- <property name="format" value="^[A-Z](_?[A-Z0-9]+)*$"/>
+ <property name="format" value="^([A-Z](_?[A-Z0-9]+)*)|(log)$"/>
<property name="severity" value="warning"/>
</module>
<module name="LocalFinalVariableNameCheck">
for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) {
PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next();
System.out.println("PageSequence "
- + (String.valueOf(pageSequenceResults.getID()).length() > 0
- ? pageSequenceResults.getID() : "<no id>")
+ + (String.valueOf(pageSequenceResults.getId()).length() > 0
+ ? pageSequenceResults.getId() : "<no id>")
+ " generated " + pageSequenceResults.getPageCount() + " pages.");
}
System.out.println("Generated " + foResults.getPageCount() + " pages in total.");
for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) {
PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next();
System.out.println("PageSequence "
- + (String.valueOf(pageSequenceResults.getID()).length() > 0
- ? pageSequenceResults.getID() : "<no id>")
+ + (String.valueOf(pageSequenceResults.getId()).length() > 0
+ ? pageSequenceResults.getId() : "<no id>")
+ " generated " + pageSequenceResults.getPageCount() + " pages.");
}
System.out.println("Generated " + foResults.getPageCount() + " pages in total.");
public abstract class AbstractAFPPainter {
/** Static logging instance */
- protected static Log log = LogFactory.getLog("org.apache.xmlgraphics.afp");
+ protected static final Log log = LogFactory.getLog("org.apache.xmlgraphics.afp");
/** data stream */
protected final DataStream dataStream;
protected static final byte SF_CLASS = (byte)0xD3;
/** the structure field header */
- protected static final byte[] SF_HEADER = new byte[] {
+ static final byte[] SF_HEADER = new byte[] {
0x5A, // Structured field identifier
0x00, // Length byte 1
0x10, // Length byte 2
*
* @return The ID
*/
- public String getID() {
+ public String getId() {
return this.id;
}
* Base object for all areas.
*/
public class Area extends AreaTreeObject implements Serializable {
+
+ private static final long serialVersionUID = 6342888466142626492L;
+
// stacking directions
/**
* Stacking left to right
/**
* logging instance
*/
- protected static Log log = LogFactory.getLog(Area.class);
+ protected static final Log log = LogFactory.getLog(Area.class);
/**
protected PageSequence currentPageSequence;
// private List offDocumentItems = new java.util.ArrayList();
/** logger instance */
- protected static Log log = LogFactory.getLog(AreaTreeModel.class);
+ protected static final Log log = LogFactory.getLog(AreaTreeModel.class);
/**
* Create a new store pages model
public class AreaTreeParser {
/** Logger instance */
- protected static Log log = LogFactory.getLog(AreaTreeParser.class);
+ protected static final Log log = LogFactory.getLog(AreaTreeParser.class);
private static SAXTransformerFactory tFactory
= (SAXTransformerFactory)SAXTransformerFactory.newInstance();
* See fo:region-body definition in the XSL Rec for more information.
*/
public class BeforeFloat extends BlockParent {
+
+ private static final long serialVersionUID = 4101415711488333380L;
+
// this is an optional block area that will be rendered
// as the separator only if there are float areas
private Block separator = null;
* It holds child block areas such as other blocks or lines.
*/
public class Block extends BlockParent {
+
+ private static final long serialVersionUID = 6843727817993665788L;
+
/**
* Normally stacked with other blocks.
*/
*/
public class BlockParent extends Area {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7076916890348533805L;
+
// this position is used for absolute position
// or as an indent
// this has the size in the block progression dimension
* The block-container creates this area.
*/
public class BlockViewport extends Block {
+
+ private static final long serialVersionUID = -7840580922580735157L;
+
// clipping for this viewport
private boolean clip = false;
// transform if rotated or absolute
* See fo:region-body definition in the XSL Rec for more information.
*/
public class BodyRegion extends RegionReference {
+
+ private static final long serialVersionUID = -1848872997724078080L;
+
private BeforeFloat beforeFloat; // optional
private MainReference mainReference; // mandatory
private Footnote footnote; // optional
*/
public class CTM implements Serializable {
+ private static final long serialVersionUID = -8743287485623778341L;
+
private double a, b, c, d, e, f;
private static final CTM CTM_LRTB = new CTM(1, 0, 0, 1, 0, 0);
* See fo:region-body definition in the XSL Rec for more information.
*/
public class Footnote extends BlockParent {
+
+ private static final long serialVersionUID = -7907428219886367161L;
+
private Block separator = null;
// footnote has an optional separator
*/
public class LineArea extends Area {
+ private static final long serialVersionUID = 7670235908329290684L;
+
/**
* this class stores information about line width and potential adjustments
* that can be used in order to re-compute adjustement and / or indents when a
* page-number or a page-number-citation is resolved
*/
private final class LineAdjustingInfo implements Serializable {
+
+ private static final long serialVersionUID = -6103629976229458273L;
+
private int lineAlignment;
private int difference;
private int availableStretch;
* Link resolving for resolving internal links.
*/
public class LinkResolver implements Resolvable, Serializable {
+
+ private static final long serialVersionUID = -7102134165192960718L;
+
private boolean resolved = false;
private String idRef;
private Area area;
*/
public class MainReference extends Area {
+ private static final long serialVersionUID = 7635126485620012448L;
+
private BodyRegion parent;
private List spanAreas = new java.util.ArrayList();
private boolean isEmpty = true;
* See fo:region-body definition in the XSL Rec for more information.
*/
public class NormalFlow extends BlockParent {
+
+ private static final long serialVersionUID = -3753538631016929004L;
+
/**
* Constructor.
* @param ipd of Normal flow object
* the top level page and regions.
*/
public class Page extends AreaTreeObject implements Serializable, Cloneable {
+
+ private static final long serialVersionUID = 6272157047421543866L;
+
// contains before, start, body, end and after regions
private RegionViewport regionBefore = null;
private RegionViewport regionStart = null;
/**
* logging instance
*/
- protected static Log log = LogFactory.getLog(PageViewport.class);
+ protected static final Log log = LogFactory.getLog(PageViewport.class);
/**
* Create a page viewport.
*/
public class RegionReference extends Area implements Cloneable {
+ private static final long serialVersionUID = -298980963268244238L;
+
/** Reference to the region FO. */
//protected Region regionFO;
private int regionClass;
private String regionName;
private CTM ctm;
-
// the list of block areas from the static flow
private ArrayList blocks = new ArrayList();
* in the fo:region-body description in the XSL Recommendation.
*/
public class RegionViewport extends Area implements Cloneable {
+
+ private static final long serialVersionUID = 505781815165102572L;
+
// this rectangle is relative to the page
private RegionReference regionReference;
private Rectangle2D viewArea;
* See fo:region-body definition in the XSL Rec for more information.
*/
public class Span extends Area {
+
+ private static final long serialVersionUID = -5551430053660081549L;
+
// the list of flow reference areas in this span area
private List flowAreas;
private int colCount;
*/
public final class Trait implements Serializable {
+ private static final long serialVersionUID = 3234280285391611437L;
+
private Trait() {
}
*/
public static class InternalLink implements Serializable {
+ private static final long serialVersionUID = -8993505060996723039L;
+
/** The unique key of the PageViewport. */
private String pvKey;
*/
public static class ExternalLink implements Serializable {
+ private static final long serialVersionUID = -3720707599232620946L;
+
private String destination;
private boolean newWindow;
*/
public static class Background implements Serializable {
+ private static final long serialVersionUID = 8452078676273242870L;
+
/** The background color if any. */
private Color color = null;
*/
public abstract class AbstractTextArea extends InlineParent {
+ private static final long serialVersionUID = -1246306443569094371L;
+
/**
* this class stores information about spaces and potential adjustments
* that can be used in order to re-compute adjustments when a
*/
protected class TextAdjustingInfo extends InlineAdjustingInfo {
+ private static final long serialVersionUID = -2412095162983479947L;
+
/** difference between the optimal width of a space
* and the default width of a space according to the font
* (this is equivalent to the property word-spacing.optimum)
*/
public class Anchor extends InlineArea {
+ private static final long serialVersionUID = 5227798744787823499L;
+
// has a keep with adjacent area
// has reference to associated footnote or float out-of-line area
* This allows an inline area to have blocks as children.
*/
public class Container extends Area {
+
+ private static final long serialVersionUID = 5256423939348189260L;
+
/**
* The list of block areas stacked inside this container
*/
* this as a normal inline parent.
*/
public class FilledArea extends InlineParent {
+
+ private static final long serialVersionUID = 8586584705587017474L;
+
private int unitWidth;
/**
* The url of the image is used as a key to reference the image cache.
*/
public class Image extends Area {
+
+ private static final long serialVersionUID = 4800834714349695386L;
+
private String url;
/**
*/
public class InlineArea extends Area {
+ private static final long serialVersionUID = -8940066479810170980L;
+
/**
* this class stores information about potential adjustments
* that can be used in order to re-compute adjustments when a
* page-number or a page-number-citation is resolved
*/
protected class InlineAdjustingInfo implements Serializable {
+
+ private static final long serialVersionUID = -5601387735459712149L;
+
/** stretch of the inline area */
protected int availableStretch;
/** shrink of the inline area */
*/
public class InlineBlockParent extends InlineArea {
+
+ private static final long serialVersionUID = -3661746143321407377L;
+
/**
* The list of inline areas added to this inline parent.
*/
* This is an inline area that can have other inlines as children.
*/
public class InlineParent extends InlineArea {
+
+ private static final long serialVersionUID = -3047168298770354813L;
+
/**
* The list of inline areas added to this inline parent.
*/
// if space replaced with a space
// otherwise this is a holder for a line
+
+ private static final long serialVersionUID = -8011373048313956301L;
+
private int ruleStyle = Constants.EN_SOLID;
private int ruleThickness = 1000;
*/
public class Space extends InlineArea {
+ private static final long serialVersionUID = -8748265505356839796L;
+
}
*/
public class SpaceArea extends InlineArea {
+ private static final long serialVersionUID = 2218803009825411416L;
+
/**
* The space for this space area
*/
*/
public class TextArea extends AbstractTextArea {
+ private static final long serialVersionUID = 7315900267242540809L;
+
/**
* Create a text inline area
*/
*/
public class UnresolvedPageNumber extends TextArea implements Resolvable {
+
+ private static final long serialVersionUID = -1758090835371647980L;
+
private boolean resolved = false;
private String pageIDRef;
private String text;
* holds the area and positions it.
*/
public class Viewport extends InlineArea {
+
+ private static final long serialVersionUID = 813338534627918689L;
+
// contents could be container, foreign object or image
private Area content;
// clipping for the viewport
*/
public class WordArea extends InlineArea {
+ private static final long serialVersionUID = 6444644662158970942L;
+
/** The text for this word area */
protected String word;
/* user configuration file */
private File userConfigFile = null;
/* input fo file */
- private File fofile = null;
+ private File foFile = null;
/* xsltfile (xslt transformation as input) */
- private File xsltfile = null;
+ private File xsltFile = null;
/* xml file (xslt transformation as input) */
- private File xmlfile = null;
+ private File xmlFile = null;
/* area tree input file */
- private File areatreefile = null;
+ private File areatreeFile = null;
/* intermediate format input file */
- private File iffile = null;
+ private File ifFile = null;
/* area tree input file */
- private File imagefile = null;
+ private File imageFile = null;
/* output file */
- private File outfile = null;
+ private File outFile = null;
/* input mode */
- private int inputmode = NOT_SET;
+ private int inputMode = NOT_SET;
/* output mode */
- private String outputmode = null;
+ private String outputMode = null;
/* true if System.in (stdin) should be used for the input file */
private boolean useStdIn = false;
/* true if System.out (stdout) should be used for the output file */
inputHandler = createInputHandler();
- if (MimeConstants.MIME_FOP_AWT_PREVIEW.equals(outputmode)) {
+ if (MimeConstants.MIME_FOP_AWT_PREVIEW.equals(outputMode)) {
//set the system look&feel for the preview dialog
try {
UIManager.setLookAndFeel(
renderer.setRenderable(inputHandler); //set before user agent!
renderer.setUserAgent(foUserAgent);
foUserAgent.setRendererOverride(renderer);
- } else if (MimeConstants.MIME_FOP_AREA_TREE.equals(outputmode)
+ } else if (MimeConstants.MIME_FOP_AREA_TREE.equals(outputMode)
&& mimicRenderer != null) {
// render from FO to Intermediate Format
Renderer targetRenderer = foUserAgent.getRendererFactory().createRenderer(
//Make sure the prepared XMLRenderer is used
foUserAgent.setRendererOverride(xmlRenderer);
- } else if (MimeConstants.MIME_FOP_IF.equals(outputmode)
+ } else if (MimeConstants.MIME_FOP_IF.equals(outputMode)
&& mimicRenderer != null) {
// render from FO to Intermediate Format
IFSerializer serializer = new IFSerializer();
if (isSystemInOutFile(filename)) {
this.useStdIn = true;
} else {
- fofile = new File(filename);
+ foFile = new File(filename);
}
return 1;
}
throw new FOPException("you must specify the stylesheet "
+ "file for the '-xsl' option");
} else {
- xsltfile = new File(args[i + 1]);
+ xsltFile = new File(args[i + 1]);
return 1;
}
}
if (isSystemInOutFile(filename)) {
this.useStdIn = true;
} else {
- xmlfile = new File(filename);
+ xmlFile = new File(filename);
}
return 1;
}
if (isSystemInOutFile(filename)) {
this.useStdOut = true;
} else {
- outfile = new File(filename);
+ outFile = new File(filename);
}
}
}
private int parseUnknownOption(String[] args, int i) throws FOPException {
- if (inputmode == NOT_SET) {
- inputmode = FO_INPUT;
+ if (inputMode == NOT_SET) {
+ inputMode = FO_INPUT;
String filename = args[i];
if (isSystemInOutFile(filename)) {
this.useStdIn = true;
} else {
- fofile = new File(filename);
+ foFile = new File(filename);
}
- } else if (outputmode == null) {
- outputmode = MimeConstants.MIME_PDF;
+ } else if (outputMode == null) {
+ outputMode = MimeConstants.MIME_PDF;
setOutputFile(args[i]);
} else {
throw new FOPException("Don't know what to do with "
if (isSystemInOutFile(filename)) {
this.useStdIn = true;
} else {
- areatreefile = new File(filename);
+ areatreeFile = new File(filename);
}
return 1;
}
if (isSystemInOutFile(filename)) {
this.useStdIn = true;
} else {
- iffile = new File(filename);
+ ifFile = new File(filename);
}
return 1;
}
if (isSystemInOutFile(filename)) {
this.useStdIn = true;
} else {
- imagefile = new File(filename);
+ imageFile = new File(filename);
}
return 1;
}
}
private void setOutputMode(String mime) throws FOPException {
- if (outputmode == null) {
- outputmode = mime;
+ if (outputMode == null) {
+ outputMode = mime;
} else {
throw new FOPException("you can only set one output method");
}
}
private void setInputFormat(int format) throws FOPException {
- if (inputmode == NOT_SET || inputmode == format) {
- inputmode = format;
+ if (inputMode == NOT_SET || inputMode == format) {
+ inputMode = format;
} else {
throw new FOPException("Only one input mode can be specified!");
}
* checks whether all necessary information has been given in a consistent way
*/
private void checkSettings() throws FOPException, FileNotFoundException {
- if (inputmode == NOT_SET) {
+ if (inputMode == NOT_SET) {
throw new FOPException("No input file specified");
}
- if (outputmode == null) {
+ if (outputMode == null) {
throw new FOPException("No output file specified");
}
- if ((outputmode.equals(MimeConstants.MIME_FOP_AWT_PREVIEW)
- || outputmode.equals(MimeConstants.MIME_FOP_PRINT))
- && outfile != null) {
+ if ((outputMode.equals(MimeConstants.MIME_FOP_AWT_PREVIEW)
+ || outputMode.equals(MimeConstants.MIME_FOP_PRINT))
+ && outFile != null) {
throw new FOPException("Output file may not be specified "
+ "for AWT or PRINT output");
}
- if (inputmode == XSLT_INPUT) {
+ if (inputMode == XSLT_INPUT) {
// check whether xml *and* xslt file have been set
- if (xmlfile == null && !this.useStdIn) {
+ if (xmlFile == null && !this.useStdIn) {
throw new FOPException("XML file must be specified for the transform mode");
}
- if (xsltfile == null) {
+ if (xsltFile == null) {
throw new FOPException("XSLT file must be specified for the transform mode");
}
// warning if fofile has been set in xslt mode
- if (fofile != null) {
+ if (foFile != null) {
log.warn("Can't use fo file with transform mode! Ignoring.\n"
+ "Your input is " + "\n xmlfile: "
- + xmlfile.getAbsolutePath()
+ + xmlFile.getAbsolutePath()
+ "\nxsltfile: "
- + xsltfile.getAbsolutePath()
+ + xsltFile.getAbsolutePath()
+ "\n fofile: "
- + fofile.getAbsolutePath());
+ + foFile.getAbsolutePath());
}
- if (xmlfile != null && !xmlfile.exists()) {
+ if (xmlFile != null && !xmlFile.exists()) {
throw new FileNotFoundException("Error: xml file "
- + xmlfile.getAbsolutePath()
+ + xmlFile.getAbsolutePath()
+ " not found ");
}
- if (!xsltfile.exists()) {
+ if (!xsltFile.exists()) {
throw new FileNotFoundException("Error: xsl file "
- + xsltfile.getAbsolutePath()
+ + xsltFile.getAbsolutePath()
+ " not found ");
}
- } else if (inputmode == FO_INPUT) {
- if (outputmode.equals(MimeConstants.MIME_XSL_FO)) {
+ } else if (inputMode == FO_INPUT) {
+ if (outputMode.equals(MimeConstants.MIME_XSL_FO)) {
throw new FOPException(
"FO output mode is only available if you use -xml and -xsl");
}
- if (fofile != null && !fofile.exists()) {
+ if (foFile != null && !foFile.exists()) {
throw new FileNotFoundException("Error: fo file "
- + fofile.getAbsolutePath()
+ + foFile.getAbsolutePath()
+ " not found ");
}
- } else if (inputmode == AREATREE_INPUT) {
- if (outputmode.equals(MimeConstants.MIME_XSL_FO)) {
+ } else if (inputMode == AREATREE_INPUT) {
+ if (outputMode.equals(MimeConstants.MIME_XSL_FO)) {
throw new FOPException(
"FO output mode is only available if you use -xml and -xsl");
- } else if (outputmode.equals(MimeConstants.MIME_FOP_AREA_TREE)) {
+ } else if (outputMode.equals(MimeConstants.MIME_FOP_AREA_TREE)) {
throw new FOPException(
"Area Tree Output is not available if Area Tree is used as input!");
}
- if (areatreefile != null && !areatreefile.exists()) {
+ if (areatreeFile != null && !areatreeFile.exists()) {
throw new FileNotFoundException("Error: area tree file "
- + areatreefile.getAbsolutePath()
+ + areatreeFile.getAbsolutePath()
+ " not found ");
}
- } else if (inputmode == IF_INPUT) {
- if (outputmode.equals(MimeConstants.MIME_XSL_FO)) {
+ } else if (inputMode == IF_INPUT) {
+ if (outputMode.equals(MimeConstants.MIME_XSL_FO)) {
throw new FOPException(
"FO output mode is only available if you use -xml and -xsl");
- } else if (outputmode.equals(MimeConstants.MIME_FOP_AREA_TREE)) {
+ } else if (outputMode.equals(MimeConstants.MIME_FOP_AREA_TREE)) {
throw new FOPException(
"Area Tree Output is not available if Intermediate Format"
+ " is used as input!");
- } else if (outputmode.equals(MimeConstants.MIME_FOP_IF)) {
+ } else if (outputMode.equals(MimeConstants.MIME_FOP_IF)) {
throw new FOPException(
"Intermediate Output is not available if Intermediate Format"
+ " is used as input!");
}
- if (iffile != null && !iffile.exists()) {
+ if (ifFile != null && !ifFile.exists()) {
throw new FileNotFoundException("Error: intermediate format file "
- + iffile.getAbsolutePath()
+ + ifFile.getAbsolutePath()
+ " not found ");
}
- } else if (inputmode == IMAGE_INPUT) {
- if (outputmode.equals(MimeConstants.MIME_XSL_FO)) {
+ } else if (inputMode == IMAGE_INPUT) {
+ if (outputMode.equals(MimeConstants.MIME_XSL_FO)) {
throw new FOPException(
"FO output mode is only available if you use -xml and -xsl");
}
- if (imagefile != null && !imagefile.exists()) {
+ if (imageFile != null && !imageFile.exists()) {
throw new FileNotFoundException("Error: image file "
- + imagefile.getAbsolutePath()
+ + imageFile.getAbsolutePath()
+ " not found ");
}
}
* @throws FOPException for invalid output formats
*/
protected String getOutputFormat() throws FOPException {
- if (outputmode == null) {
+ if (outputMode == null) {
throw new FOPException("Renderer has not been set!");
}
- if (outputmode.equals(MimeConstants.MIME_FOP_AREA_TREE)) {
+ if (outputMode.equals(MimeConstants.MIME_FOP_AREA_TREE)) {
renderingOptions.put("fineDetail", isCoarseAreaXml());
}
- return outputmode;
+ return outputMode;
}
/**
* @throws IllegalArgumentException if invalid/missing parameters
*/
private InputHandler createInputHandler() {
- switch (inputmode) {
+ switch (inputMode) {
case FO_INPUT:
- return new InputHandler(fofile);
+ return new InputHandler(foFile);
case AREATREE_INPUT:
- return new AreaTreeInputHandler(areatreefile);
+ return new AreaTreeInputHandler(areatreeFile);
case IF_INPUT:
- return new IFInputHandler(iffile);
+ return new IFInputHandler(ifFile);
case XSLT_INPUT:
- InputHandler handler = new InputHandler(xmlfile, xsltfile, xsltParams);
+ InputHandler handler = new InputHandler(xmlFile, xsltFile, xsltParams);
if (useCatalogResolver) {
handler.createCatalogResolver(foUserAgent);
}
return handler;
case IMAGE_INPUT:
- return new ImageInputHandler(imagefile, xsltfile, xsltParams);
+ return new ImageInputHandler(imageFile, xsltFile, xsltParams);
default:
throw new IllegalArgumentException("Error creating InputHandler object.");
}
* Returns the XSL-FO file if set.
* @return the XSL-FO file, null if not set
*/
- public File getFOFile() {
- return fofile;
+ public File getFoFile() {
+ return foFile;
}
/**
* Returns the input XML file if set.
* @return the input XML file, null if not set
*/
- public File getXMLFile() {
- return xmlfile;
+ public File getXmlFile() {
+ return xmlFile;
}
/**
* Returns the stylesheet to be used for transformation to XSL-FO.
* @return stylesheet
*/
- public File getXSLFile() {
- return xsltfile;
+ public File getXslFile() {
+ return xsltFile;
}
/**
* @return the output file
*/
public File getOutputFile() {
- return outfile;
+ return outFile;
}
/**
* @return either the fofile or the xmlfile
*/
public File getInputFile() {
- switch (inputmode) {
+ switch (inputMode) {
case FO_INPUT:
- return fofile;
+ return foFile;
case XSLT_INPUT:
- return xmlfile;
+ return xmlFile;
default:
- return fofile;
+ return foFile;
}
}
*/
private void dumpConfiguration() {
log.info("Input mode: ");
- switch (inputmode) {
+ switch (inputMode) {
case NOT_SET:
log.info("not set");
break;
if (isInputFromStdIn()) {
log.info("fo input file: from stdin");
} else {
- log.info("fo input file: " + fofile.toString());
+ log.info("fo input file: " + foFile.toString());
}
break;
case XSLT_INPUT:
if (isInputFromStdIn()) {
log.info("xml input file: from stdin");
} else {
- log.info("xml input file: " + xmlfile.toString());
+ log.info("xml input file: " + xmlFile.toString());
}
- log.info("xslt stylesheet: " + xsltfile.toString());
+ log.info("xslt stylesheet: " + xsltFile.toString());
break;
case AREATREE_INPUT:
log.info("AT ");
if (isInputFromStdIn()) {
log.info("area tree input file: from stdin");
} else {
- log.info("area tree input file: " + areatreefile.toString());
+ log.info("area tree input file: " + areatreeFile.toString());
}
break;
case IF_INPUT:
if (isInputFromStdIn()) {
log.info("intermediate input file: from stdin");
} else {
- log.info("intermediate input file: " + iffile.toString());
+ log.info("intermediate input file: " + ifFile.toString());
}
break;
case IMAGE_INPUT:
if (isInputFromStdIn()) {
log.info("image input file: from stdin");
} else {
- log.info("image input file: " + imagefile.toString());
+ log.info("image input file: " + imageFile.toString());
}
break;
default:
log.info("unknown input type");
}
log.info("Output mode: ");
- if (outputmode == null) {
+ if (outputMode == null) {
log.info("not set");
- } else if (MimeConstants.MIME_FOP_AWT_PREVIEW.equals(outputmode)) {
+ } else if (MimeConstants.MIME_FOP_AWT_PREVIEW.equals(outputMode)) {
log.info("awt on screen");
- if (outfile != null) {
+ if (outFile != null) {
log.error("awt mode, but outfile is set:");
- log.error("out file: " + outfile.toString());
+ log.error("out file: " + outFile.toString());
}
- } else if (MimeConstants.MIME_FOP_PRINT.equals(outputmode)) {
+ } else if (MimeConstants.MIME_FOP_PRINT.equals(outputMode)) {
log.info("print directly");
- if (outfile != null) {
+ if (outFile != null) {
log.error("print mode, but outfile is set:");
- log.error("out file: " + outfile.toString());
+ log.error("out file: " + outFile.toString());
}
- } else if (MimeConstants.MIME_FOP_AREA_TREE.equals(outputmode)) {
+ } else if (MimeConstants.MIME_FOP_AREA_TREE.equals(outputMode)) {
log.info("area tree");
if (mimicRenderer != null) {
log.info("mimic renderer: " + mimicRenderer);
if (isOutputToStdOut()) {
log.info("output file: to stdout");
} else {
- log.info("output file: " + outfile.toString());
+ log.info("output file: " + outFile.toString());
}
- } else if (MimeConstants.MIME_FOP_IF.equals(outputmode)) {
+ } else if (MimeConstants.MIME_FOP_IF.equals(outputMode)) {
log.info("intermediate format");
- log.info("output file: " + outfile.toString());
+ log.info("output file: " + outFile.toString());
} else {
- log.info(outputmode);
+ log.info(outputMode);
if (isOutputToStdOut()) {
log.info("output file: to stdout");
} else {
- log.info("output file: " + outfile.toString());
+ log.info("output file: " + outFile.toString());
}
}
/**
* logging instance
*/
- protected static Log log = LogFactory.getLog(LengthBase.class);
+ protected static final Log log = LogFactory.getLog(LengthBase.class);
/**
* The FO for which this property is to be calculated.
protected Locator locator;
/** Logger for fo-tree related messages **/
- protected static Log log = LogFactory.getLog(FONode.class);
+ protected static final Log log = LogFactory.getLog(FONode.class);
/**
* Base constructor
}
/** @return the baseline-shift property */
- public Length getBaseLineShift() {
+ public Length getBaselineShift() {
return baselineShift;
}
*/
public class XMPMetadata implements ExtensionAttachment, Serializable, XMLizable {
+ private static final long serialVersionUID = 591347206217931578L;
+
/** The category URI for this extension attachment. */
public static final String CATEGORY = XMPConstants.XMP_NAMESPACE;
public class Property {
/** Logger for all property classes */
- protected static Log log = LogFactory.getLog(PropertyMaker.class);
+ protected static final Log log = LogFactory.getLog(PropertyMaker.class);
/**
* The original specified value for properties which inherit
if (obj != this) {
return obj.toString();
}
- return null;
+ return "";
}
}
public class FontInfo {
/** logging instance */
- protected static Log log = LogFactory.getLog(FontInfo.class);
+ protected static final Log log = LogFactory.getLog(FontInfo.class);
/** Map containing fonts that have been used */
private Map/*<String,FontMetrics>*/ usedFonts = null; //(String = font key)
*/
public class FontInfoConfigurator {
/** logger instance */
- protected static Log log = LogFactory.getLog(FontInfoConfigurator.class);
+ protected static final Log log = LogFactory.getLog(FontInfoConfigurator.class);
private Configuration cfg;
private FontManager fontManager;
public abstract class FontLoader {
/** logging instance */
- protected static Log log = LogFactory.getLog(FontLoader.class);
+ protected static final Log log = LogFactory.getLog(FontLoader.class);
/** URI representing the font file */
protected String fontFileURI = null;
public void preview(PFMFile pfm) {
if (log != null && log.isInfoEnabled()) {
log.info("Font: " + pfm.getWindowsName());
- log.info("Name: " + pfm.getPostscriptName());
+ log.info("Name: " + pfm.getPostScriptName());
log.info("CharSet: " + pfm.getCharSetName());
log.info("CapHeight: " + pfm.getCapHeight());
log.info("XHeight: " + pfm.getXHeight());
Element el = doc.createElement("font-name");
root.appendChild(el);
- el.appendChild(doc.createTextNode(pfm.getPostscriptName()));
+ el.appendChild(doc.createTextNode(pfm.getPostScriptName()));
// Currently unused.
// String s = pfm.getPostscriptName();
private static final long serialVersionUID = -9173104935431899722L;
/** logging instance */
- protected static Log log = LogFactory.getLog(FontSubstitutions.class);
+ protected static final Log log = LogFactory.getLog(FontSubstitutions.class);
/**
* Adjusts a given fontInfo using this font substitution catalog
public class FontWeightRange {
/** logging instance */
- protected static Log log = LogFactory.getLog("org.apache.fop.render.fonts");
+ protected static final Log log = LogFactory.getLog("org.apache.fop.render.fonts");
/**
* Returns an <code>FontWeightRange</code> object holding the
// Header stuff
private String windowsName;
- private String postscriptName;
+ private String postScriptName;
private short dfItalic;
private int dfWeight;
private short dfCharSet;
inStream.reset();
inStream.skip(driverInfoOffset);
- postscriptName = inStream.readString();
+ postScriptName = inStream.readString();
if (extMetricsOffset != 0) {
inStream.reset();
*
* @return The Postscript name.
*/
- public String getPostscriptName() {
- return postscriptName;
+ public String getPostScriptName() {
+ return postScriptName;
}
/**
case 0:
return "WinAnsi"; // AKA ISOAdobe
case 2:
- if ("Symbol".equals(getPostscriptName())) {
+ if ("Symbol".equals(getPostScriptName())) {
return "Symbol";
}
break;
names.add(afm.getFamilyName());
returnFont.setFamilyNames(names);
} else {
- returnFont.setFontName(pfm.getPostscriptName());
- String fullName = pfm.getPostscriptName();
+ returnFont.setFontName(pfm.getPostScriptName());
+ String fullName = pfm.getPostScriptName();
fullName = fullName.replace('-', ' '); //Hack! Try to emulate full name
returnFont.setFullName(fullName); //emulate afm.getFullName()
Set names = new java.util.HashSet();
*/
public class ByteVector implements Serializable {
+ private static final long serialVersionUID = 1554572867863466772L;
+
/**
* Capacity increment size
*/
*/
public class CharVector implements Cloneable, Serializable {
+ private static final long serialVersionUID = 4263472982169004048L;
+
/**
* Capacity increment size
*/
*/
public class Hyphen implements Serializable {
+ private static final long serialVersionUID = 8989909741110279085L;
+
/** pre break string */
public String preBreak; // CSOK: VisibilityModifier
public final class Hyphenator {
/** logging instance */
- protected static Log log = LogFactory.getLog(Hyphenator.class);
+ protected static final Log log = LogFactory.getLog(Hyphenator.class);
private static HyphenationTreeCache hTreeCache = null;
* if it ain't broken, don't fix it.
*/
+ private static final long serialVersionUID = 3175412271203716160L;
+
/**
* Pointer to low branch and to rest of the key when it is
* stored directly in this node, we don't have unions in java!
public abstract class AbstractBreaker {
/** logging instance */
- protected static Log log = LogFactory.getLog(AbstractBreaker.class);
+ protected static final Log log = LogFactory.getLog(AbstractBreaker.class);
/**
* A page break position.
*/
public class BlockSequence extends BlockKnuthSequence {
+ private static final long serialVersionUID = -5348831120146774118L;
+
/** Number of elements to ignore at the beginning of the list. */
int ignoreAtStart = 0; // CSOK: VisibilityModifier
/** Number of elements to ignore at the end of the list. */
*/
public class BlockKnuthSequence extends KnuthSequence {
+ private static final long serialVersionUID = 1648962416582509095L;
+
private boolean isClosed = false;
/**
public abstract class BreakingAlgorithm {
/** the logger for the class */
- protected static Log log = LogFactory.getLog(BreakingAlgorithm.class);
+ protected static final Log log = LogFactory.getLog(BreakingAlgorithm.class);
/** Maximum adjustment ration */
protected static final int INFINITE_RATIO = 1000;
*/
public class InlineKnuthSequence extends KnuthSequence {
+ private static final long serialVersionUID = 1354774188859946549L;
+
private boolean isClosed = false;
/**
public abstract class UnresolvedListElementWithLength extends UnresolvedListElement {
/** Logger instance */
- protected static Log log = LogFactory.getLog(UnresolvedListElementWithLength.class);
+ protected static final Log log = LogFactory.getLog(UnresolvedListElementWithLength.class);
private MinOptMax length;
private boolean conditional;
public class ImageLayout implements Constants {
/** logging instance */
- protected static Log log = LogFactory.getLog(ImageLayout.class);
+ protected static final Log log = LogFactory.getLog(ImageLayout.class);
//Input
private GraphicsProperties props;
/**
* logging instance
*/
- protected static Log log = LogFactory.getLog(LeafNodeLayoutManager.class);
+ protected static final Log log = LogFactory.getLog(LeafNodeLayoutManager.class);
/**
* The inline area that this leafnode will add.
// this class represents a paragraph
private class Paragraph extends InlineKnuthSequence {
+
+ private static final long serialVersionUID = 5862072380375189105L;
+
/** Number of elements to ignore at the beginning of the list. */
private int ignoreAtStart = 0;
/** Number of elements to ignore at the end of the list. */
public abstract class PDFObject implements PDFWritable {
/** logger for all PDFObjects (and descendants) */
- protected static Log log = LogFactory.getLog(PDFObject.class.getName());
+ protected static final Log log = LogFactory.getLog(PDFObject.class.getName());
/**
* the object's number
*/
public abstract class AbstractConfigurator {
/** logger instance */
- protected static Log log = LogFactory.getLog(AbstractConfigurator.class);
+ protected static final Log log = LogFactory.getLog(AbstractConfigurator.class);
private static final String MIME = "mime";
}
/** {@inheritDoc} */
- public String getNamespace() {
+ public String getNameSpace() {
return SVGDOMImplementation.SVG_NAMESPACE_URI;
}
implements Renderer, Constants {
/** logging instance */
- protected static Log log = LogFactory.getLog("org.apache.fop.render");
+ protected static final Log log = LogFactory.getLog("org.apache.fop.render");
/**
* user agent
implements RendererConfigurator, IFDocumentHandlerConfigurator {
/** logger instance */
- protected static Log log = LogFactory.getLog(PrintRendererConfigurator.class);
+ protected static final Log log = LogFactory.getLog(PrintRendererConfigurator.class);
/**
* Default constructor
* @return the XML namespace for the XML dialect this XMLHandler supports,
* null if all XML content is handled by this instance.
*/
- String getNamespace();
+ String getNameSpace();
}
public class XMLHandlerConfigurator extends AbstractRendererConfigurator {
/** logger instance */
- protected static Log log = LogFactory.getLog(XMLHandlerConfigurator.class);
+ protected static final Log log = LogFactory.getLog(XMLHandlerConfigurator.class);
/**
* Default constructor
* @param handler the XMLHandler instance
*/
public void addXMLHandler(XMLHandler handler) {
- String ns = handler.getNamespace();
+ String ns = handler.getNameSpace();
if (ns == null) {
setDefaultXMLHandler(handler);
} else {
*
* @return the uri
*/
- public String getURI() {
+ public String getUri() {
return this.uri;
}
implements ContentHandlerFactory.ObjectSource {
/** Logger instance */
- protected static Log log = LogFactory.getLog(AFPExtensionHandler.class);
+ protected static final Log log = LogFactory.getLog(AFPExtensionHandler.class);
private StringBuffer content = new StringBuffer();
private Attributes lastAttributes;
*/
public class PageChangeEvent extends EventObject {
+ private static final long serialVersionUID = -5969283475959932887L;
+
private int oldPage;
private int newPage;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;
+import java.util.NoSuchElementException;
import org.apache.commons.logging.Log;
multiWriter.close();
}
} else {
- writer.writeImage((RenderedImage) pageImagesItr.next(), outputStream, writerParams);
+ RenderedImage renderedImage = null;
+ if (pageImagesItr.hasNext()) {
+ renderedImage = (RenderedImage) pageImagesItr.next();
+ }
+ writer.writeImage(renderedImage, outputStream, writerParams);
if (pageImagesItr.hasNext()) {
BitmapRendererEventProducer eventProducer
= BitmapRendererEventProducer.Provider.get(
try {
pageImage = getPageImage(current++);
} catch (FOPException e) {
- log.error(e);
- return null;
+ throw new NoSuchElementException(e.getMessage());
}
if (COMPRESSION_CCITT_T4.equalsIgnoreCase(writerParams.getCompressionMethod())
public class IFParser implements IFConstants {
/** Logger instance */
- protected static Log log = LogFactory.getLog(IFParser.class);
+ protected static final Log log = LogFactory.getLog(IFParser.class);
private static SAXTransformerFactory tFactory
= (SAXTransformerFactory)SAXTransformerFactory.newInstance();
//if optimizations can be done to avoid int->float->int conversions.
/** logging instance */
- protected static Log log = LogFactory.getLog(IFRenderer.class);
+ protected static final Log log = LogFactory.getLog(IFRenderer.class);
/** XML MIME type */
public static final String IF_MIME_TYPE = MimeConstants.MIME_FOP_IF;
throw new NullPointerException("action must not be null");
}
if (!action.isComplete()) {
- assert action.hasID();
- incompleteActions.put(action.getID(), action);
+ assert action.hasId();
+ incompleteActions.put(action.getId(), action);
}
}
/** {@inheritDoc} */
public void addResolvedAction(AbstractAction action) throws IFException {
assert action.isComplete();
- assert action.hasID();
- AbstractAction noted = (AbstractAction)incompleteActions.remove(action.getID());
+ assert action.hasId();
+ AbstractAction noted = (AbstractAction)incompleteActions.remove(action.getId());
if (noted != null) {
completeActions.add(action);
} else {
* Sets an ID to make the action referencable.
* @param id the ID
*/
- public void setID(String id) {
+ public void setId(String id) {
this.id = id;
}
* Returns an optional ID for this action.
* @return the ID or null
*/
- public String getID() {
+ public String getId() {
return this.id;
}
* Indicates whether the action has an ID and is therefore referencable.
* @return true if the action has an ID
*/
- public boolean hasID() {
+ public boolean hasId() {
return this.id != null;
}
* Returns a string that is used to prefix a generated ID to make it unique.
* @return the prefix string
*/
- public String getIDPrefix() {
+ public String getIdPrefix() {
return null;
}
*/
public synchronized String generateNewID(AbstractAction action) {
this.lastGeneratedID++;
- String prefix = action.getIDPrefix();
+ String prefix = action.getIdPrefix();
if (prefix == null) {
throw new IllegalArgumentException("Action class is not compatible");
}
* @return the action instance that should be used in place of the given one
*/
public AbstractAction put(AbstractAction action) {
- if (!action.hasID()) {
- action.setID(generateNewID(action));
+ if (!action.hasId()) {
+ action.setId(generateNewID(action));
}
AbstractAction effAction = normalize(action);
if (effAction == action) {
- this.actionRegistry.put(action.getID(), action);
+ this.actionRegistry.put(action.getId(), action);
}
return effAction;
}
implements DocumentNavigationExtensionConstants {
/** Logger instance */
- protected static Log log = LogFactory.getLog(DocumentNavigationHandler.class);
+ protected static final Log log = LogFactory.getLog(DocumentNavigationHandler.class);
private StringBuffer content = new StringBuffer();
private Stack objectStack = new Stack();
boolean newWindow = "new".equals(showDestination);
URIAction action = new URIAction(gotoURI, newWindow);
if (id != null) {
- action.setID(id);
+ action.setId(id);
}
if (structurePointer != null) {
action.setStructurePointer(structurePointer);
* or null, if the position isn't known, yet
*/
public GoToXYAction(String id, int pageIndex, Point targetLocation) {
- setID(id);
+ setId(id);
if (pageIndex < 0 && targetLocation != null) {
throw new IllegalArgumentException(
"Page index may not be null if target location is known!");
AttributesImpl atts = new AttributesImpl();
if (this.isCompleteExceptTargetLocation()) {
final Point reportedTargetLocation = this.getTargetLocation();
- atts.addAttribute(null, "id", "id", XMLUtil.CDATA, getID());
+ atts.addAttribute(null, "id", "id", XMLUtil.CDATA, getId());
atts.addAttribute(null, "page-index", "page-index",
XMLUtil.CDATA, Integer.toString(pageIndex));
atts.addAttribute(null, "x", "x", XMLUtil.CDATA,
atts.addAttribute(null, "y", "y", XMLUtil.CDATA,
Integer.toString(reportedTargetLocation.y));
} else {
- atts.addAttribute(null, "idref", "idref", XMLUtil.CDATA, getID());
+ atts.addAttribute(null, "idref", "idref", XMLUtil.CDATA, getId());
}
handler.startElement(GOTO_XY.getNamespaceURI(),
GOTO_XY.getLocalName(), GOTO_XY.getQName(), atts);
/** {@inheritDoc} */
public String toString() {
- return "GoToXY: ID=" + getID()
+ return "GoToXY: ID=" + getId()
+ ", page=" + getPageIndex()
+ ", loc=" + getTargetLocation() + ", "
+ (isComplete() ? "complete" : "INCOMPLETE");
}
/** {@inheritDoc} */
- public String getIDPrefix() {
+ public String getIdPrefix() {
return "fop-" + GOTO_URI.getLocalName();
}
/** {@inheritDoc} */
public void toSAX(ContentHandler handler) throws SAXException {
AttributesImpl atts = new AttributesImpl();
- if (hasID()) {
- atts.addAttribute(null, "id", "id", XMLUtil.CDATA, getID());
+ if (hasId()) {
+ atts.addAttribute(null, "id", "id", XMLUtil.CDATA, getId());
}
atts.addAttribute(null, "uri", "uri", XMLUtil.CDATA, getURI());
if (isNewWindow()) {
/** {@inheritDoc} */
public void addResolvedAction(AbstractAction action) throws IFException {
assert action.isComplete();
- PDFAction pdfAction = (PDFAction)this.incompleteActions.remove(action.getID());
+ PDFAction pdfAction = (PDFAction)this.incompleteActions.remove(action.getId());
if (pdfAction == null) {
getAction(action);
} else if (pdfAction instanceof PDFGoTo) {
if (action == null) {
return null;
}
- PDFAction pdfAction = (PDFAction)this.completeActions.get(action.getID());
+ PDFAction pdfAction = (PDFAction)this.completeActions.get(action.getId());
if (pdfAction != null) {
return pdfAction;
} else if (action instanceof GoToXYAction) {
- pdfAction = (PDFAction) incompleteActions.get(action.getID());
+ pdfAction = (PDFAction) incompleteActions.get(action.getId());
if (pdfAction != null) {
return pdfAction;
} else {
if (action.isComplete()) {
updateTargetLocation(pdfGoTo, a);
} else {
- this.incompleteActions.put(action.getID(), pdfGoTo);
+ this.incompleteActions.put(action.getId(), pdfGoTo);
}
return pdfGoTo;
}
//Some PDF actions are pooled
getPDFDoc().registerObject(pdfAction);
}
- this.completeActions.put(action.getID(), pdfAction);
+ this.completeActions.put(action.getId(), pdfAction);
return pdfAction;
} else {
throw new UnsupportedOperationException("Unsupported action type: "
//Queue this object now that it's complete
getPDFDoc().addObject(pdfGoTo);
- this.completeActions.put(action.getID(), pdfGoTo);
+ this.completeActions.put(action.getId(), pdfGoTo);
}
}
implements ContentHandlerFactory.ObjectSource {
/** Logger instance */
- protected static Log log = LogFactory.getLog(PDFExtensionHandler.class);
+ protected static final Log log = LogFactory.getLog(PDFExtensionHandler.class);
private Attributes lastAttributes;
public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
/** logging instance */
- protected static Log log = LogFactory.getLog(PSFontUtils.class);
+ protected static final Log log = LogFactory.getLog(PSFontUtils.class);
/**
* Generates the PostScript code for the font dictionary. This method should only be
* Returns the image URI.
* @return the image URI
*/
- public String getImageURI() {
+ public String getImageUri() {
return this.uri;
}
private void generateFormForImage(PSGenerator gen, PSImageFormResource form)
throws IOException {
- final String uri = form.getImageURI();
+ final String uri = form.getImageUri();
ImageManager manager = userAgent.getFactory().getImageManager();
ImageInfo info = null;
implements ContentHandlerFactory.ObjectSource {
/** Logger instance */
- protected static Log log = LogFactory.getLog(PSExtensionHandler.class);
+ protected static final Log log = LogFactory.getLog(PSExtensionHandler.class);
private StringBuffer content = new StringBuffer();
private Attributes lastAttributes;
attrFont(fobj.getCommonFont(), attrib);
attrFontColor(fobj.getColor(), attrib);
attrTextDecoration(fobj.getTextDecoration(), attrib);
- attrBaseLineShift(fobj.getBaseLineShift(), attrib);
+ attrBaseLineShift(fobj.getBaselineShift(), attrib);
return attrib;
}
private static int paraKeepTogetherOpen = 0;
private static boolean paraResetProperties = false;
- private static ParagraphKeeptogetherContext instance = null;
private ParagraphKeeptogetherContext() {
}
- /**
- * Singelton.
- *
- * @return The instance of ParagraphKeeptogetherContext
- */
- public static ParagraphKeeptogetherContext getInstance() {
- if (instance == null) {
- instance = new ParagraphKeeptogetherContext();
- }
- return instance;
- }
-
/**
* @return the level of current "keep whith next" paragraph
*/
private static final String PARA_KEEP_OFF = "para-keep:off";
private final RtfAttributes attrib;
- private ParagraphKeeptogetherContext paragraphKeeptogetherContext;
RtfJforCmd(RtfContainer parent, Writer w, RtfAttributes attrs) throws IOException {
super((RtfContainer)parent, w);
attrib = attrs;
- paragraphKeeptogetherContext = ParagraphKeeptogetherContext.getInstance();
}
/**
* logging instance
*/
- protected static Log log = LogFactory.getLog(RtfTextrun.class);
+ protected static final Log log = LogFactory.getLog(RtfTextrun.class);
/** Manager for handling space-* property. */
private RtfSpaceManager rtfSpaceManager = new RtfSpaceManager();
//add RtfSpaceSplitter to inherit accumulated space
rtfSpaceManager.pushRtfSpaceSplitter(attrs);
rtfSpaceManager.setCandidate(attrs);
- RtfString r = new RtfString(this, writer, s);
rtfSpaceManager.popRtfSpaceSplitter();
}
ListIterator lit = children.listIterator(children.size());
while (lit.hasPrevious()
&& (lit.previous() instanceof RtfCloseGroupMark)) {
- tmp.push(new Integer(((RtfCloseGroupMark)lit.next()).getBreakType()));
+ tmp.push(Integer.valueOf(((RtfCloseGroupMark)lit.next()).getBreakType()));
lit.remove();
deletedCloseGroupCount++;
}
}
/** {@inheritDoc} */
- public String getNamespace() {
+ public String getNameSpace() {
return null; //Handle all XML content
}
*/
public class FopPrintServlet extends FopServlet {
+ private static final long serialVersionUID = 1645706757391617935L;
+
/**
* {@inheritDoc}
*/
*/
public class FopServlet extends HttpServlet {
+ private static final long serialVersionUID = -908918093488215264L;
+
/** Name of the parameter used for the XSL-FO file */
protected static final String FO_REQUEST_PARAM = "fo";
/** Name of the parameter used for the XML file */
private String outputFormat = MimeConstants.MIME_FOP_AREA_TREE;
private File destdir;
private File compare = null;
- private String baseDir = "./";
+ private String basedir = "./";
private Map differ = new java.util.HashMap();
/**
} else if (args[count].equals("-d")) {
tc.setDebug(true);
} else if (args[count].equals("-b")) {
- tc.setBaseDir(args[++count]);
+ tc.setBasedir(args[++count]);
} else if (args[count].equals("-results")) {
results = args[++count];
} else {
* Sets the base directory.
* @param str base directory
*/
- public void setBaseDir(String str) {
- baseDir = str;
+ public void setBasedir(String str) {
+ basedir = str;
}
/**
logger.debug("running tests in file:" + fname);
try {
if (compDir != null) {
- compare = new File(baseDir + "/" + compDir);
+ compare = new File(basedir + "/" + compDir);
}
- destdir = new File(baseDir + "/" + dest);
+ destdir = new File(basedir + "/" + dest);
destdir.mkdirs();
- File f = new File(baseDir + "/" + fname);
+ File f = new File(basedir + "/" + fname);
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder db = factory.newDocumentBuilder();
Document doc = db.parse(f);
res = resNode.getNodeValue();
}
try {
- File xmlFile = new File(baseDir + "/" + xml);
+ File xmlFile = new File(basedir + "/" + xml);
String baseURL = null;
try {
baseURL = xmlFile.getParentFile().toURI().toURL().toExternalForm();
inputHandler = new InputHandler(xmlFile);
} else {
inputHandler = new InputHandler(xmlFile,
- new File(baseDir + "/"
+ new File(basedir + "/"
+ xsl), null);
}
* Sets the filename for the userconfig.xml.
* @param userConfig Configuration to use
*/
- public void setUserconfig(File userConfig) {
+ public void setUserConfig(File userConfig) {
this.userConfig = userConfig;
}
* Returns the file for the userconfig.xml.
* @return the userconfig.xml file
*/
- public File getUserconfig() {
+ public File getUserConfig() {
return this.userConfig;
}
* Sets the input XSL-FO file.
* @param foFile input XSL-FO file
*/
- public void setFofile(File foFile) {
+ public void setFoFile(File foFile) {
this.foFile = foFile;
}
* Gets the input XSL-FO file.
* @return input XSL-FO file
*/
- public File getFofile() {
+ public File getFoFile() {
return foFile;
}
* default is false.
* @param throwExceptions true if exceptions should be thrown
*/
- public void setThrowexceptions(boolean throwExceptions) {
+ public void setThrowExceptions(boolean throwExceptions) {
this.throwExceptions = throwExceptions;
}
* Gets the throw exceptions attribute
* @return the throw exceptions attribute
*/
- public boolean getThrowexceptions() {
+ public boolean getThrowExceptions() {
return this.throwExceptions;
}
FOPTaskStarter(Fop task) throws SAXException, IOException {
this.task = task;
- if (task.getUserconfig() != null) {
- fopFactory.setUserConfig(task.getUserconfig());
+ if (task.getUserConfig() != null) {
+ fopFactory.setUserConfig(task.getUserConfig());
}
}
}
} else {
try {
- if (task.getFofile() != null) {
- this.baseURL = task.getFofile().getParentFile().toURI().toURL().
+ if (task.getFoFile() != null) {
+ this.baseURL = task.getFoFile().getParentFile().toURI().toURL().
toExternalForm();
}
} catch (MalformedURLException mfue) {
int skippedcount = 0;
// deal with single source file
- if (task.getFofile() != null) {
- if (task.getFofile().exists()) {
+ if (task.getFoFile() != null) {
+ if (task.getFoFile().exists()) {
File outf = task.getOutfile();
if (outf == null) {
throw new BuildException("outfile is required when fofile is used");
// OR output file doesn't exist OR
// output file is older than input file
if (task.getForce() || !outf.exists()
- || (task.getFofile().lastModified() > outf.lastModified() )) {
- render(task.getFofile(), outf, outputFormat);
+ || (task.getFoFile().lastModified() > outf.lastModified() )) {
+ render(task.getFoFile(), outf, outputFormat);
actioncount++;
} else if (outf.exists()
- && (task.getFofile().lastModified() <= outf.lastModified() )) {
+ && (task.getFoFile().lastModified() <= outf.lastModified() )) {
skippedcount++;
}
}
inputHandler.renderTo(userAgent, outputFormat, out);
success = true;
} catch (Exception ex) {
- if (task.getThrowexceptions()) {
+ if (task.getThrowExceptions()) {
throw new BuildException(ex);
}
throw ex;
*/
public class BorderProps implements Serializable {
+ private static final long serialVersionUID = -886871454032189183L;
+
/** Separate border model */
public static final int SEPARATE = 0;
/** Collapsing border model, for borders inside a table */
private static Map colorMap = null;
/** Logger instance */
- protected static Log log = LogFactory.getLog(ColorUtil.class);
+ protected static final Log log = LogFactory.getLog(ColorUtil.class);
static {
initializeColorMap();