Modifier and Type | Method and Description |
---|---|
ValidatorConfigurator |
createConfigurator(JPack configuration)
Return a configurator instance that is initialized with the given data.
|
java.lang.String |
getName(java.util.Locale locale)
Returns the name for this validator.
|
java.lang.String |
getUserInterfaceCheckboxText(java.util.Locale locale)
Returns the text being displayed with the JCheckBox in the preferences dialog that enables or disabled the validator for the current field.
|
boolean |
hasConfigurator()
Returns whether this validator has some specific user interface for configuration
|
boolean |
supportsField(GUID guid,
int fieldType,
int valueInterpretation)
Returns whether the given field is supported for validation.
|
java.lang.String |
validate(java.util.Locale locale,
java.lang.Object item,
java.lang.Object fieldDefinition,
JPack configurationData)
The actual worker method that should validate the field content of the given record to comply with the validation rules specified by the configuration
data.
|
java.lang.String getName(java.util.Locale locale)
locale
- the language to get the name forboolean supportsField(GUID guid, int fieldType, int valueInterpretation)
guid
- GUID
of the field to checkfieldType
- field type of the field to checkvalueInterpretation
- value interpretation of the field to checktrue
if the given field can be validated, false
otherwisejava.lang.String getUserInterfaceCheckboxText(java.util.Locale locale)
locale
- the language to get the text forboolean hasConfigurator()
true
if this validator has some specific user interface for configuration, false
otherwiseValidatorConfigurator createConfigurator(JPack configuration)
configuration
- the configuration datajava.lang.String validate(java.util.Locale locale, java.lang.Object item, java.lang.Object fieldDefinition, JPack configurationData)
locale
- The language to present the error with in case of a failed validationitem
- The item to work on. Needs to be casted to Item
for the actual workfieldDefinition
- The field definition of the field to work on. Needs to be casted to FieldDefinition
for the actual
workconfigurationData
- The pack containing the configuration previously configured using the ValidatorConfigurator
instance of this validatornull
if the current value is validwww.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.