com.planetalia.dynject.validation
Annotation Type ValueConstraint


@Target(value={FIELD,METHOD})
@Retention(value=RUNTIME)
public @interface ValueConstraint

Requires that a value be within a set of boundaries. Unlike the MinInclusive and similar annotations, this annotation works for just about any data type that can be represented as a string.

ValueConstraint can operate on:

Author:
Alexander Hristov

Optional Element Summary
 java.lang.String errorCode
          Error code to use if validation fails.
 java.lang.String[] invalidValues
          Array of values that the value must NOT be equal to
 java.lang.String maxExclusive
          Maximum acceptable value, exclusive.
 java.lang.String maxInclusive
          Maximum acceptable value, inclusive.
 java.lang.String message
          Literal message to use if validation fails.
 java.lang.String messageKey
          Message key to use if validation fails.
 java.lang.String minExclusive
          Minimum acceptable value, exclusive
 java.lang.String minInclusive
          Minimum acceptable value, inclusive.
 java.lang.Class<? extends IDataHandler>[] validators
          Array of User-defined classes for value validation
 java.lang.String[] validValues
          Array of values that the value must be equal to
 

minInclusive

public abstract java.lang.String minInclusive
Minimum acceptable value, inclusive.

Returns:
Minimum acceptable value, inclusive.
Default:
""

maxInclusive

public abstract java.lang.String maxInclusive
Maximum acceptable value, inclusive.

Returns:
Maximum acceptable value, inclusive.
Default:
""

minExclusive

public abstract java.lang.String minExclusive
Minimum acceptable value, exclusive

Returns:
Minimum acceptable value, exclusive
Default:
""

maxExclusive

public abstract java.lang.String maxExclusive
Maximum acceptable value, exclusive.

Returns:
Maximum acceptable value, exclusive.
Default:
""

invalidValues

public abstract java.lang.String[] invalidValues
Array of values that the value must NOT be equal to

Returns:
Set of values that the value must NOT be equal to
Default:
{}

validValues

public abstract java.lang.String[] validValues
Array of values that the value must be equal to

Returns:
Set of values that the value must be equal to
Default:
{}

validators

public abstract java.lang.Class<? extends IDataHandler>[] validators
Array of User-defined classes for value validation

Returns:
User-defined classes for value validation
Default:
{}

message

public abstract java.lang.String message
Literal message to use if validation fails.

Returns:
Literal message to use if validation fails.
Default:
""

messageKey

public abstract java.lang.String messageKey
Message key to use if validation fails. Default is Messages.MAX_INCLUSIVE

Returns:
Message key to use if validation fails.
Default:
"dynject.validation.maxInclusive"

errorCode

public abstract java.lang.String errorCode
Error code to use if validation fails.

Returns:
Error code to use if validation fails.
Default:
""