org.mentawai.rule
Interface Rule

All Known Implementing Classes:
BasicRule, BooleanRule, CNPJRule, ContainsRule, CPFRule, CriptRule, CrossRule, DateRule, DejavuRule, DependentFieldValueRule, DependentRule, DoubleRule, EmailRule, EqualRule, FileRule, FileSizeRule, ImageMinSizeRule, IntegerRule, LocaleRule, MethodRule, NumberRule, OptionsRule, RegexRule, RequiredFieldRule, RequiredRule, StringRule, TimeRule

public interface Rule

An interface that describes a validation rule.

Author:
Sergio Oliveira

Method Summary
 boolean check(String field, Action action)
          Check and validate the given field from the give action.
 Map<String,String> getTokens()
          Returns a map with tokens that can be used in the error messages.
 

Method Detail

getTokens

Map<String,String> getTokens()
Returns a map with tokens that can be used in the error messages. The tokens in the error messages will be replaced by the token values in this map.

Returns:
A map with the token values.

check

boolean check(String field,
              Action action)
Check and validate the given field from the give action.

Parameters:
field - The field to validate.
action - The action from where to get the field.
Returns:
true if the validation succeeds.


Copyright © 2013. All Rights Reserved.