org.javalid.annotations.validation
Annotation Type ValidateMap


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

Annotate a method returning a java.util.Map, where the elements in the map require validation. The framework will then validate each element in the map. It is recommended that the Map contains the same type of elements, however this is not a requirement.

Since:
1.0
Version:
1.0
Author:
M.Reuvers

Optional Element Summary
 java.lang.String[] applyToGroups
          Specify for which groups this annotation must be applied.
 java.lang.String expressionForIndex
          This is a special property and is usually not necessary to set.
 boolean globalMessage
          If this annotation's message must be added as global message instead of real validation path.
 

applyToGroups

public abstract java.lang.String[] applyToGroups
Specify for which groups this annotation must be applied. By default if you annotate without this variable, the annotation is applied for any group on that method (which is what you usually want). However by specifying the exact groups you can turn on/off a validation on a method depending on the group you validate.

Defaults to JvGroup.GROUP_APPLY_ALL

Default:
"_all_"

expressionForIndex

public abstract java.lang.String expressionForIndex
This is a special property and is usually not necessary to set. However if you use for instance JSF expressions and the Map you annotated is itself resolved by a JSF expression (in your page), you must set this to that part of the expression. An example:
<h:inputText value="#{beanName.mapName[anotherBean.specialKey]}" />

As you can see the map called 'mapName' its key is resolved by an expression: anotherBean.specialKey. In this case you should set: anotherBean.specialKey here, to make sure that the path is set correctly if you convert validationmessages to JSF messages.

For #{beanName.mapName['key']} it would NOT be necessary to set this property as it is a direct key.

Default:
""

globalMessage

public abstract boolean globalMessage
If this annotation's message must be added as global message instead of real validation path. Defaults to false (thus will be added with validation path if invalid).

Default:
false