|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.aria.validation.AbstractValidator
org.formaria.swing.pojo.PojoValidator
public class PojoValidator
A validtor for validation of pojo field values
Copyright (c) Formaria Ltd., 2008
License: see license.txt
| Field Summary | |
|---|---|
protected java.lang.String |
dataPath
|
protected DataModel |
pojo
|
protected APojoValidator |
validator
|
| Fields inherited from class org.formaria.aria.validation.AbstractValidator |
|---|
container, currentProject, errorLevel, formattedMessage, mandatory, mask, message, showErrorBadges, start, translator, USE_FAIL_STYLE, USE_NORMAL_STYLE, USE_WARN_STYLE, validationMethod, validationName, value |
| Fields inherited from interface org.formaria.aria.validation.Validator |
|---|
IGNORE_BLANKS, LEVEL_ERROR, LEVEL_IGNORE, LEVEL_WARNING, MANDATORY, STRICT_CHECK, WEAK_CHECK |
| Constructor Summary | |
|---|---|
PojoValidator(Project project)
Create a new POJO validator |
|
| Method Summary | |
|---|---|
protected boolean |
applyErrorStyle(javax.swing.JComponent comp,
java.lang.String propertyName,
int level)
Apply the error style to the component with the matching property value |
java.lang.String |
getMessage()
Get the validation message which is formatted after the tokens have been replaced |
protected void |
getPojo()
Lookup the pojo |
void |
setup(XmlElement ruleConfig,
XmlElement instanceConfig)
Set the validation parameters |
void |
validate(java.lang.Object c,
boolean forceMandatory)
Carry out a page level or inline validation on the passed component |
int |
validateAllProperties(javax.swing.JComponent comp)
|
int |
validateProperties(javax.swing.JComponent comp,
boolean forceMandatory)
|
| Methods inherited from class org.formaria.aria.validation.AbstractValidator |
|---|
applyErrorStyle, getLevel, getMask, getName, getText, getValueAsString, invokeMethod, replaceToken, replaceTokens, setMask, setName, setValidationColors, setValidationMethod, throwException |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected APojoValidator validator
protected DataModel pojo
protected java.lang.String dataPath
| Constructor Detail |
|---|
public PojoValidator(Project project)
project - the owner project| Method Detail |
|---|
public void validate(java.lang.Object c,
boolean forceMandatory)
throws java.lang.Exception
Validator
c - The component whose value is to be validatedforceMandatory - Set to true if page level validations are taking place or false for inline
java.lang.Exception - throw if there is a problem
public int validateProperties(javax.swing.JComponent comp,
boolean forceMandatory)
throws java.lang.Exception
java.lang.Exception
public int validateAllProperties(javax.swing.JComponent comp)
throws java.lang.Exception
java.lang.Exception
public void setup(XmlElement ruleConfig,
XmlElement instanceConfig)
setup in interface Validatorsetup in class AbstractValidatorruleConfig - the validator parameters as declared in the validations rules fileinstanceConfig - the validator instance parameters as declared in the page filepublic java.lang.String getMessage()
getMessage in interface ValidatorgetMessage in class AbstractValidatorprotected void getPojo()
protected boolean applyErrorStyle(javax.swing.JComponent comp,
java.lang.String propertyName,
int level)
comp - propertyName - level -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||