Package org.apache.batik.test.xml
Class XSLXMLReportConsumer
- java.lang.Object
-
- org.apache.batik.test.xml.XSLXMLReportConsumer
-
- All Implemented Interfaces:
XMLTestReportProcessor.XMLReportConsumer
public class XSLXMLReportConsumer extends java.lang.Object implements XMLTestReportProcessor.XMLReportConsumer
This implementation of theXMLTestReportProcessor.XMLReportConsumerinterface simply applies an XSL transformation to the input XML file and stores the result in a configurable directory.- Version:
- $Id: XSLXMLReportConsumer.java 1803263 2017-07-28 10:51:01Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringERROR_OUTPUT_DIRECTORY_UNUSABLEError code used when the output directory cannot be usedprivate java.lang.StringoutputDirectoryOutput directory, i.e., the directory where the result of the XSL transformation will be stored.private java.lang.StringoutputFileNameOutput file nameprivate java.lang.StringstylesheetStylesheet URI
-
Constructor Summary
Constructors Constructor Description XSLXMLReportConsumer(java.lang.String stylesheet, java.lang.String outputDirectory, java.lang.String outputFileName)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckDirectory(java.io.File dir)Checks that the input File represents a directory that can be used.java.io.FilecreateNewReportOutput(java.io.File reportDirectory)Returns a new file in the outputDirectory, with the requested report name.voidonNewReport(java.io.File xmlReport, java.io.File reportDirectory)When a new report has been generated, this consumer applies the same stylesheet to the input XML document
-
-
-
Field Detail
-
ERROR_OUTPUT_DIRECTORY_UNUSABLE
public static final java.lang.String ERROR_OUTPUT_DIRECTORY_UNUSABLE
Error code used when the output directory cannot be used- See Also:
- Constant Field Values
-
stylesheet
private java.lang.String stylesheet
Stylesheet URI
-
outputDirectory
private java.lang.String outputDirectory
Output directory, i.e., the directory where the result of the XSL transformation will be stored.
-
outputFileName
private java.lang.String outputFileName
Output file name
-
-
Constructor Detail
-
XSLXMLReportConsumer
public XSLXMLReportConsumer(java.lang.String stylesheet, java.lang.String outputDirectory, java.lang.String outputFileName)Constructor- Parameters:
stylesheet- URI for the stylesheet to apply to the XML reportoutputDirectory- directory where the result of the XSL transformation should be writtenoutputFileName- name of the output report.
-
-
Method Detail
-
onNewReport
public void onNewReport(java.io.File xmlReport, java.io.File reportDirectory) throws java.lang.ExceptionWhen a new report has been generated, this consumer applies the same stylesheet to the input XML document- Specified by:
onNewReportin interfaceXMLTestReportProcessor.XMLReportConsumer- Parameters:
xmlReport- file containing the xml reportreportDirectory- base directory where any resource relative to the report processing should be stored.- Throws:
java.lang.Exception
-
createNewReportOutput
public java.io.File createNewReportOutput(java.io.File reportDirectory) throws java.lang.ExceptionReturns a new file in the outputDirectory, with the requested report name.- Throws:
java.lang.Exception
-
checkDirectory
public void checkDirectory(java.io.File dir) throws TestExceptionChecks that the input File represents a directory that can be used. If the directory does not exist, this method will attempt to create it.- Throws:
TestException
-
-