public class RegexFormatter
extends javax.swing.text.DefaultFormatter
Constructor and Description |
---|
RegexFormatter()
Instantiates a new regex formatter.
|
RegexFormatter(java.util.regex.Pattern pattern)
Creates a regular expression based AbstractFormatter.
|
RegexFormatter(java.lang.String pattern)
Creates a regular expression based AbstractFormatter.
|
Modifier and Type | Method and Description |
---|---|
java.util.regex.Pattern |
getPattern()
Returns the Pattern used to determine if a value is legal.
|
void |
setPattern(java.util.regex.Pattern pattern)
Sets the pattern that will be used to determine if a value is legal.
|
java.lang.Object |
stringToValue(java.lang.String text)
Parses text returning an arbitrary Object.
|
public RegexFormatter()
public RegexFormatter(java.lang.String pattern) throws java.text.ParseException
pattern
- the patternjava.text.ParseException
- the parse exceptionpublic RegexFormatter(java.util.regex.Pattern pattern)
pattern
- the patternpublic void setPattern(java.util.regex.Pattern pattern)
pattern
- the new patternpublic java.util.regex.Pattern getPattern()
public java.lang.Object stringToValue(java.lang.String text) throws java.text.ParseException
stringToValue
in class javax.swing.text.DefaultFormatter
text
- String to convertjava.text.ParseException
- if there is an error in the conversionCopyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa