|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectWriter
FilterWriter
ParameterWriter
@Decorator(value=java.io.Writer.class) public class ParameterWriter
Formats parameter descriptors or parameter values in a tabular format. This writer assumes a monospaced font and an encoding capable to provide drawing box characters (e.g. unicode).
| referencing/geotk-referencing (download) | View source code for this class |
| Field Summary |
|---|
| Fields inherited from class FilterWriter |
|---|
out |
| Fields inherited from class Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
ParameterWriter()
Creates a new formatter writing parameters to the console if there is one, or to the default output stream otherwise. |
|
ParameterWriter(Writer out)
Creates a new formatter writing parameters to the specified output writer. |
|
| Method Summary | |
|---|---|
void |
format(OperationMethod operation)
Prints the elements of an operation to the output stream. |
void |
format(ParameterDescriptorGroup descriptor)
Prints the elements of a descriptor group to the output stream. |
void |
format(ParameterValueGroup values)
Prints the elements of a parameter group to the output stream. |
protected String |
formatValue(Object value)
Formats the specified value as a string. |
Set<String> |
getAuthorities()
Returns the list of authorities to filter, or null if there is no
restriction. |
Locale |
getLocale()
Returns the current locale. |
boolean |
isBrief()
Returns true if the table is formatted in a brief format. |
boolean |
isColorEnabled()
Returns true if this writer is allowed to send color instructions for
X3.64 compatible terminal. |
static void |
print(OperationMethod operation)
Prints the elements of an operation to the console with colored syntax if possible, or to the default output stream otherwise. |
static void |
print(ParameterDescriptorGroup descriptor)
Prints the elements of a descriptor group to the console with colored syntax if possible, or to the default output stream otherwise. |
static void |
print(ParameterValueGroup values)
Prints the elements of a parameter group to the console with colored syntax if possible, or to the default output stream otherwise. |
void |
setAuthorities(String... authorities)
Sets the list of authorities to filter, or null for accepting all of them. |
void |
setBrief(boolean b)
Sets whatever the table should formatted in a brief format. |
void |
setColorEnabled(boolean enabled)
Sets whatever this writer is allowed to send color instructions for X3.64 compatible terminal. |
void |
setLocale(Locale locale)
Sets the locale to use for table formatting. |
void |
summary(Collection<? extends IdentifiedObject> objects)
Formats a summary of a collection of identified objects. |
static String |
toString(ParameterDescriptorGroup descriptor)
Returns a string representation of the given descriptor group in the brief format. |
static String |
toString(ParameterValueGroup values)
Returns a string representation of the given parameter group in the brief format. |
| Methods inherited from class FilterWriter |
|---|
close, flush, write, write, write |
| Methods inherited from class Writer |
|---|
append, append, append, write, write |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ParameterWriter()
isColorEnabled() will be true.
public ParameterWriter(Writer out)
out - Where to write the parameters.| Method Detail |
|---|
public static void print(OperationMethod operation)
new ParameterWriter().format(operation)
operation - The operation for which to write the parameters.public static void print(ParameterDescriptorGroup descriptor)
new ParameterWriter().format(descriptor)
descriptor - The parameter descriptor to write.public static void print(ParameterValueGroup values)
new ParameterWriter().format(values)
values - The parameter values to write.public static String toString(ParameterDescriptorGroup descriptor)
StringWriter buffer = new StringWriter(); ParameterWriter writer = new ParameterWriter(buffer); writer.setBrief(true); writer.format(descriptor); return buffer.toString();
descriptor - The parameter descriptor to format.
public static String toString(ParameterValueGroup values)
StringWriter buffer = new StringWriter(); ParameterWriter writer = new ParameterWriter(buffer); writer.setBrief(true); writer.format(values); return buffer.toString();
values - The parameter values to format.
public void format(OperationMethod operation)
throws IOException
operation - The operation method to format.
IOException - if an error occurred will writing to the stream.
public void format(ParameterDescriptorGroup descriptor)
throws IOException
descriptor - The descriptor group to format.
IOException - if an error occurred will writing to the stream.
public void format(ParameterValueGroup values)
throws IOException
values - The parameter group to format.
IOException - if an error occurred will writing to the stream.
public void summary(Collection<? extends IdentifiedObject> objects)
throws IOException
The table formatted by default may be quite large. It is recommended to invoke
setAuthorities(java.lang.String...) before this method in order to reduce the amount of columns
to display.
objects - The collection of objects to format.
IOException - if an error occurred will writing to the stream.public Set<String> getAuthorities()
null if there is no
restriction. If non-null, only name
or alias of those authorities will
be displayed. The default value is null.
null if no restriction.public void setAuthorities(String... authorities)
null for accepting all of them.
The strings are authority names like "OGC", "EPSG", "ESRI"
or "GeoTIFF". A few strings are treated especially:
"EPSG:#" displays EPSG codes in the first column."Geotoolkit.org" or "Geotk" displays Geotk name if available, or
EPSG names otherwise, in a "Description" column. This is called "description"
because the Geotk names are ambiguous and should not be used as identifiers.
authorities - The authorities to filter, or null for accepting all of them.public boolean isBrief()
true if the table is formatted in a brief format. If true, then
for each descriptor only the name is formatted;
aliases and identifiers are omitted. In addition, no line separator will be inserted between
parameters since most parameters will fit on a single line.
true for the brief format, or false for the complete format.public void setBrief(boolean b)
b - true for the brief format, or false for the complete format.public boolean isColorEnabled()
true if this writer is allowed to send color instructions for
X3.64 compatible terminal. The default value is false,
unless the no-argument constructor was used and
the console seems to be compatible with the X3.64 standard.
true if this writer is allowed to send X3.64 sequences.public void setColorEnabled(boolean enabled)
The default value is false, unless the no-argument
constructor was used and the console seems to be compatible with the X3.64 standard.
enabled - true to allow this writer to send X3.64 sequences.public Locale getLocale()
ParameterWriter
use the system default.
getLocale in interface Localizedpublic void setLocale(Locale locale)
locale - The new locale to use.protected String formatValue(Object value)
format(...) methods. The default implementation format Number,
Date and Angle object according the current locale.
This method can been overridden if more objects need to be formatted in a special way.
value - the value to format.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||