public class XmlReportWriter extends ReportWriter
| Modifier and Type | Class and Description |
|---|---|
static interface |
XmlReportWriter.FragmentWriter<T>
A writer of an XML report fragment.
|
| Constructor and Description |
|---|
XmlReportWriter(org.gradle.api.reporting.SingleFileReport pReport,
java.nio.file.OpenOption... pOpenOptions)
Create a new
XmlReportWriter. |
| Modifier and Type | Method and Description |
|---|---|
void |
writeAttribute(java.lang.String pName,
long pValue)
Write a numeric attribute of the current element.
|
void |
writeAttribute(java.lang.String pName,
java.lang.String pValue)
Write an attribute of the current element.
|
<T> void |
writeElement(java.lang.String pElementName,
XmlReportWriter.FragmentWriter<T> pBodyWriter,
T pBody)
Write an element with a body and no attributes.
|
<T> void |
writeElement(java.lang.String pElementName,
XmlReportWriter.FragmentWriter<T> pAttributeWriter,
XmlReportWriter.FragmentWriter<T> pBodyWriter,
T pElement)
Write an element with attributes and a body.
|
void |
writeElementEnd(java.lang.String pElementName)
Write the closing tag of an element on a separate line.
|
void |
writeElementStart(java.lang.String pElementName)
Write the opening tag of an element without attributes on a separate line.
|
<T> void |
writeElementStart(java.lang.String pElementName,
XmlReportWriter.FragmentWriter<T> pAttributeWriter,
T pAttributes)
Write the opening tag of an element with attributes on a separate line.
|
void |
writeEmptyElement(java.lang.String pElementName)
Write an element without attributes and body on a single line.
|
<T> void |
writeEmptyElement(java.lang.String pElementName,
XmlReportWriter.FragmentWriter<T> pAttributeWriter,
T pAttributes)
Write an element with attributes and no body on a single line.
|
void |
writeEscaped(java.lang.String pValue)
Write an attribute value, escaping any special XML characters such as '<'.
|
void |
writeProlog()
Write the XML prolog to the underlying stream.
|
<T> void |
writeSequence(java.lang.String pRootElementName,
java.lang.String pChildElementName,
XmlReportWriter.FragmentWriter<T> pChildAttributeWriter,
XmlReportWriter.FragmentWriter<T> pChildBodyWriter,
java.lang.Iterable<T> pChildren)
Write a sequence of elements as child elements to a sequence root element, which in its turn
is a child element to the current element.
|
close, decreaseIndentationLevel, flush, increaseIndentationLevel, write, write, write, writeIndentation, writeLineBreakpublic XmlReportWriter(org.gradle.api.reporting.SingleFileReport pReport,
java.nio.file.OpenOption... pOpenOptions)
throws java.io.IOException
XmlReportWriter.pReport - The report to write.pOpenOptions - Any options to specify when opening the report's file.java.io.IOException - if opening the report's destination file fails.java.lang.NullPointerException - if any of the parameters is null.public void writeProlog()
throws java.io.IOException
java.io.IOException - if writing to the report file fails.public <T> void writeElement(java.lang.String pElementName,
XmlReportWriter.FragmentWriter<T> pAttributeWriter,
XmlReportWriter.FragmentWriter<T> pBodyWriter,
T pElement)
throws java.io.IOException
T - The type holding the element data.pElementName - The name of the element.pAttributeWriter - A writer of the element's attributes.pBodyWriter - A writer of the element's body.pElement - The element's data.java.io.IOException - if writing to the report file fails.java.lang.NullPointerException - if pElementName or one of the writers is null.public <T> void writeElement(java.lang.String pElementName,
XmlReportWriter.FragmentWriter<T> pBodyWriter,
T pBody)
throws java.io.IOException
T - The type holding the body data.pElementName - The name of the element.pBodyWriter - A writer of the element's body.pBody - The body's data.java.io.IOException - if writing to the report file fails.java.lang.NullPointerException - if pElementName or pBodyWriter is null.public <T> void writeEmptyElement(java.lang.String pElementName,
XmlReportWriter.FragmentWriter<T> pAttributeWriter,
T pAttributes)
throws java.io.IOException
T - The type holding the attribute data.pElementName - The name of the element.pAttributeWriter - A writer of the element's attributes.pAttributes - The attributes' data.java.io.IOException - if writing to the report file fails.java.lang.NullPointerException - if pElementName or pAttributeWriter is null.public void writeEmptyElement(java.lang.String pElementName)
throws java.io.IOException
pElementName - The name of the element.java.io.IOException - if writing to the report file fails.java.lang.NullPointerException - if pElementName is null.public void writeElementStart(java.lang.String pElementName)
throws java.io.IOException
pElementName - The name of the element.java.io.IOException - if writing to the report file fails.java.lang.NullPointerException - if any of the parameters is null.public <T> void writeElementStart(java.lang.String pElementName,
XmlReportWriter.FragmentWriter<T> pAttributeWriter,
T pAttributes)
throws java.io.IOException
T - The type holding the attribute data.pElementName - The name of the element.pAttributeWriter - A writer of the element's attributes.pAttributes - The attributes' data.java.io.IOException - if writing to the report file fails.java.lang.NullPointerException - if pElementName or pAttributeWriter is null.public void writeElementEnd(java.lang.String pElementName)
throws java.io.IOException
pElementName - The name of the element.java.io.IOException - if writing to the report file fails.java.lang.NullPointerException - if pName is null.public <T> void writeSequence(java.lang.String pRootElementName,
java.lang.String pChildElementName,
XmlReportWriter.FragmentWriter<T> pChildAttributeWriter,
XmlReportWriter.FragmentWriter<T> pChildBodyWriter,
java.lang.Iterable<T> pChildren)
throws java.io.IOException
Example:
<sequence-root> <sequence-child/> <sequence-child/> </sequence-root>
T - The type containing child element data.pRootElementName - The name of the sequence root element.pChildElementName - The name of the sequence child elements.pChildAttributeWriter - A writer of the attributes of each child element.pChildBodyWriter - A writer of the body of each child element.pChildren - The instances with the values for the child elements.java.io.IOException - if writing to the report file fails.java.lang.NullPointerException - if any of the reference parameters is null.public void writeAttribute(java.lang.String pName,
java.lang.String pValue)
throws java.io.IOException
pName - The attribute's name.pValue - The attribute's value.java.io.IOException - if writing to the report file fails.java.lang.NullPointerException - if any of the parameters is null.public void writeAttribute(java.lang.String pName,
long pValue)
throws java.io.IOException
pName - The attribute's name.pValue - The attribute's value.java.io.IOException - if writing to the report file fails.java.lang.NullPointerException - if pName is null.public void writeEscaped(java.lang.String pValue)
throws java.io.IOException
pValue - The attribute value.java.io.IOException - if writing to the report file fails.java.lang.NullPointerException - if pValue is null.