Package org.opengis.test.report
Class OperationParametersReport
-
public class OperationParametersReport extends Report
Generates a list of operations (typically map projections) and their parameters. The operations are described by instances of anIdentifiedObjectsubtype, for example coordinatesOperationMethod. Each operation can be associated to aParameterDescriptorGroupinstance. Those elements can be added individually in the rows list. Alternatively, a convenience method can be used for adding all operation methods available from a givenMathTransformFactory.This class recognizes the following property values:
Report properties Key Remarks Meaning TITLETitle of the web page to produce. DESCRIPTIONoptional Description to write after the introductory paragraph. OBJECTS.KINDKind of objects listed in the page (e.g. "Operation Methods"). PRODUCT.NAMEName of the product for which the report is generated. PRODUCT.VERSIONVersion of the product for which the report is generated. PRODUCT.URLURL where more information is available about the product. JAVADOC.GEOAPIpredefined Base URL of GeoAPI javadoc. FILENAMEpredefined Name of the file to create if the write(File)argument is a directory.How to use this class:
- Create a
Propertiesmap with the values documented in the above table. Default values exist for many keys, but may depend on the environment. It is safer to specify values explicitly when they are known. - Create a new
OperationParametersReportwith the above properties map given to the constructor. - Invoke one of the
addmethod for each operation or factory to include in the HTML page. - Invoke
write(File).
- Since:
- 3.1
- Create a
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classOperationParametersReport.RowA single row in the table produced byOperationParametersReport.
-
Field Summary
Fields Modifier and Type Field Description protected List<OperationParametersReport.Row>rowsThe operations to publish in the HTML report.-
Fields inherited from class Report
properties
-
-
Constructor Summary
Constructors Constructor Description OperationParametersReport(Properties properties)Creates a new report generator using the given property values.
-
Method Summary
Modifier and Type Method Description voidadd(IdentifiedObject operation, ParameterDescriptorGroup parameters)Adds an operation to be show on the HTML page.voidadd(MathTransformFactory factory)Convenience method adding all available methods from the given factory.protected OperationParametersReport.RowcreateRow(IdentifiedObject operation, ParameterDescriptorGroup parameters, Set<String> codeSpaces)Creates a new row for the given operation and parameters.Filewrite(File destination)Formats the current content of the rows list as a HTML page in the given file.
-
-
-
Field Detail
-
rows
protected final List<OperationParametersReport.Row> rows
The operations to publish in the HTML report.
-
-
Constructor Detail
-
OperationParametersReport
public OperationParametersReport(Properties properties)
Creates a new report generator using the given property values. See the class javadoc for a list of expected values.- Parameters:
properties- the property values, ornullfor the default values.
-
-
Method Detail
-
add
public void add(IdentifiedObject operation, ParameterDescriptorGroup parameters)
Adds an operation to be show on the HTML page. The default implementation performs the following steps:- Get the set of all code spaces or scopes found in the given
operation. - Delegates to
createRow(…)with the above set. This means that any parameter names defined in an other scope will be ignored. - Add the new row to the rows list if non-null.
- Parameters:
operation- the operation to show on the HTML page.parameters- the operation parameters, ornullif none.
- Get the set of all code spaces or scopes found in the given
-
add
public void add(MathTransformFactory factory)
Convenience method adding all available methods from the given factory. Each coordinate operation method is added to the rows list as below:add(method, method.getParameters());- Parameters:
factory- the factory for which to add available methods.
-
createRow
protected OperationParametersReport.Row createRow(IdentifiedObject operation, ParameterDescriptorGroup parameters, Set<String> codeSpaces)
Creates a new row for the given operation and parameters. This method is invoked by theadd(…)method when a new row needs to be created, either for an operation or for one of its parameters.The default implementation instantiate a new
OperationParametersReport.Rowwith the given operation and code spaces. Then, if the givenparametersargument is non-null, this method iterates over all parameter descriptor and invokes this method recursively for creating their rows.- Parameters:
operation- the operation.parameters- the operation parameters, ornullif none.codeSpaces- the code spaces for which to get the name and aliases.- Returns:
- the new row, or
nullif none.
-
write
public File write(File destination) throws IOException
Formats the current content of the rows list as a HTML page in the given file.- Specified by:
writein classReport- Parameters:
destination- the file to generate.- Returns:
- the given
destinationfile. - Throws:
IOException- if an error occurred while writing the HTML page.
-
-