ParameterFormat (Apache SIS 1.6 API) JavaScript is disabled on your browser.     Skip navigation links Overview Class Use Tree New Deprecated Index Search Help org.apache.sis.referencing org.apache.sis.parameter ParameterFormat Contents  Description Example Input types Limitations Nested Class Summary Field Summary Constructor Summary Method Summary Constructor Details ParameterFormat() ParameterFormat(Locale, TimeZone) Method Details getValueType() getLocale(Locale.Category) getContentLevel() setContentLevel(ParameterFormat.ContentLevel) getPreferredCodespaces() setPreferredCodespaces(String...) getColors() setColors(Colors) format(Object, Appendable) parse(CharSequence, ParsePosition) clone() Hide sidebar  Show sidebar Class ParameterFormat Object Format CompoundFormat<Object> TabularFormat<Object> 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 │ └────────────────────────────────┴────────┴────────────┴───────────────┴───────────────┘ Input types 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 as 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 Nested Class Summary Nested Classes Modifier and Type Class Description static enum  Parameter­Format​.Content­Level The amount of information to include in the table formatted by Parameter­Format. Nested classes/interfaces inherited from class Format Format​.Field Field Summary Fields inherited from class TabularFormat before­Fill, column­Separator, fill­Character, line­Separator, omit­Trailing­Nulls Constructor Summary Constructors Constructor Description Parameter­Format() Creates a new formatter for the default locale and timezone. Parameter­Format(Locale locale, Time­Zone timezone) Creates a new formatter for the given locale and timezone. Method Summary All MethodsInstance MethodsConcrete Methods Modifier and Type Method Description Parameter­Format clone() Returns a clone of this format. void format(Object object, Appendable to­Append­To) Formats the given object to the given stream of buffer. Colors get­Colors() Returns the colors for an output on X3.64 compatible terminal, or null if none. Parameter­Format​.Content­Level get­Content­Level() Returns the amount of information to put in the table. Locale get­Locale(Locale​.Category category) Returns the locale for the given category. String[] get­Preferred­Codespaces() Returns the code spaces of names, aliases and identifiers to show, or null if there is no restriction. final Class<Object> get­Value­Type() Returns the type of objects formatted by this class. Object parse(Char­Sequence text, Parse­Position pos) Not yet supported. void set­Colors(Colors colors) Sets the colors for an output on X3.64 compatible terminal. void set­Content­Level(Parameter­Format​.Content­Level level) Sets the amount of information to put in the table. void set­Preferred­Codespaces(String... codespaces) Filters names, aliases and identifiers by their code spaces. Methods inherited from class TabularFormat get­Column­Separator­Matcher, get­Column­Separator­Pattern, get­Line­Separator, set­Column­Separator­Pattern, set­Line­Separator Methods inherited from class CompoundFormat create­Format, format, format, get­Format, get­Locale, get­Temporal­Style, get­Time­Zone, parse­Object, parse­Object Methods inherited from class Format format, format­To­Character­Iterator Methods inherited from class Object equals, finalize, get­Class, hash­Code, notify, notify­All, to­String, wait, wait, wait Constructor Details 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. Method Details getValueType public final Class<Object> getValueType() Returns the type of objects formatted by this class. This method has to return Object​.class since it is the only common parent to all object types accepted by this formatter. Specified by: get­Value­Type in class Compound­Format<Object> Returns: Object​.class getLocale public Locale getLocale(Locale.Category category) Returns the locale for the given category. Locale​.Category​.FORMAT specifies the locale to use for values. Locale​.Category​.DISPLAY specifies the locale to use for labels. Overrides: get­Locale in class Compound­Format<Object> Parameters: category - the category for which a locale is desired. Returns: the locale for the given category (never null). getContentLevel public ParameterFormat.ContentLevel getContentLevel() Returns the amount of information to put in the table. The default value is Parameter­Format​.Content­Level​.BRIEF. Returns: the table content. setContentLevel public void setContentLevel(ParameterFormat.ContentLevel level) Sets the amount of information to put in the table. Parameters: level - the amount of information to put in the table. getPreferredCodespaces public String[] getPreferredCodespaces() Returns the code spaces of names, aliases and identifiers to show, or null if there is no restriction. This method returns the sequence specified by the last call to set­Preferred­Codespaces(String[]), without duplicated values. The default value is null. Returns: the code spaces of names and identifiers to show, or null if no restriction. setPreferredCodespaces public void setPreferredCodespaces(String... codespaces) Filters names, aliases and identifiers by their code spaces. If the given array is non-null, then the only names, aliases and identifiers to be formatted are those having a Reference­Identifier​.get­Code­Space(), Scoped­Name​.head() or Generic­Name​.scope() value in the given list, unless no name or alias matches this criterion. Parameters: 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 "Geo­TIFF". getColors public Colors getColors() Returns the colors for an output on X3.64 compatible terminal, or null if none. The default value is null. Returns: the colors for an output on X3.64 compatible terminal, or null if none. setColors public void setColors(Colors colors) Sets the colors for an output on X3.64 compatible terminal. Parameters: colors - the colors for an output on X3.64 compatible terminal, or null if none. format public void format(Object object, Appendable toAppendTo) throws IOException Formats the given object to the given stream of buffer. The object may be an instance of any of the following types: Parameter­Value­Group Parameter­Descriptor­Group Operation­Method Identified­Object[] — accepted only for Parameter­Format​.Content­Level​.NAME_SUMMARY. Specified by: format in class Compound­Format<Object> Parameters: object - the object to format. to­Append­To - where to format the object. Throws: IOException - if an error occurred while writing to the given appendable. parse public Object parse(CharSequence text, ParsePosition pos) throws ParseException Not yet supported. Specified by: parse in class Compound­Format<Object> Parameters: 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. Returns: currently never return. Throws: Parse­Exception - currently always thrown. clone public ParameterFormat clone() Returns a clone of this format. Overrides: clone in class Tabular­Format<Object> Returns: a clone of this format.