|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.InputVerifier
org.brains2b.swingext.mask.TextValidator
public class TextValidator
TextValidator is an InputValidator that functions like a display mask for Strings.
The mask is a combination of mask characters and fixed indicators. If you have a mask like X@-99-AAA?? and a value is inserted as XA01ABCD would be displayed as XA-01-ABCD, if you inserted XAB9ABCD the verify would return false.
Constructor Summary | |
---|---|
TextValidator(java.lang.String mask)
Constructor for TextValidator. |
Method Summary | |
---|---|
java.lang.String |
getErrorMessage()
retrieves the errormessage if verify returns false. |
java.lang.String |
getLocalizedMessage()
retrieve the error message, localized to the default locale if verify returns false |
java.lang.String |
getString(java.lang.String txt)
Implementation of getString(String) in this case only returns the baseCharacters [0-9][A-Z], no spaces, or symbols from the Mask. |
java.lang.String |
getString(java.lang.String txt,
java.lang.Class c)
gets a String as representation of the value from a InputValidator Implemenations differ for the implementations of this interface and on which Class is supplied for output. |
boolean |
verify(javax.swing.JComponent input)
Just a reference to verify in javax.swing.InputVerifier |
Methods inherited from class javax.swing.InputVerifier |
---|
shouldYieldFocus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextValidator(java.lang.String mask)
mask
- String, the Mask to use with this Validator
see the class description for allowed mask charactersMethod Detail |
---|
public boolean verify(javax.swing.JComponent input)
InputValidator
verify
in interface InputValidator
verify
in class javax.swing.InputVerifier
InputVerifier.verify(JComponent)
public java.lang.String getErrorMessage()
InputValidator
getErrorMessage
in interface InputValidator
InputValidator.getErrorMessage()
public java.lang.String getString(java.lang.String txt)
getString
in interface InputValidator
txt
- String, the Masked text of this Validator
InputValidator.getString(String)
public java.lang.String getString(java.lang.String txt, java.lang.Class c)
InputValidator
Implemenations differ for the implementations of this interface and on which Class is supplied for output. Also not all requested output Classes are implemented for every implementation. on which ever field this InputValidator is implemented on.
getString
in interface InputValidator
txt
- String, the Masked text of this Validatorc
- Class, the type of output you want to return as a String representation
public java.lang.String getLocalizedMessage()
InputValidator
getLocalizedMessage
in interface InputValidator
InputValidator.getLocalizedMessage()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |