|
XFA4J | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.adobe.xfa.form.FormModel.Validate
public static class FormModel.Validate
A base class that an implementation can derive from to interact with the form validation process. Before performing each validation test, the validation framework calls back to a Validate instance to determine whether that kind of validation test is enabled. Each time a validation failure occurs, the validation framework calls back to a Validate instance to record the failure.
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 Summary | |
|---|---|
FormModel.Validate()
Initializes a newly created Validate object so that
all kinds validation tests are enabled. |
|
FormModel.Validate(boolean bScriptTestEnabled,
boolean bNullTestEnabled,
boolean bFormatTestEnabled,
boolean bBarcodeTestEnabled)
Initializes a newly created Validate object so that
specified validation tests are enabled. |
|
| Method Summary | |
|---|---|
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,
java.lang.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,
java.lang.String sValidationMessage,
BooleanHolder bDisableValidate)
Is called by the validation framework when a format validation test fails. |
boolean |
onValidateNullTestFailed(ProtoableNode node,
java.lang.String sValidationMessage,
BooleanHolder bDisableValidate)
Is called by the validation framework when a null validation test fails. |
boolean |
onValidateScriptFailed(ProtoableNode node,
java.lang.String sScript,
java.lang.String sLanguage,
java.lang.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,
java.lang.String sBarcodeType,
java.lang.String sValue)
Validates a barcode. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FormModel.Validate()
Validate object so that
all kinds validation tests are enabled.
public FormModel.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 enabled| Method Detail |
|---|
public 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.
clone in class java.lang.Objectpublic boolean isBarcodeTestEnabled()
true if barcode validation tests are enabled;
otherwise falsepublic void setBarcodeTestEnabled(boolean bEnabled)
bEnabled - true if barcode tests are to be performed.public boolean isFormatTestEnabled()
true if format validation tests are enabled;
otherwise falsepublic void setFormatTestEnabled(boolean bEnabled)
bEnabled - true if format tests are to be performed.public boolean isNullTestEnabled()
true if null validation tests are enabled;
otherwise falsepublic void setNullTestEnabled(boolean bEnabled)
bEnabled - true if null tests are to be performed.public boolean isScriptTestEnabled()
true if script validation tests are enabled;
otherwise falsepublic void setScriptTestEnabled(boolean bEnabled)
bEnabled - true if script tests are to be performed.
public boolean onValidateBarcodeTestFailed(FormField field,
java.lang.String sValidationMessage)
true.
field - the field containing the barcode testsValidationMessage - the validation error message
true if validation should continue
public boolean onValidateFormatTestFailed(FormField field,
java.lang.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 disabled
true if validation should continue
public boolean onValidateNullTestFailed(ProtoableNode node,
java.lang.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 disabled
true if validation should continue
public boolean onValidateScriptFailed(ProtoableNode node,
java.lang.String sScript,
java.lang.String sLanguage,
java.lang.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 disabled
true if validation should continuepublic int getFailCount()
public void resetFailCount()
FormModel.recalculate(boolean, FormModel.Validate, boolean)
is called.
public boolean validateBarcode(Element element,
java.lang.String sBarcodeType,
java.lang.String sValue)
true.
element - the barcode form Element.sBarcodeType - a String that identifies the barcode patternsValue - the barcode value
true if the barcode is valid
|
XFA4J | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||