ninja.validation
Annotation Type Length


@Retention(value=RUNTIME)
@Target(value=PARAMETER)
public @interface Length

Validates that the length of the field meets the given length constraints

Author:
James Roper

Optional Element Summary
 String fieldKey
          The key for formatting the field
 int max
          The maximum length of the field
 String maxKey
          The key max violation message
 String maxMessage
          Default message if max violation message isn't found
 int min
          The maximum length of the field
 String minKey
          The key min violation message
 String minMessage
          Default message if min violation message isn't found
 

max

public abstract int max
The maximum length of the field

Default:
-1

min

public abstract int min
The maximum length of the field

Default:
-1

maxKey

public abstract String maxKey
The key max violation message

Returns:
The key of the max violation message
Default:
"validation.length.max.violation"

maxMessage

public abstract String maxMessage
Default message if max violation message isn't found

Returns:
The default message
Default:
"{0} exceeds maximum length of {1}"

minKey

public abstract String minKey
The key min violation message

Returns:
The key of the min violation message
Default:
"validation.length.min.violation"

minMessage

public abstract String minMessage
Default message if min violation message isn't found

Returns:
The default message
Default:
"{0} is less than minimum length of {1}"

fieldKey

public abstract String fieldKey
The key for formatting the field

Returns:
The key
Default:
""


Copyright © 2012. All Rights Reserved.