Package | Description |
---|---|
org.netbeans.validation.api.builtin | |
org.netbeans.validation.api.conversion | |
org.netbeans.validation.api.ui |
Modifier and Type | Class and Description |
---|---|
class |
Validators
An enumeration of validator factories for commonly needed forms of
validation such as non-empty strings, valid file names and URLs and
so forth.
|
Modifier and Type | Method and Description |
---|---|
static Validator<java.lang.String> |
Validators.disallowChars(char[] chars,
boolean trim)
Get a validator which does fails if any of the characters in the
passed char array are contained in the evaluated text
|
static Validator<java.lang.String> |
Validators.encodableInCharset(java.lang.String charsetName)
Get a validator which determines if the passed string can be encoded
in the specified encoding.
|
static Validator<javax.swing.ComboBoxModel> |
Validators.forComboBox(boolean trim,
Validator<java.lang.String>... validators)
Get a validator for ComboBoxModels which logically OR's together all of the
passed built-in validators.
|
Validator<javax.swing.ComboBoxModel> |
Validators.forComboBoxModel(boolean trim)
Get a validator which operates against ComboBoxModel objects.
|
Validator<javax.swing.text.Document> |
Validators.forDocument(boolean trim)
Get a validator which operates against Document objects.
|
static Validator<javax.swing.text.Document> |
Validators.forDocument(boolean trim,
Validator<java.lang.String>... validators)
Get a validator for documents which logically OR's together all of the
passed built-in validators.
|
static Validator<java.lang.String> |
Validators.forFormat(java.text.Format fmt)
Get a validator that uses a specific
Format (e.g. |
Validator<java.lang.String> |
Validators.forString(boolean trim)
Get a validator of strings.
|
<T> Validator<T> |
Validators.forType(java.lang.Class<T> type,
boolean trim)
Get a validator for objects of the requested type.
|
static Validator<java.lang.String> |
Validators.maxLength(int length)
Validator that enforces maximum input length
|
static Validator<java.lang.String> |
Validators.merge(boolean trim,
Validator<java.lang.String>... validators)
Get a validator for strings which logically OR's together all of the
passed built-in validators.
|
static <T> Validator<T> |
Validators.merge(Validator<T>... validators)
Logically OR together multiple validators which work against the same
type.
|
static Validator<java.lang.String> |
Validators.minLength(int length)
Validator that enforces minimum input length
|
static Validator<java.lang.String> |
Validators.numberRange(java.lang.Number min,
java.lang.Number max)
Get a validator that guarantees that a number is within a certain
range (inclusive)
|
static Validator<javax.swing.ButtonModel[]> |
Validators.oneButtonMustBeSelected(java.lang.String msg)
Get a validator for button models which fails if at least one of the
button models is not selected.
|
static Validator<java.lang.String> |
Validators.regexp(java.lang.String regexp,
java.lang.String message,
boolean acceptPartialMatches)
Get a validator which fails if the text to validate does not match a
passed regular expression.
|
static Validator<java.lang.String> |
Validators.splitString(java.lang.String regexp,
Validator<java.lang.String> other)
Returns a validator which first splits the string to be evaluated according
to the passed regexp, then passes each component of the split string to
the passed validator.
|
Validator<java.lang.String> |
Validators.trim() |
static Validator<java.lang.String> |
Validators.trimString(Validator<java.lang.String>... others)
Wrap a String validator in one which first calls String.trim() on the
strings that will be evaluated.
|
static Validator<java.lang.String> |
Validators.validNumber(java.util.Locale l)
Create a number validator that uses a specific locale.
|
Modifier and Type | Method and Description |
---|---|
static Validator<javax.swing.ComboBoxModel> |
Validators.forComboBox(boolean trim,
Validator<java.lang.String>... validators)
Get a validator for ComboBoxModels which logically OR's together all of the
passed built-in validators.
|
static Validator<javax.swing.text.Document> |
Validators.forDocument(boolean trim,
Validator<java.lang.String>... validators)
Get a validator for documents which logically OR's together all of the
passed built-in validators.
|
static Validator<java.lang.String> |
Validators.merge(boolean trim,
Validator<java.lang.String>... validators)
Get a validator for strings which logically OR's together all of the
passed built-in validators.
|
static <T> Validator<T> |
Validators.merge(Validator<T>... validators)
Logically OR together multiple validators which work against the same
type.
|
static Validator<java.lang.String> |
Validators.splitString(java.lang.String regexp,
Validator<java.lang.String> other)
Returns a validator which first splits the string to be evaluated according
to the passed regexp, then passes each component of the split string to
the passed validator.
|
static Validator<java.lang.String> |
Validators.trimString(Validator<java.lang.String>... others)
Wrap a String validator in one which first calls String.trim() on the
strings that will be evaluated.
|
Modifier and Type | Method and Description |
---|---|
Validator<To> |
Converter.convert(Validator<From>... froms) |
abstract Validator<To> |
Converter.convert(Validator<From> from)
Create a validator for type To by wrapping a validator for type
From.
|
Modifier and Type | Method and Description |
---|---|
Validator<To> |
Converter.convert(Validator<From>... froms) |
abstract Validator<To> |
Converter.convert(Validator<From> from)
Create a validator for type To by wrapping a validator for type
From.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractValidationListener<CompType extends javax.swing.JComponent,T>
Convenience ValidationListener which implements Validator directly.
|
Modifier and Type | Method and Description |
---|---|
void |
ValidationGroup.add(javax.swing.AbstractButton[] buttons,
Validator<javax.swing.ButtonModel[]> validator)
Add a set of button models, e.g.
|
void |
ValidationGroup.add(javax.swing.ButtonModel[] buttons,
Validator<javax.swing.ButtonModel[]> validator)
Add a set of button models, e.g.
|
void |
ValidationGroup.add(javax.swing.JComboBox box,
ValidationStrategy strategy,
Validator<javax.swing.ComboBoxModel> validator)
Add a combo box using the passed validation strategy and validator
|
void |
ValidationGroup.add(javax.swing.JComboBox box,
ValidationStrategy strategy,
Validator<java.lang.String>... builtIns)
Add a combo box to be validated with the passed validation strategy
using the passed validators
|
void |
ValidationGroup.add(javax.swing.JComboBox box,
Validator<javax.swing.ComboBoxModel> validator)
Add a combo box to be validated with ValidationStrategy.DEFAULT
using the passed validator
|
void |
ValidationGroup.add(javax.swing.JComboBox box,
Validator<java.lang.String>... builtIns)
Add a combo box to be validated with ValidationStrategy.DEFAULT
using the passed validators
|
void |
ValidationGroup.add(javax.swing.text.JTextComponent comp,
ValidationStrategy strategy,
Validator<javax.swing.text.Document> validator)
Add a text component to be validated with ValidationStrategy.DEFAULT
using the passed validator
|
void |
ValidationGroup.add(javax.swing.text.JTextComponent comp,
ValidationStrategy strategy,
Validator<java.lang.String>... builtIns)
Add a text control to be validated with the passed validation strategy
using the passed validators
|
void |
ValidationGroup.add(javax.swing.text.JTextComponent comp,
Validator<javax.swing.text.Document> validator)
Add a text component to be validated with ValidationStrategy.DEFAULT
using the passed validator
|
void |
ValidationGroup.add(javax.swing.text.JTextComponent comp,
Validator<java.lang.String>... builtIns)
Add a text component to be validated with ValidationStrategy.DEFAULT
using the passed validators
|