Class | Purpose |
---|---|
CodeSetTranslator | Modifies the strings using the specified code page.
For example,
a CodeSetTranslater decorator has the following attributes set:
|
Delimiter | Appends a delimiter character after a formatted string.
For
example, a Delimiter decorator has the following attributes set:
|
FixedLength | Adjusts a formatted string to a fixed length by either truncating it
or by padding and justifying it.
For example, a FixedLength decorator
has the following attributes set:
|
MaximumLength | Truncates the string if it is over the specified length. If the string
is under the specified length, the decorator does not modify it.
For
example, a MaximumLength decorator has the following attributes set:
|
Identifier | Prefixes or appends one character to the formatted string. For example,
an Identifier decorator has the following attributes set:
|
SelfLength | Prefixes the length (as an unsigned integer or as a string) of the
formatted string. Instance variables specify the size of the integer, its
byte ordering, and whether it counts itself when calculating the length.
For
example, a SelfLength decorator has the following attributes set:
|
CheckNullDecorator | Handles conversions between strings and data elements when either the string is an empty string or the data element has a null value. Because it does not throw an exception, apply this formatter on data elements and strings when you do not know whether they will be empty or not. For example, when the CheckNullDecorator unformats an empty string, the value, it returns is null. When the CheckNullDecorator formats a data field with a null value, the CheckNullDecorator returns an empty string. If the string is a non-empty string or the data element has a value, the CheckNullDecorator does nothing. Typically, another formatter or decorator in the conversion process performs the conversion of non-empty strings and data elements that have a value. If this decorator is being applied in conjunction with other formatters, this decorator must be the first formatter applied. |
Compress | Compresses and decompresses the data field contents by using the Deflater and Inflater classes in the java.util.zip package. |
Each decorator has its own set of instance variables to control how it modifies the formatted strings. Decorators are modified by the addDecoration() and removeDecoration() methods.