Class XmlElements

java.lang.Object
org.apache.rat.report.xml.XmlElements

public class XmlElements extends Object
Creates the elements in the XML report.
  • Constructor Details

    • XmlElements

      public XmlElements(IXmlWriter xmlWriter)
      Constructor.
      Parameters:
      xmlWriter - The writer to use.
  • Method Details

    • ratReport

      public XmlElements ratReport() throws RatException
      Create the Rat report element. Includes the timestamp and the version element.
      Returns:
      this.
      Throws:
      RatException - on error
    • version

      public XmlElements version() throws RatException
      Creates the version element with all version attributes populated. Closes the version element.
      Returns:
      this.
      Throws:
      RatException - on error
    • license

      public XmlElements license(ILicense license, boolean approved) throws RatException
      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

      public XmlElements document(Document document) throws RatException
      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

      public XmlElements statistics() throws RatException
      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 - if true the count is within limits.
      Returns:
      this
      Throws:
      RatException - on error.
    • licenseCategory

      public XmlElements licenseCategory(String name, int count) 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.
      Returns:
      this
      Throws:
      RatException - on error.
    • licenseName

      public XmlElements licenseName(String name, int count) 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.
      Returns:
      this
      Throws:
      RatException - on error.
    • documentType

      public XmlElements documentType(String name, int count) 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.
      Returns:
      this
      Throws:
      RatException - on error.
    • closeElement

      public XmlElements closeElement() throws RatException
      Closes the currently open element.
      Returns:
      this
      Throws:
      RatException - on error.
    • write

      public XmlElements write(XmlElements.Attributes attribute, String value) throws RatException
      Write an attribute.
      Parameters:
      attribute - the attribute name.
      value - the attribute value.
      Returns:
      this
      Throws:
      RatException - on error.