|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.JFormattedTextField.AbstractFormatter
javax.swing.text.DefaultFormatter
javax.swing.text.InternationalFormatter
javax.swing.text.NumberFormatter
com.jgoodies.validation.formatter.EmptyNumberFormatter
public class EmptyNumberFormatter
In addition to its superclass NumberFormatter, this class converts
to/from the empty string. Therefore it holds an empty value
that is the counterpart of the empty string.
The Method #valueToString converts the empty value to the
empty string. And #stringToValue converts blank strings
to the empty value. In all other cases the conversion is delegated
to its superclass.
Often the empty value is null or -1.
Examples:
new EmptyNumberFormatter(); new EmptyNumberFormatter(-1);
Format,
Serialized Form| Constructor Summary | |
|---|---|
EmptyNumberFormatter()
Constructs an EmptyNumberFormatter that converts null
to the empty string and vice versa. |
|
EmptyNumberFormatter(java.lang.Number emptyValue)
Constructs an EmptyNumberFormatter that converts the given emptyValue to the empty string and vice versa. |
|
EmptyNumberFormatter(java.text.NumberFormat format)
Constructs an EmptyNumberFormatter configured with the specified Format; converts null to the empty string and vice versa. |
|
EmptyNumberFormatter(java.text.NumberFormat format,
java.lang.Number emptyValue)
Constructs an EmptyNumberFormatter configured with the specified Format; converts null to the given emptyValue
and vice versa. |
|
| Method Summary | |
|---|---|
java.lang.Object |
stringToValue(java.lang.String text)
Returns the Object representation of the
String text. |
java.lang.String |
valueToString(java.lang.Object value)
Returns a String representation of the Object value. |
| Methods inherited from class javax.swing.text.NumberFormatter |
|---|
setFormat |
| Methods inherited from class javax.swing.text.InternationalFormatter |
|---|
clone, getActions, getFields, getFormat, getMaximum, getMinimum, install, setMaximum, setMinimum |
| Methods inherited from class javax.swing.text.DefaultFormatter |
|---|
getAllowsInvalid, getCommitsOnValidEdit, getDocumentFilter, getNavigationFilter, getOverwriteMode, getValueClass, setAllowsInvalid, setCommitsOnValidEdit, setOverwriteMode, setValueClass |
| Methods inherited from class javax.swing.JFormattedTextField.AbstractFormatter |
|---|
getFormattedTextField, invalidEdit, setEditValid, uninstall |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EmptyNumberFormatter()
null
to the empty string and vice versa.
public EmptyNumberFormatter(java.text.NumberFormat format)
null to the empty string and vice versa.
format - Format used to dictate legal valuespublic EmptyNumberFormatter(java.lang.Number emptyValue)
emptyValue to the empty string and vice versa.
emptyValue - the representation of the empty string
public EmptyNumberFormatter(java.text.NumberFormat format,
java.lang.Number emptyValue)
null to the given emptyValue
and vice versa.
format - Format used to dictate legal valuesemptyValue - the representation of the empty string| Method Detail |
|---|
public java.lang.Object stringToValue(java.lang.String text)
throws java.text.ParseException
Object representation of the
String text.Unlike its superclass, this class converts blank strings to the empty value.
stringToValue in class javax.swing.text.InternationalFormattertext - String to convert
Object representation of text
java.text.ParseException - if there is an error in the conversion
public java.lang.String valueToString(java.lang.Object value)
throws java.text.ParseException
value.
This invokes format on the current Format.Unlike its superclass, this class converts the empty value to the empty string.
valueToString in class javax.swing.text.InternationalFormattervalue - the value to convert
java.text.ParseException - if there is an error in the conversion
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||