|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.util.transforms.BaseFormatTransform
public abstract class BaseFormatTransform
Transform between numeric and String data using a Format
.
This transform converts between numeric data and Strings
using the format method of a Format object, or converts a String
to a number using the parse methods. The Format can be a NumberFormat
,
any Format instance returned from SASFormat
(if you
wish to format using SAS formats), or any other class that extends from Format
.
You can create property links between two components
such that one object's property is set to the formatted
or parsed value of another property. See
PropertyLinkAdaptor.addLink(Object, String, Object, String, com.sas.util.transforms.TransformInterface)
FormatTransform
,
ParseTransform
,
Serialized FormField Summary | |
---|---|
protected java.text.Format |
format
The Format used to format and parse values. |
protected java.lang.String |
SASpattern
If the format is a SAS format, this is the text pattern assigned in setSASFormat(String) |
Constructor Summary | |
---|---|
BaseFormatTransform()
Construct a default FormatTransform which uses default rules to convert between number and String values. |
|
BaseFormatTransform(java.text.Format format)
Construct a FormatTransform which uses the format/parse methods of the format object to convert between number and String values. |
Method Summary | |||||
---|---|---|---|---|---|
java.lang.String |
getDateFormat()
Return the date format pattern, or null if the format is anot a DateFormat. |
||||
java.lang.String |
getDecimalFormat()
Return the decimal format pattern, or null if the format is anot a DecimalFormat. |
||||
java.text.Format |
getFormat()
Return the value of the format property. |
||||
java.lang.String |
getSASFormat()
|
||||
void |
setDateFormat(java.lang.String pattern)
Set the pattern of a |
void |
setDecimalFormat(java.lang.String pattern)
Set the pattern of a |
void |
setFormat(java.text.Format newFormat)
Set the format property. |
void |
setSASFormat(java.lang.String pattern)
Set the SAS format pattern to use for formatting and parsing. |
||||
abstract java.lang.Object |
transform(java.lang.Object object)
|
Field Detail |
---|
protected java.text.Format format
protected java.lang.String SASpattern
setSASFormat(String)
Constructor Detail |
---|
public BaseFormatTransform()
public BaseFormatTransform(java.text.Format format)
Method Detail |
---|
public void setFormat(java.text.Format newFormat)
newFormat
- the new value for the format property.public java.text.Format getFormat()
public abstract java.lang.Object transform(java.lang.Object object) throws com.sas.util.transforms.TransformException
transform
in interface com.sas.util.transforms.TransformInterface
com.sas.util.transforms.TransformException
public void setDecimalFormat(java.lang.String pattern)
DecimalFormat
format.
This will set the SAS and date formats to null and set the format
property to a new DecimalFormat instance.
Note that in the current release of the class libraries,
parsing using the SASFormat classes in the com.sas.text package
is not implemented.
public java.lang.String getDecimalFormat()
public void setDateFormat(java.lang.String pattern)
SimpleDateFormat
format.
This will set the SAS and decimal formats to null and set the format
property to a new SimpleDateFormat instance.
public java.lang.String getDateFormat()
public void setSASFormat(java.lang.String pattern)
public java.lang.String getSASFormat()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |