borland Packages  Class Hierarchy  dx.text Package 

BinaryFormatter component

java.lang.Object
   +----com.borland.dx.text.ItemFormatter
           +----com.borland.dx.text.VariantFormatter
                   +----com.borland.dx.text.BinaryFormatter

About the BinaryFormatter component

Constructors  Properties  Methods  

Implements Serializable

The BinaryFormatter component is the default formatter and parser of Variant.INPUTSTREAM type data. This is a placeholder class that ensures that formatting requests of binary values do not generate an Exception.

See also: String-based patterns (masks)


BinaryFormatter constructors

BinaryFormatter properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in com.borland.dx.text.VariantFormatter

Properties implemented in java.lang.Object

BinaryFormatter methods

Methods implemented in this class

Methods implemented in com.borland.dx.text.VariantFormatter

Methods implemented in java.lang.Object


BinaryFormatter constructors

BinaryFormatter()

  public BinaryFormatter()
Constructs a BinaryFormatter object.

BinaryFormatter properties

formatObj

 public Format getFormatObj()
This property is used internally by other com.borland classes. You should never use this property directly.

locale

 public Locale getLocale()
This property is used internally by other com.borland classes. You should never use this property directly.

pattern

 public String getPattern()
This property is used internally by other com.borland classes. You should never use this property directly.

variantType

 public int getVariantType()
This property is used internally by other com.borland classes. You should never use this property directly.

BinaryFormatter methods

format(com.borland.dx.dataset.Variant)

  public String format(Variant value)
Returns a String representing the given value stored in the supplied object. All reasonable attempts are made to "cast" the type found in the object into the appropriate type specified in the constructor of the implementing classes. A returned empty string indicates a null or empty input value. null means the formatting failed.

Parameters:

value
The value to be formatted to a String.

Overrides: com.borland.dx.text.VariantFormatter.format(com.borland.dx.dataset.Variant)

getSpecialObject(int)

  public Object getSpecialObject(int objType)
Returns the value of the specified special object.

Some formatter classes define special objects for their own use. You must know the internal details of the Format subclass being used to use getSpecialObject().

Parameters:

objType
The special object type to return.

Overrides: com.borland.dx.text.VariantFormatter.getSpecialObject(int)

parse(java.lang.String, com.borland.dx.dataset.Variant)

  public void parse(String stringValue, Variant value)
Analyzes the given String and produces as output an Object containing the appropriate value. A null return value results when stringValue is null or empty.

Parameters:

stringValue
The string to be parsed.

Overrides: com.borland.dx.text.VariantFormatter.parse(java.lang.String, com.borland.dx.dataset.Variant)

parse(java.lang.String, com.borland.dx.dataset.Variant, int)

  public void parse(String stringValue, Variant value, int variantType)
An alternative form of parse() that allows the type of Variant returned to be specified.

Parameters:

stringValue
The string to be parsed. A null or empty stringValue returns a VariantAssignedNull variant.
value
The Variant that receives the resulting data.
variantType
The desired type of variant. If variantType is zero or one of the VariantIsNull types, the method chooses the default variant type specified at the time of the construction of VariantFormatter.

Overrides: com.borland.dx.text.VariantFormatter.parse(java.lang.String, com.borland.dx.dataset.Variant, int)

setPattern(java.lang.String)

  public String setPattern(String pattern)
Sets the pattern used for parsing and formatting to a new pattern, returning the old pattern. The new pattern must be of the same basic type associated with this type of formatter. For example, if you used a Date/Time pattern in the constructor, you can't switch to a numeric pattern as each basic pattern type has its own data-dependent format() and parse() methods.

If the new pattern is null (or empty), setPattern() chooses a default pattern for the current locale.

Parameters:

pattern
The new pattern to be used for formatting and parsing.

Overrides: com.borland.dx.text.VariantFormatter.setPattern(java.lang.String)

setSpecialObject(int, java.lang.Object)

  public Object setSpecialObject(int objType, Object obj)
Some formatter classes define special objects for their own use. This method allows them to be set. You must know the internal details of the Format subclass being used to use setSpecialObject().

The returned value is the prior value of the object.

Parameters:

objType
The special object type. The possible values are VariantFormatter.FillChar, which is the fill character to fill blank slots, and VariantFormatter.Replacecharacter, which is used to replace FillChar on parse.
obj
The special object.

Overrides: com.borland.dx.text.VariantFormatter.setSpecialObject(int, java.lang.Object)