public static class FormModel.Validate extends Object
This default implementation has all kinds of validations enabled by default. It takes no action on validation failures, except to increment the number of failures.
Constructor and Description |
---|
Validate()
Initializes a newly created
Validate object so that
all kinds validation tests are enabled. |
Validate(boolean bScriptTestEnabled,
boolean bNullTestEnabled,
boolean bFormatTestEnabled,
boolean bBarcodeTestEnabled)
Initializes a newly created
Validate object so that
specified validation tests are enabled. |
Modifier and Type | Method and Description |
---|---|
FormModel.Validate |
clone()
Creates a copy of this
Validate . |
int |
getFailCount()
Returns the number of validation failures since the fail count was
last reset.
|
boolean |
isBarcodeTestEnabled()
Determines if barcode validation tests are enabled.
|
boolean |
isFormatTestEnabled()
Determines if format validation tests are enabled.
|
boolean |
isNullTestEnabled()
Determines if null validation tests are enabled.
|
boolean |
isScriptTestEnabled()
Determines if script validation tests are enabled.
|
boolean |
onValidateBarcodeTestFailed(FormField field,
String sValidationMessage)
Is called by the validation framework when a barcode validation test
fails.
|
void |
onValidateEnd()
Is called when a validation pass ends.
|
boolean |
onValidateFormatTestFailed(FormField field,
String sValidationMessage,
BooleanHolder bDisableValidate)
Is called by the validation framework when a format validation test
fails.
|
boolean |
onValidateNullTestFailed(ProtoableNode node,
String sValidationMessage,
BooleanHolder bDisableValidate)
Is called by the validation framework when a null validation test fails.
|
boolean |
onValidateScriptFailed(ProtoableNode node,
String sScript,
String sLanguage,
String sValidationMessage,
BooleanHolder bDisableValidate)
Is called by the validation framework when a script validation test
fails.
|
void |
onValidateStart()
Is called when a validation pass is started.
|
void |
resetFailCount()
Sets the number of validation failures to zero.
|
void |
setBarcodeTestEnabled(boolean bEnabled)
Sets whether barcode validation tests are to be enabled.
|
void |
setFormatTestEnabled(boolean bEnabled)
Sets whether format validation tests are to be enabled.
|
void |
setNullTestEnabled(boolean bEnabled)
Sets whether null validation tests are to be enabled.
|
void |
setScriptTestEnabled(boolean bEnabled)
Sets whether script validation tests are to be enabled.
|
boolean |
validateBarcode(Element element,
String sBarcodeType,
String sValue)
Validates a barcode.
|
public Validate()
Validate
object so that
all kinds validation tests are enabled.public Validate(boolean bScriptTestEnabled, boolean bNullTestEnabled, boolean bFormatTestEnabled, boolean bBarcodeTestEnabled)
Validate
object so that
specified validation tests are enabled.bScriptTestEnabled
- determines whether script validations are enabledbNullTestEnabled
- determines whether null validations are enabledbFormatTestEnabled
- determines whether format validations are enabledbBarcodeTestEnabled
- determines whether barcode validations are enabledpublic void onValidateStart()
public void onValidateEnd()
public FormModel.Validate clone()
Validate
.
The set of tests enabled is copied, and the number of failures is set to zero.public boolean isBarcodeTestEnabled()
true
if barcode validation tests are enabled;
otherwise false
public void setBarcodeTestEnabled(boolean bEnabled)
bEnabled
- true
if barcode tests are to be performed.public boolean isFormatTestEnabled()
true
if format validation tests are enabled;
otherwise false
public void setFormatTestEnabled(boolean bEnabled)
bEnabled
- true
if format tests are to be performed.public boolean isNullTestEnabled()
true
if null validation tests are enabled;
otherwise false
public void setNullTestEnabled(boolean bEnabled)
bEnabled
- true
if null tests are to be performed.public boolean isScriptTestEnabled()
true
if script validation tests are enabled;
otherwise false
public void setScriptTestEnabled(boolean bEnabled)
bEnabled
- true
if script tests are to be performed.public boolean onValidateBarcodeTestFailed(FormField field, String sValidationMessage)
true
.field
- the field containing the barcode testsValidationMessage
- the validation error messagetrue
if validation should continuepublic boolean onValidateFormatTestFailed(FormField field, String sValidationMessage, BooleanHolder bDisableValidate)
true
.field
- the field containing the format testsValidationMessage
- the validation error messagebDisableValidate
- indicates whether future validations for this field should be disabledtrue
if validation should continuepublic boolean onValidateNullTestFailed(ProtoableNode node, String sValidationMessage, BooleanHolder bDisableValidate)
true
.node
- the node containing the null testsValidationMessage
- the validation error messagebDisableValidate
- indicates whether future validations for this ProtoableNode should be disabledtrue
if validation should continuepublic boolean onValidateScriptFailed(ProtoableNode node, String sScript, String sLanguage, String sValidationMessage, BooleanHolder bDisableValidate)
true
.node
- the node containing the script testsScript
- the text of the validation script that failedsLanguage
- the language of the scriptsValidationMessage
- the validation error messagebDisableValidate
- indicates whether future validations for this ProtoableNode should be disabledtrue
if validation should continuepublic int getFailCount()
public void resetFailCount()
FormModel.recalculate(boolean, FormModel.Validate, boolean)
is called.public boolean validateBarcode(Element element, String sBarcodeType, String sValue)
true
.element
- the barcode form Element.sBarcodeType
- a String that identifies the barcode patternsValue
- the barcode valuetrue
if the barcode is validCopyright © 2010 - 2020 Adobe. All Rights Reserved