Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.1.2)

Part Number E27170-01

weblogic.descriptor.example
Interface ExampleValidationBean


public interface ExampleValidationBean

Defines a bean that illustrate the various validation options.

This bean declares the object-level validator ExampleCustomValidator.validateExampleValidationBean(weblogic.descriptor.example.ExampleValidationBean) using a BeanAnnotations.VALIDATOR annotation. This validator will be called whenever on-demand validation is triggered.


Method Summary
 int getConstrainedInt()
          Defines an int property whose value must be in the range [0, 10].
 String getEnumeratedString()
          Defines a String property whose value must be either "one", "two" or "three".
 int getMaximum()
          Defines a property maximum that is constrained to never be less than the value of ExampleValidationBean.getMinimum() using a deferred validator.
 int getMinimum()
          Defines a property minimum that is constrained to never exceed the value of ExampleValidationBean.getMaximum() using a deferred validator.
 String getNonEmptyString()
          Defines a String property whose length must be greater than 0
 int getNonNullString()
          Defines an String property that may not be null
 String getURI()
          Defines a String property whose value is validated by the custom validator method.
 void setConstrainedInt(int value)
          See ExampleValidationBean.getConstrainedInt().
 void setEnumeratedString(String value)
          See ExampleValidationBean.getEnumeratedString().
 void setMaximum(int value)
          See ExampleValidationBean.getMaximum().
 void setMinimum(int value)
          See ExampleValidationBean.getMinimum().
 void setNonEmptyString(String value)
          See ExampleValidationBean.getNonEmptyString().
 void setNonNullString(String value)
          See ExampleValidationBean.getNonNullString().
 void setURI(String value)
          See ExampleValidationBean.getURI(); Uses the PropertyAnnotations.VALIDATOR annotation to specify a custom method to be called to validate the property value.
 

Method Detail

getConstrainedInt

int getConstrainedInt()
Defines an int property whose value must be in the range [0, 10].


setConstrainedInt

void setConstrainedInt(int value)
See ExampleValidationBean.getConstrainedInt(). Uses PropertyAnnotations.LEGAL_MIN and PropertyAnnotations.LEGAL_MAX annotations to specify the lower and upper bounds.

Parameters:
value -
Maximum Value:
10
Minimum Value:
0

getNonNullString

int getNonNullString()
Defines an String property that may not be null


setNonNullString

void setNonNullString(String value)
See ExampleValidationBean.getNonNullString(). Uses the PropertyAnnotations.NULLABLE annotation to indicate that this String may not be null.

Parameters:
value -
This method can NOT set a null value.

getNonEmptyString

String getNonEmptyString()
Defines a String property whose length must be greater than 0


setNonEmptyString

void setNonEmptyString(String value)
See ExampleValidationBean.getNonEmptyString(). Uses the PropertyAnnotations.LEGAL_ZERO_LENGTH annotation to indicate that this String not have a zero length.

Parameters:
value -
This method can NOT set a value of zero length.

getEnumeratedString

String getEnumeratedString()
Defines a String property whose value must be either "one", "two" or "three".


setEnumeratedString

void setEnumeratedString(String value)
See ExampleValidationBean.getEnumeratedString(). Uses the PropertyAnnotations.ENUMERATION annotation to indicate that this String may only be one of {"one", "two", "three"}.

Parameters:
value -
Valid Values:
"one", "two", "three"

getURI

String getURI()
Defines a String property whose value is validated by the custom validator method.


setURI

void setURI(String value)
See ExampleValidationBean.getURI(); Uses the PropertyAnnotations.VALIDATOR annotation to specify a custom method to be called to validate the property value. The method, ExampleCustomValidator.validateURI(java.lang.String) will be called whenever this setter is called.

Parameters:
value -

getMinimum

int getMinimum()
Defines a property minimum that is constrained to never exceed the value of ExampleValidationBean.getMaximum() using a deferred validator.


setMinimum

void setMinimum(int value)
See ExampleValidationBean.getMinimum(). Uses the PropertyAnnotations.DEFERRED_VALIDATOR annotation to specify a custom method to be called whenever on-demand validation is triggered. This method, ExampleCustomValidator.validateMinLessThanMax(weblogic.descriptor.example.ExampleValidationBean), is free to consider multiple properties and even span beans in the tree. Note that the same validator annotation appears on ExampleValidationBean.setMaximum(int). In such cases, the validator will only be called once during on-demand validation.

Parameters:
value -

getMaximum

int getMaximum()
Defines a property maximum that is constrained to never be less than the value of ExampleValidationBean.getMinimum() using a deferred validator.


setMaximum

void setMaximum(int value)
See ExampleValidationBean.getMaximum(). Uses the PropertyAnnotations.DEFERRED_VALIDATOR annotation to specify a custom method to be called whenever on-demand validation is triggered. See ExampleValidationBean.setMinimum(int) for more details.

Parameters:
value -

Copyright 1996, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.1.2)

Part Number E27170-01