Class AbstractVersionsReportRenderer<T>

java.lang.Object
org.apache.maven.reporting.AbstractMavenReportRenderer
org.codehaus.mojo.versions.reporting.VersionsReportRendererBase
org.codehaus.mojo.versions.reporting.AbstractVersionsReportRenderer<T>
Type Parameters:
T - modelled report object
All Implemented Interfaces:
org.apache.maven.reporting.MavenReportRenderer, ReportRenderer
Direct Known Subclasses:
DependencyUpdatesReportRenderer, PluginUpdatesReportRenderer, PropertyUpdatesReportRenderer

public abstract class AbstractVersionsReportRenderer<T> extends VersionsReportRendererBase implements ReportRenderer
Base class for report renderers.
Since:
1.0-beta-1
Author:
Stephen Connolly
  • Field Details

    • model

      protected T model
      Model of the object being rendered
      Since:
      2.13.0
    • newestUpdateCache

      protected final ArtifactVersionsCache newestUpdateCache
    • allUpdatesCache

      protected final ArtifactVersionsCache allUpdatesCache
    • headerAttributes

      protected final org.apache.maven.doxia.sink.SinkEventAttributes headerAttributes
  • Constructor Details

    • AbstractVersionsReportRenderer

      protected AbstractVersionsReportRenderer(org.codehaus.plexus.i18n.I18N i18n, org.apache.maven.doxia.sink.Sink sink, Locale locale, String bundleName, T model, boolean allowSnapshots)
  • Method Details

    • renderBody

      protected void renderBody()
      Specified by:
      renderBody in class org.apache.maven.reporting.AbstractMavenReportRenderer
    • renderOverview

      protected void renderOverview()
      Renders the "Overview" table
    • renderManagementSummaryTable

      protected abstract void renderManagementSummaryTable()
      Renders the "management" (dependencyManagement, pluginManagement, etc.) summary table
    • renderSummaryTable

      protected abstract void renderSummaryTable()
      Renders the regular ("dependencies", "plugins", etc.) summary table
    • renderOverviewTableRow

      protected <Q extends OverviewStats> void renderOverviewTableRow(Q stats)
      Renders the singular summary table row
      Type Parameters:
      Q - concrete OverviewStats class
      Parameters:
      stats - summary statistics object to render
    • renderStatRow

      protected void renderStatRow(String textKey, int statCount, boolean forceSuccessIcon)
      Renders one table row for the given statistics.
      Parameters:
      textKey - the key of the text to be rendered.
      statCount - the number of artifacts with the given stat.
      forceSuccessIcon - if true, the success icon will be rendered regardless.
    • renderIcon

      protected void renderIcon(boolean success)
      Renders the success or warning icon.
      Parameters:
      success - if true, the success icon will be rendered, otherwise the warning icon will be rendered.
    • computeOverviewStats

      protected abstract <Q extends OverviewStats> Q computeOverviewStats()
      Computes the OverviewStats object needed to render the summary table row
      Type Parameters:
      Q - concrete OverviewStats class
      Returns:
      stats object
    • renderDetails

      protected abstract void renderDetails()
      Renders the details table
    • renderSummaryTable

      protected void renderSummaryTable(Map<org.apache.maven.model.Dependency,ArtifactVersions> contents, boolean hasScope)
    • renderSummaryTableHeader

      protected void renderSummaryTableHeader(boolean hasScope, boolean hasType)
    • renderSummaryTableRow

      protected void renderSummaryTableRow(org.apache.maven.model.Dependency artifact, ArtifactVersions details, boolean includeScope)
    • renderNewestVersions

      protected void renderNewestVersions(AbstractVersionDetails details)
      Renders the newest versions for the given artifact.
      Parameters:
      details - the artifact for which to render the newest versions.
    • renderDependencyDetailTable

      protected void renderDependencyDetailTable(org.apache.maven.model.Dependency artifact, ArtifactVersions details, boolean includeScope)
    • renderTwoCellsRow

      protected void renderTwoCellsRow(String textKey, String textValue)
      Renders a row of two cells, the first cell being an header and the second cell being a non-header cell.
      Parameters:
      textKey - the key of the text to be rendered.
      textValue - the value of the text to be rendered.
    • renderTwoCellsRow

      protected void renderTwoCellsRow(String textKey, Runnable runnable)
      Renders a row of two cells, the first cell being an header and the second cell being a non-header cell.
      Parameters:
      textKey - the key of the text to be rendered.
      runnable - the runnable to be executed to render the second cell content.
    • renderStatus

      protected void renderStatus(AbstractVersionDetails details)
      Renders the status of the given artifact.
      Parameters:
      details - the artifact for which to render the status.
    • renderVersions

      protected void renderVersions(org.apache.maven.artifact.versioning.ArtifactVersion[] allUpdates, AbstractVersionDetails details)
      Renders the list of versions that are available for the given artifact or property.
      Parameters:
      allUpdates - the list of all updates available.
      details - the versions details for the given artifact or property.
    • getLabel

      protected String getLabel(org.apache.maven.artifact.versioning.ArtifactVersion version, AbstractVersionDetails details)
      Returns a text label to describe if the given version is a major, minor, incremental or subincremental update.
      Parameters:
      version - the version to describe.
      details - the artifact for which to render the versions.
      Returns:
      a text label to describe if the given version is a major, minor, incremental or subincremental update.