de.smartics.maven.util.report
Class ExternalReportReferences

Package class diagram package ExternalReportReferences
java.lang.Object
  extended by de.smartics.maven.util.report.ExternalReportReferences

public class ExternalReportReferences
     
     
extends Object

Manages report instances.


Field Summary
static ExternalReportReferences EMPTY
          An empty report reference instance that prohibits adding information.
 
Constructor Summary
ExternalReportReferences(ExternalReportFactory factory)
          Default constructor.
 
Method Summary
 void addReportId(ReportId reportId)
          Adds the report ID to the list of IDs to render report references.
 ExternalReport get(ReportId reportId)
          Returns the report with the given ID.
 List<ReportId> getReportIds()
          Returns the list of report IDs that are to referenced.
 List<ExternalReport> getReports()
          Returns the ordered list of report IDs to render.
 List<ExternalReport> getReports(List<ReportId> reportIds)
          Returns the list of reports with the given IDs.
 boolean registerReport(boolean create, ReportId reportId, LinkConstructorStrategy strategy)
          Registers a report with the given identifier and strategy with a guard.
 boolean registerReport(ReportId reportId, LinkConstructorStrategy strategy)
          Registers a report with the given identifier and strategy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final ExternalReportReferences EMPTY
An empty report reference instance that prohibits adding information.

Constructor Detail

ExternalReportReferences

public ExternalReportReferences(ExternalReportFactory factory)
Default constructor.

Method Detail

addReportId

public void addReportId(ReportId reportId)
                 throws org.apache.commons.lang.NullArgumentException
Adds the report ID to the list of IDs to render report references.

Parameters:
reportId - the report ID to add.
Throws:
org.apache.commons.lang.NullArgumentException - if reportId is null.

getReportIds

public List<ReportId> getReportIds()
Returns the list of report IDs that are to referenced.

Returns:
the list of report IDs

getReports

public List<ExternalReport> getReports()
Returns the ordered list of report IDs to render.

Returns:
the ordered list of report IDs to render.

registerReport

public boolean registerReport(ReportId reportId,
                              LinkConstructorStrategy strategy)
Registers a report with the given identifier and strategy.

Note that no report will be registered, if the factory of this instance is not set.

Parameters:
reportId - the identifier of the report to register.
strategy - the link constructor strategy to use.
Returns:
true if the report has been created and registered, false otherwise.

registerReport

public boolean registerReport(boolean create,
                              ReportId reportId,
                              LinkConstructorStrategy strategy)
Registers a report with the given identifier and strategy with a guard. The guard allows to conveniently call this method without the burden of specifying an if block on the caller's side.

Note that no report will be registered, if the factory of this instance is not set.

Parameters:
create - convenience flag to not register the instance.
reportId - the identifier of the report to register.
strategy - the link constructor strategy to use.
Returns:
true if the report has been created and registered, false otherwise.

get

public ExternalReport get(ReportId reportId)
Returns the report with the given ID.

Parameters:
reportId - the ID of the requested report.
Returns:
the requested report instance or null if the ID does not reference to such an instance.

getReports

public List<ExternalReport> getReports(List<ReportId> reportIds)
Returns the list of reports with the given IDs.

Parameters:
reportIds - the IDs of the requested reports.
Returns:
the list of reports, which may be empty, but is never null.


Copyright © 2006-2012 Kronseder & Reiner GmbH - smartics. All Rights Reserved.