Class ParameterFormat

  • All Implemented Interfaces:
    Serializable, Cloneable, Localized

    public class ParameterFormat
    extends TabularFormat<Object>
    Formats parameter descriptors or parameter values in a tabular format. This format assumes a monospaced font and an encoding supporting drawing box characters (e.g. UTF-8).

    This class can format parameters with different levels of verbosity, specified by the Parameter­Format​.Content­Level property. The content level controls whether the formatter should write all names and aliases (at the cost of multi-line rows), or to pickup one name per parameter for a more compact table. See Parameter­Format​.Content­Level javadoc for output examples.

    Example: The Mercator (variant A) example given in Default­Parameter­Descriptor­Group javadoc will be formatted by default as below:
    EPSG: Mercator (variant A)
    ┌────────────────────────────────┬────────┬────────────┬───────────────┬───────────────┐
    │ Name (EPSG)                    │ Type   │ Obligation │ Value domain  │ Default value │
    ├────────────────────────────────┼────────┼────────────┼───────────────┼───────────────┤
    │ Latitude of natural origin     │ Double │ Mandatory  │  [-80 … 84]°  │         0.0°  │
    │ Longitude of natural origin    │ Double │ Mandatory  │ [-180 … 180]° │         0.0°  │
    │ Scale factor at natural origin │ Double │ Mandatory  │    (0 … ∞)    │         1.0   │
    │ False easting                  │ Double │ Mandatory  │   (−∞ … ∞) m  │         0.0 m │
    │ False northing                 │ Double │ Mandatory  │   (−∞ … ∞) m  │         0.0 m │
    └────────────────────────────────┴────────┴────────────┴───────────────┴───────────────┘
    The kinds of objects accepted by this formatter are:
    Formattable object types
    Class Remarks
    ParameterValueGroupDefault values column is replaced by a column of the actual values.
    ParameterDescriptorGroupTable caption is the parameter group name.
    OperationMethodTable caption is the method name (not necessarily the same than parameter group name).
    IdentifiedObject[]Accepted only for Parameter­Format​.Content­Level​.NAME_SUMMARY.

    Limitations:

    • The current implementation can only format features — parsing is not yet implemented.
    • Parameter­Format, like most java​.text​.Format subclasses, is not thread-safe.
    Since:
    0.4
    See Also:
    Serialized Form

    Defined in the sis-referencing module

    • Constructor Detail

      • ParameterFormat

        public ParameterFormat()
        Creates a new formatter for the default locale and timezone.
      • ParameterFormat

        public ParameterFormat​(Locale locale,
                               TimeZone timezone)
        Creates a new formatter for the given locale and timezone.
        Parameters:
        locale - the locale, or null for Locale​.ROOT.
        timezone - the timezone, or null for UTC.