|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.tutorial.property.constraints.PropertyConstraintsWithGroupsTutorial
@Document(title="Property Constraints With Groups", sortKey="basics0060") @DocCategory(value="basics") public class PropertyConstraintsWithGroupsTutorial
This tutorial introduces how to add constraints to the property declaration.
This feature takes the burden of validation from the developers shoulders. It is based on Beans Validation (JSR-303), so any constraint defined with this technology can be used for validating properties.
Constructor Summary | |
---|---|
PropertyConstraintsWithGroupsTutorial() |
Method Summary | |
---|---|
void |
calledWithUnknownGroup() If there are no constraints in the given group, every value is valid. |
void |
declaredDefaultGroup() Having no group or explicitly set the constraint in a default group has the same effect. |
void |
declaredDefaultGroupExplictCallWithDefaultGroup() And it is also the same if you call the validation using the default group. |
void |
invalidInStartupGroup() Let's have a look at some examples that use groups to activate and deactivate constraints for a particular validation. |
void |
setUp() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyConstraintsWithGroupsTutorial()
Method Detail |
---|
public void setUp()
@DocSection public void invalidInStartupGroup()
Let's have a look at some examples that use groups to activate and deactivate constraints for a particular validation.
In the following example the value 11
is correct in the default group, but not in the startup group.
@DocSection public void declaredDefaultGroup()
Having no group or explicitly set the constraint in a default group has the same effect.
@DocSection public void declaredDefaultGroupExplictCallWithDefaultGroup()
And it is also the same if you call the validation using the default group.
@DocSection public void calledWithUnknownGroup()
If there are no constraints in the given group, every value is valid.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |