public class ParameterFormat extends TabularFormat<Object>
This class can format parameters with different levels of verbosity, specified by the ParameterFormat.ContentLevel
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 ParameterFormat.ContentLevel
javadoc for output examples.
DefaultParameterDescriptorGroup 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 │ └────────────────────────────────┴────────┴────────────┴───────────────┴───────────────┘
| Class | Remarks |
|---|---|
ParameterValueGroup | Default values column is replaced by a column of the actual values. |
ParameterDescriptorGroup | Table caption is the parameter group name. |
OperationMethod | Table caption is the method name (not necessarily the same than parameter group name). |
IdentifiedObject[] | Accepted only for ParameterFormat.ContentLevel.NAME_SUMMARY. |
Limitations:
ParameterFormat, like most java.text.Format subclasses, is not thread-safe.Defined in the sis-referencing module
| Modifier and Type | Class and Description |
|---|---|
static class |
ParameterFormat.ContentLevel
The amount of information to include in the table formatted by
ParameterFormat. |
Format.FieldbeforeFill, columnSeparator, fillCharacter, lineSeparator, omitTrailingNulls| Constructor and Description |
|---|
ParameterFormat()
Creates a new formatter for the default locale and timezone.
|
ParameterFormat(Locale locale,
TimeZone timezone)
Creates a new formatter for the given locale and timezone.
|
| Modifier and Type | Method and Description |
|---|---|
ParameterFormat |
clone()
Returns a clone of this format.
|
void |
format(Object object,
Appendable toAppendTo)
Formats the given object to the given stream of buffer.
|
Colors |
getColors()
Returns the colors for an output on X3.64 compatible terminal, or
null if none. |
ParameterFormat.ContentLevel |
getContentLevel()
Returns the amount of information to put in the table.
|
Locale |
getLocale(Locale.Category category)
Returns the locale for the given category.
|
String[] |
getPreferredCodespaces()
Returns the code spaces of names, aliases and identifiers to show, or
null if there is no restriction. |
Class<Object> |
getValueType()
Returns the type of objects formatted by this class.
|
Object |
parse(CharSequence text,
ParsePosition pos)
Not yet supported.
|
void |
setColors(Colors colors)
Sets the colors for an output on X3.64 compatible terminal.
|
void |
setContentLevel(ParameterFormat.ContentLevel level)
Sets the amount of information to put in the table.
|
void |
setPreferredCodespaces(String... codespaces)
Filters names, aliases and identifiers by their code spaces.
|
getColumnSeparatorMatcher, getColumnSeparatorPattern, getLineSeparator, setColumnSeparatorPattern, setLineSeparatorcreateFormat, format, getFormat, getLocale, getTimeZone, parseObject, parseObjectformat, formatToCharacterIteratorpublic ParameterFormat()
public final Class<Object> getValueType()
Object.class
since it is the only common parent to all object types accepted by this formatter.getValueType in class CompoundFormat<Object>Object.classpublic Locale getLocale(Locale.Category category)
Locale.Category.FORMAT specifies the locale to use for values.Locale.Category.DISPLAY specifies the locale to use for labels.getLocale in class CompoundFormat<Object>category - the category for which a locale is desired.null).public ParameterFormat.ContentLevel getContentLevel()
ParameterFormat.ContentLevel.BRIEF.public void setContentLevel(ParameterFormat.ContentLevel level)
level - the amount of information to put in the table.public String[] getPreferredCodespaces()
null if there is no restriction.
This method returns the sequence specified by the last call to setPreferredCodespaces(String[]),
without duplicated values.
The default value is null.
null if no restriction.public void setPreferredCodespaces(String... codespaces)
ReferenceIdentifier.getCodeSpace(),
ScopedName.head() or GenericName.scope() value in the given list, unless no name or alias
matches this criterion.codespaces - the preferred code spaces of names, aliases and identifiers to format, or null
for accepting all of them. Some typical values are "EPSG", "OGC" or "GeoTIFF".public Colors getColors()
null if none.
The default value is null.null if none.public void setColors(Colors colors)
colors - the colors for an output on X3.64 compatible terminal, or null if none.public void format(Object object, Appendable toAppendTo) throws IOException
format in class CompoundFormat<Object>object - the object to format.toAppendTo - where to format the object.IOException - if an error occurred while writing to the given appendable.public Object parse(CharSequence text, ParsePosition pos) throws ParseException
parse in class CompoundFormat<Object>text - the character sequence for the object to parse.pos - the position where to start the parsing.
On return, the position where the parsing stopped or where an error occurred.ParseException - currently always thrown.public ParameterFormat clone()
clone in class TabularFormat<Object>Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.