borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.model
java.lang.Object +----borland.jbcl.model.ItemFormatter +----borland.jbcl.model.ItemFormatStr
Constructors Properties MethodsThe ItemFormatStr exends the ItemFormatter class through the use of String patterns to control formatting and parsing. ItemFormatStr supports Variants only, and is a wrapper for the VariantFormatStr class.
See also: Edit/display mask patterns, VariantFormatStr class.
public ItemFormatStr(java.lang.String pattern, int variantType)Constructs an ItemFormatStr object that specifies the pattern used to format values and the type of data the object formats and parses.
Parameters:
public ItemFormatStr(java.lang.String pattern, int variantType, java.util.Locale locale)Constructs an ItemFormatStr object that specifies the pattern used to format values, the type of data the object formats and parses, and the locale.
Parameters:
public Format getFormatObj()Returns the JDK Format subclass associated with this formatter. A returned value of null is possible.
public Locale getLocale()Returns the Locale object being used by this formatting class. The returned value will never be null.
public String getPattern()Returns the pattern used by this VariantFormatStr object for formatting and parsing. See edit/display patterns.
public String format(java.lang.Object value)Returns a formatted string from the value specified with the value parameter. format() uses the current pattern to format the value. format() does not support all data types, but an attempt is made to cast the data into a type required by the formatting logic.
The returned formatted string could be empty if the input Variant was null or unassigned. A null is returned if the formatting fails.
Parameters:
Overrides: borland.jbcl.model.ItemFormatter.format(java.lang.Object)
public Object getSpecialObject(int objType)Retrieves the special object associated with a particular formatter. This is a general purpose routine to obtain specific booleans, characters, flags, and so on inside a formatter, but it is completely dependent on the formatter being used.
Parameters:
Overrides: borland.jbcl.model.ItemFormatter.getSpecialObject(int)
public Object parse(java.lang.String stringValue)Parses the specified string and produces as output an Object containing the appropriate value.
Parameters:
Overrides: borland.jbcl.model.ItemFormatter.parse(java.lang.String)
public String setPattern(java.lang.String pattern)Sets the pattern used by this VariantFormatStr object to format and parse. See edit/display masks for information about specifying a pattern.
The prior pattern is returned.
Parameters:
Overrides: borland.jbcl.model.ItemFormatter.setPattern(java.lang.String)
public Object setSpecialObject(int objType, java.lang.Object obj)Sets the special object associated with a particular formatter. This is a general purpose routine to obtain specific booleans, characters, flags, and so on inside a formatter, but it is completely dependent on the formatter being used. setSpecialObject() returns the prior special object, which can be useful for restoring the original value after a temporary alteration.
Parameters: