Package org.apache.rat.report.xml
Class XmlElements
java.lang.Object
org.apache.rat.report.xml.XmlElements
Creates the elements in the XML report.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The attributes of elements in the report.static enum
The elements in the report. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCloses the currently open element.Creates a document element with attributes.documentType
(String name, int count) Creates a statistic element.Creates a license element.licenseCategory
(String name, int count) Creates a statistic element.licenseName
(String name, int count) Creates a statistic element.Create the Rat report element.Creates a statistic element.Creates a statistics element.version()
Creates the version element with all version attributes populated.write
(XmlElements.Attributes attribute, String value) Write an attribute.
-
Constructor Details
-
XmlElements
Constructor.- Parameters:
xmlWriter
- The writer to use.
-
-
Method Details
-
ratReport
Create the Rat report element. Includes the timestamp and the version element.- Returns:
- this.
- Throws:
RatException
- on error
-
version
Creates the version element with all version attributes populated. Closes the version element.- Returns:
- this.
- Throws:
RatException
- on error
-
license
Creates a license element. Closes the element before exit.- Parameters:
license
- the license for the element.approved
-true
if the license is approved.- Returns:
- this
- Throws:
RatException
- on error.
-
document
Creates a document element with attributes. Does NOT close the document element.- Parameters:
document
- the document to write.- Returns:
- this
- Throws:
RatException
- on error.
-
statistics
Creates a statistics element.- Returns:
- this
- Throws:
RatException
- on error.
-
statistic
public XmlElements statistic(String name, int count, String description, boolean isOk) throws RatException Creates a statistic element. Closes the element before returning.- Parameters:
name
- the name of the statistics element.count
- the count for the element.description
- description of this statistic.isOk
- iftrue
the count is within limits.- Returns:
- this
- Throws:
RatException
- on error.
-
licenseCategory
Creates a statistic element. Closes the element before returning.- Parameters:
name
- the name of the statistics element.count
- the count for the element.- Returns:
- this
- Throws:
RatException
- on error.
-
licenseName
Creates a statistic element. Closes the element before returning.- Parameters:
name
- the name of the statistics element.count
- the count for the element.- Returns:
- this
- Throws:
RatException
- on error.
-
documentType
Creates a statistic element. Closes the element before returning.- Parameters:
name
- the name of the statistics element.count
- the count for the element.- Returns:
- this
- Throws:
RatException
- on error.
-
closeElement
Closes the currently open element.- Returns:
- this
- Throws:
RatException
- on error.
-
write
Write an attribute.- Parameters:
attribute
- the attribute name.value
- the attribute value.- Returns:
- this
- Throws:
RatException
- on error.
-