com.sun.tdk.specdiff.html.report

## Class AbstractDiffReportFormatter

- java.lang.Object
- - com.sun.tdk.specdiff.html.AbstractDifferModule
  - - com.sun.tdk.specdiff.html.report.AbstractDiffReportFormatter

- All Implemented Interfaces:
    DifferModule, ReportFormatter
  Direct Known Subclasses:
    DiffReportFormatter

      public abstract class AbstractDiffReportFormatter
      extends AbstractDifferModule
      implements ReportFormatter

  This class is responsible for generating HTML report files out of the provided XML data.

  Subclasses should override `getConfigurationPath()` method to specify the configuration root path.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `CLASS_PARAM`
    `protected java.lang.String` | `GENERIC_HTML_PROBLEM_XSL`
    `protected java.lang.String` | `GENERIC_HTML_REPORT_XSL`
    `protected java.lang.String` | `GENERIC_HTML_STAT_XSL`
    `static java.lang.String` | `PROBLEM_XSL_PARAM_NAME`
    `static java.lang.String` | `REPORT_XSL_PARAM_NAME`
    `static java.lang.String` | `STAT_XSL_PARAM_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractDiffReportFormatter()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ReportFormatter` | `createReportFormatter(java.util.Map<java.lang.String,java.lang.Object> diffParams, java.lang.Class<? extends ReportFormatter> defaultClass)` Factory method that constructs a new instance of `ReportFormatter` based on the configuration properties passed via `map`.
    `java.io.File` | `format(java.io.File xmlReportFile, java.io.File xmlStatFile)` Produce human-readable reports from XML diff report at `xmlReportFile` and XML statistics report at `xmlStatFile`
    `protected abstract java.lang.String` | `getConfigurationPath()` Returns path to be used for the configuration files lookup.
    `java.lang.String` | `getProblemXsl()`
    `java.lang.String` | `getReportCaption()`
    `java.lang.String` | `getReportXsl()`
    `java.lang.String` | `getStatisticsXsl()`
    `protected java.io.File` | `htmlIndex()` Produces 'index-like' HTML page
    `protected java.io.File` | `htmlProblem(java.io.File xmlStatFile)` Produces 'problem' HTML for XML statistics report `xmlStatFile`
    `protected java.io.File` | `htmlReport(java.io.File xmlReportFile)` Produces HTML for XML diff report `xmlReportFile`
    `protected java.io.File` | `htmlStat(java.io.File xmlStatFile)` Produces 'statistics' HTML for XML statistics report `xmlStatFile`
    `void` | `init(java.lang.String oldPath, java.lang.String newPath, java.lang.String fileName, java.io.File outDir)`
    `void` | `setHtmlReportFile(java.io.File htmlReportFile)` HTML report file setter.
    `void` | `setHtmlStatFile(java.io.File htmlStatFile)` HTML statistics file setter.
    `void` | `setIndexHtmlFile(java.io.File indexHtmlFile)` HTML index file setter.
    `void` | `setPackageName(java.lang.String packageName)` Sets package file name (without extension) to identify packages in the doc tree
    `void` | `setPicsDir(java.io.File picsDir)` The href to folder with resources (pictures)
    `void` | `setProblemXsl(java.lang.String problemXsl)` Gets/Sets resource name to call problems XSLT
    `void` | `setReportCaption(java.lang.String reportCaption)` Gets/Sets HTML report title
    `void` | `setReportXsl(java.lang.String reportXsl)` Gets/Sets resource name to call report XSLT
    `void` | `setStatisticsXsl(java.lang.String statXsl)` Gets/Sets resource name to call statistics XSLT
    `void` | `setupOverview(java.io.File rootDir, java.lang.String overviewName)` Sets overview file name (without extension) to identify overview in the doc tree

    - ### Methods inherited from class com.sun.tdk.specdiff.html.AbstractDifferModule

      `getFileName, getNewPath, getOldPath, getOutDir, getParameters`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.sun.tdk.specdiff.html.DifferModule

      `getParameters`

