Class AggregateTransformer
- java.lang.Object
- 
- org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer
 
- 
 public class AggregateTransformer extends java.lang.ObjectTransform a JUnit xml report. The default transformation generates an html report in either framed or non-framed style. The non-framed style is convenient to have a concise report via mail, the framed report is much more convenient if you want to browse into different packages or testcases since it is a Javadoc like report.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classAggregateTransformer.Formatdefines acceptable formats.
 - 
Field SummaryFields Modifier and Type Field Description protected static javax.xml.parsers.DocumentBuilderFactorydbfactoryXML Parser factory accessible to subclassesprotected org.w3c.dom.Documentdocumentthe xml document to processprotected java.lang.Stringformatthe format to use for the report.static java.lang.StringFRAMESname of the frames format.static java.lang.StringNOFRAMESname of the no frames format.protected java.io.FilestyleDirthe style directory.protected TasktaskTaskprotected java.io.FiletoDirthe destination directory, this is the root from where html should be generated
 - 
Constructor SummaryConstructors Constructor Description AggregateTransformer(Task task)constructor creating the transformer from the junitreport task.
 - 
Method SummaryModifier and Type Method Description protected voidcheckOptions()check for invalid optionsprotected voidconfigureForRedirectExtension()If we end up using the JDK's own TraX factory on Java 9+, then set the features and attributes necessary to allow redirect extensions to be used.PathcreateClasspath()Creates a classpath to be used for the internal XSLT task.XSLTProcess.FactorycreateFactory()Creates a factory configuration to be used for the internal XSLT task.XSLTProcess.ParamcreateParam()Create an instance of an XSL parameter for configuration by Ant.protected static javax.xml.parsers.DocumentBuilderFactorygetDocumentBuilderFactory()Get the Document Builder Factoryprotected ResourcegetStylesheet()access the stylesheet to be used as a resource.protected java.lang.StringgetStylesheetSystemId()Get the systemid of the appropriate stylesheet based on its name and styledir.voidsetExtension(java.lang.String ext)set the extension of the output filesvoidsetFormat(AggregateTransformer.Format format)sets the format.voidsetStyledir(java.io.File styledir)set the style directory.voidsetTodir(java.io.File todir)set the destination directory.voidsetXmlDocument(org.w3c.dom.Document doc)sets the input document.protected voidsetXmlfile(java.io.File xmlfile)Set the xml file to be processed.voidtransform()transformation
 
- 
- 
- 
Field Detail- 
FRAMESpublic static final java.lang.String FRAMES name of the frames format.- See Also:
- Constant Field Values
 
 - 
NOFRAMESpublic static final java.lang.String NOFRAMES name of the no frames format.- See Also:
- Constant Field Values
 
 - 
dbfactoryprotected static javax.xml.parsers.DocumentBuilderFactory dbfactory XML Parser factory accessible to subclasses
 - 
taskprotected Task task Task
 - 
documentprotected org.w3c.dom.Document document the xml document to process
 - 
styleDirprotected java.io.File styleDir the style directory. XSLs should be read from here if necessary
 - 
toDirprotected java.io.File toDir the destination directory, this is the root from where html should be generated
 - 
formatprotected java.lang.String format the format to use for the report. Must beFRAMESorNOFRAMES
 
- 
 - 
Constructor Detail- 
AggregateTransformerpublic AggregateTransformer(Task task) constructor creating the transformer from the junitreport task.- Parameters:
- task- task delegating to this class
 
 
- 
 - 
Method Detail- 
getDocumentBuilderFactoryprotected static javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory() Get the Document Builder Factory- Returns:
- the DocumentBuilderFactory instance in use
 
 - 
setFormatpublic void setFormat(AggregateTransformer.Format format) sets the format.- Parameters:
- format- Must be- FRAMESor- NOFRAMES
 
 - 
setXmlDocumentpublic void setXmlDocument(org.w3c.dom.Document doc) sets the input document.- Parameters:
- doc- input dom tree
 
 - 
setXmlfileprotected void setXmlfile(java.io.File xmlfile) throws BuildExceptionSet the xml file to be processed. This is a helper if you want to set the file directly. Much more for testing purposes.- Parameters:
- xmlfile- xml file to be processed
- Throws:
- BuildException- if the document cannot be parsed.
 
 - 
setStyledirpublic void setStyledir(java.io.File styledir) set the style directory. It is optional and will override the default xsl used.- Parameters:
- styledir- the directory containing the xsl files if the user would like to override with its own style.
 
 - 
setTodirpublic void setTodir(java.io.File todir) set the destination directory.- Parameters:
- todir- the destination directory
 
 - 
setExtensionpublic void setExtension(java.lang.String ext) set the extension of the output files- Parameters:
- ext- extension.
 
 - 
createParampublic XSLTProcess.Param createParam() Create an instance of an XSL parameter for configuration by Ant.- Returns:
- an instance of the Param class to be configured.
- Since:
- Ant 1.7
 
 - 
createClasspathpublic Path createClasspath() Creates a classpath to be used for the internal XSLT task.- Returns:
- the classpath to be configured
- Since:
- Ant 1.9.5
 
 - 
createFactorypublic XSLTProcess.Factory createFactory() Creates a factory configuration to be used for the internal XSLT task.- Returns:
- the factory description to be configured
- Since:
- Ant 1.9.5
 
 - 
transformpublic void transform() throws BuildExceptiontransformation- Throws:
- BuildException- exception if something goes wrong with the transformation.
 
 - 
getStylesheetprotected Resource getStylesheet() access the stylesheet to be used as a resource.- Returns:
- stylesheet as a resource
 
 - 
checkOptionsprotected void checkOptions() throws BuildExceptioncheck for invalid options- Throws:
- BuildException- if something goes wrong.
 
 - 
getStylesheetSystemIdprotected java.lang.String getStylesheetSystemId() throws java.io.IOExceptionGet the systemid of the appropriate stylesheet based on its name and styledir. If no styledir is defined it will load it as a java resource in the xsl child package, otherwise it will get it from the given directory.- Returns:
- system ID of the stylesheet.
- Throws:
- java.io.IOException- thrown if the requested stylesheet does not exist.
 
 - 
configureForRedirectExtensionprotected void configureForRedirectExtension() If we end up using the JDK's own TraX factory on Java 9+, then set the features and attributes necessary to allow redirect extensions to be used.- Since:
- Ant 1.9.8
 
 
- 
 
-