Class CharValidator
java.lang.Object
org.apache.wicket.behavior.Behavior
org.apache.wicket.validation.validator.AbstractValidator<String>
com.inductiveautomation.ignition.gateway.web.util.CharValidator
- All Implemented Interfaces:
Serializable
,org.apache.wicket.IComponentAwareEventSink
,org.apache.wicket.markup.html.IComponentAwareHeaderContributor
,org.apache.wicket.util.io.IClusterable
,org.apache.wicket.validation.INullAcceptingValidator<String>
,org.apache.wicket.validation.IValidator<String>
An IValidator that validates text fields in two modes: normal and strict.
- Normal Mode
- Ensures that the characters consist of only characters in AbstractPage.isValidChars().
- Strict Mode
- Ensures that the characters consist of only characters in AbstractPage.isStrictValidChars().
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected boolean
static final CharValidator
The STRICT validator only allows numbers, letters and "_". -
Constructor Summary
ConstructorsConstructorDescriptionCharValidator
(boolean strict) CharValidator
(boolean strict, String allowed) Creates a new char filter with optional strictness, and a string of characters that are explicitly allowed -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Returns true ifx
is null or:
Starts with a letter and consists of: Letters digits _ (underscore)static boolean
Returns true ifx
is null or consists of: Letters digits .protected void
onValidate
(org.apache.wicket.validation.IValidatable<String> validatable) Methods inherited from class org.apache.wicket.validation.validator.AbstractValidator
error, error, error, error, resourceKey, validate, validateOnNullValue, variablesMap
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, bind, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onComponentTag, onConfigure, onEvent, onException, onRemove, renderHead, unbind
-
Field Details
-
STRICT
The STRICT validator only allows numbers, letters and "_". -
strict
protected boolean strict -
allowed
-
-
Constructor Details
-
CharValidator
public CharValidator() -
CharValidator
public CharValidator(boolean strict) -
CharValidator
Creates a new char filter with optional strictness, and a string of characters that are explicitly allowed
-
-
Method Details
-
isStrictValidChars
Returns true ifx
is null or:
Starts with a letter and consists of:- Letters
- digits
- _ (underscore)
-
isValidChars
Returns true ifx
is null or consists of:- Letters
- digits
- . (dot)
- ! (bang)
- _ (underscore)
- (space)
-
onValidate
- Specified by:
onValidate
in classorg.apache.wicket.validation.validator.AbstractValidator<String>
-