public class AggregateTransformer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AggregateTransformer.Format
defines acceptable formats.
|
Modifier and Type | Field and Description |
---|---|
protected static javax.xml.parsers.DocumentBuilderFactory |
dbfactory
XML Parser factory accessible to subclasses
|
protected org.w3c.dom.Document |
document
the xml document to process
|
protected java.lang.String |
format
the format to use for the report.
|
static java.lang.String |
FRAMES
name of the frames format.
|
static java.lang.String |
NOFRAMES
name of the no frames format.
|
protected java.io.File |
styleDir
the style directory.
|
protected Task |
task
Task
|
protected java.io.File |
toDir
the destination directory, this is the root from where html should be generated
|
Constructor and Description |
---|
AggregateTransformer(Task task)
constructor creating the transformer from the junitreport task.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkOptions()
check for invalid options
|
protected 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.
|
Path |
createClasspath()
Creates a classpath to be used for the internal XSLT task.
|
XSLTProcess.Factory |
createFactory()
Creates a factory configuration to be used for the internal XSLT task.
|
XSLTProcess.Param |
createParam()
Create an instance of an XSL parameter for configuration by Ant.
|
protected static javax.xml.parsers.DocumentBuilderFactory |
getDocumentBuilderFactory()
Get the Document Builder Factory
|
protected Resource |
getStylesheet()
access the stylesheet to be used as a resource.
|
protected java.lang.String |
getStylesheetSystemId()
Get the systemid of the appropriate stylesheet based on its
name and styledir.
|
void |
setExtension(java.lang.String ext)
set the extension of the output files
|
void |
setFormat(AggregateTransformer.Format format)
sets the format.
|
void |
setStyledir(java.io.File styledir)
set the style directory.
|
void |
setTodir(java.io.File todir)
set the destination directory.
|
void |
setXmlDocument(org.w3c.dom.Document doc)
sets the input document.
|
protected void |
setXmlfile(java.io.File xmlfile)
Set the xml file to be processed.
|
void |
transform()
transformation
|
public static final java.lang.String FRAMES
public static final java.lang.String NOFRAMES
protected Task task
protected org.w3c.dom.Document document
protected java.io.File styleDir
protected java.io.File toDir
protected java.lang.String format
protected static javax.xml.parsers.DocumentBuilderFactory dbfactory
public AggregateTransformer(Task task)
task
- task delegating to this classprotected static javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory()
public void setFormat(AggregateTransformer.Format format)
format
- Must be FRAMES or NOFRAMESpublic void setXmlDocument(org.w3c.dom.Document doc)
doc
- input dom treeprotected void setXmlfile(java.io.File xmlfile) throws BuildException
xmlfile
- xml file to be processedBuildException
- if the document cannot be parsed.public void setStyledir(java.io.File styledir)
styledir
- the directory containing the xsl files if the user
would like to override with its own style.public void setTodir(java.io.File todir)
todir
- the destination directorypublic void setExtension(java.lang.String ext)
ext
- extension.public XSLTProcess.Param createParam()
public Path createClasspath()
public XSLTProcess.Factory createFactory()
public void transform() throws BuildException
BuildException
- exception if something goes wrong with the transformation.protected Resource getStylesheet()
protected void checkOptions() throws BuildException
BuildException
- if something goes wrong.protected java.lang.String getStylesheetSystemId() throws java.io.IOException
java.io.IOException
- thrown if the requested stylesheet does
not exist.protected void configureForRedirectExtension()