- - ### Field Detail

    - #### CLASS_PARAM

          public static final java.lang.String CLASS_PARAM

      See Also:
        Constant Field Values

    - #### REPORT_XSL_PARAM_NAME

          public static final java.lang.String REPORT_XSL_PARAM_NAME

      See Also:
        Constant Field Values

    - #### STAT_XSL_PARAM_NAME

          public static final java.lang.String STAT_XSL_PARAM_NAME

      See Also:
        Constant Field Values

    - #### PROBLEM_XSL_PARAM_NAME

          public static final java.lang.String PROBLEM_XSL_PARAM_NAME

      See Also:
        Constant Field Values

    - #### GENERIC_HTML_REPORT_XSL

          protected final java.lang.String GENERIC_HTML_REPORT_XSL

    - #### GENERIC_HTML_STAT_XSL

          protected final java.lang.String GENERIC_HTML_STAT_XSL

    - #### GENERIC_HTML_PROBLEM_XSL

          protected final java.lang.String GENERIC_HTML_PROBLEM_XSL

  - ### Constructor Detail

    - #### AbstractDiffReportFormatter

          public AbstractDiffReportFormatter()

  - ### Method Detail

    - #### getConfigurationPath

          protected abstract java.lang.String getConfigurationPath()

      Returns path to be used for the configuration files lookup. Subclasses should override this method to direct the configuration workflow.

      Note: this method is used at the object construction phase and overriders might observe not-yet-initialized object fields.

    - #### createReportFormatter

          public static ReportFormatter createReportFormatter(java.util.Map<java.lang.String,java.lang.Object> diffParams,
                                                              java.lang.Class<? extends ReportFormatter> defaultClass)

      Factory method that constructs a new instance of `ReportFormatter` based on the configuration properties passed via `map`.
      Parameters:
        `diffParams` - diff parameters; may be null, in which case a default report formatter will be used
        `defaultClass` - a fallback value to be used if map is null or map does not contain the formatter class property
      Throws:
        `java.lang.RuntimeException` - if class was not found or failed to be instantiated
        `java.lang.IllegalArgumentException` - if both arguments are null

    - #### init

          public void init(java.lang.String oldPath,
                           java.lang.String newPath,
                           java.lang.String fileName,
                           java.io.File outDir)

      Specified by:
        `init` in interface `DifferModule`
      Overrides:
        `init` in class `AbstractDifferModule`

    - #### setupOverview

          public void setupOverview(java.io.File rootDir,
                                    java.lang.String overviewName)

      Sets overview file name (without extension) to identify overview in the doc tree

    - #### setPackageName

          public void setPackageName(java.lang.String packageName)

      Sets package file name (without extension) to identify packages in the doc tree

    - #### setPicsDir

          public void setPicsDir(java.io.File picsDir)

      The href to folder with resources (pictures)

    - #### setHtmlReportFile

          public void setHtmlReportFile(java.io.File htmlReportFile)

      HTML report file setter.

    - #### setHtmlStatFile

          public void setHtmlStatFile(java.io.File htmlStatFile)

      HTML statistics file setter.

    - #### setIndexHtmlFile

          public void setIndexHtmlFile(java.io.File indexHtmlFile)

      HTML index file setter.

    - #### setStatisticsXsl

          public void setStatisticsXsl(java.lang.String statXsl)

      Gets/Sets resource name to call statistics XSLT

    - #### getStatisticsXsl

          public java.lang.String getStatisticsXsl()

    - #### setProblemXsl

          public void setProblemXsl(java.lang.String problemXsl)

      Gets/Sets resource name to call problems XSLT

    - #### getProblemXsl

          public java.lang.String getProblemXsl()

    - #### setReportXsl

          public void setReportXsl(java.lang.String reportXsl)

      Gets/Sets resource name to call report XSLT

    - #### getReportXsl

          public java.lang.String getReportXsl()

    - #### setReportCaption

          public void setReportCaption(java.lang.String reportCaption)

      Gets/Sets HTML report title

    - #### getReportCaption

          public java.lang.String getReportCaption()

    - #### format

          public java.io.File format(java.io.File xmlReportFile,
                                     java.io.File xmlStatFile)
                              throws java.io.IOException

      Description copied from interface: `ReportFormatter`
      Produce human-readable reports from XML diff report at `xmlReportFile` and XML statistics report at `xmlStatFile`
      Specified by:
        `format` in interface `ReportFormatter`
      Throws:
        `java.io.IOException`

    - #### htmlReport

          protected java.io.File htmlReport(java.io.File xmlReportFile)
                                     throws java.io.IOException

      Produces HTML for XML diff report `xmlReportFile`
      Throws:
        `java.io.IOException`

    - #### htmlStat

          protected java.io.File htmlStat(java.io.File xmlStatFile)
                                   throws java.io.IOException

      Produces 'statistics' HTML for XML statistics report `xmlStatFile`
      Throws:
        `java.io.IOException`

    - #### htmlProblem

          protected java.io.File htmlProblem(java.io.File xmlStatFile)
                                      throws java.io.IOException

      Produces 'problem' HTML for XML statistics report `xmlStatFile`
      Throws:
        `java.io.IOException`

    - #### htmlIndex

          protected java.io.File htmlIndex()
                                    throws java.io.IOException

      Produces 'index-like' HTML page
      Throws:
        `java.io.IOException`