org.mentawai.validation
Class Validator

java.lang.Object
  extended by org.mentawai.validation.Validator

public class Validator
extends Object

Author:
Sergio Oliveira

Field Summary
static String FIELD_TOKEN
           
 
Constructor Summary
Validator(Map<String,Object> rules, Map<String,Object> errors)
           
Validator(Map<String,Object> rules, Map<String,Object> errors, Map<String,Object> params)
           
 
Method Summary
 void add(String field, Rule rule, int error_id)
           
 void add(String field, Rule rule, int error_id, String... params)
           
 void add(String field, Rule rule, String error_id)
           
 void add(String field, Rule rule, String error_id, String... params)
           
 void criptedFields(String error_id, String... fields)
           
protected  Map<String,String> getTokens(Action action, Map<String,String> tokens, String field)
           
 void requiredFields(String error_id, String... fields)
           
 void requiredLists(String error_id, String... fields)
           
 boolean validate(Action action, MessageContext msgContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIELD_TOKEN

public static String FIELD_TOKEN
Constructor Detail

Validator

public Validator(Map<String,Object> rules,
                 Map<String,Object> errors)

Validator

public Validator(Map<String,Object> rules,
                 Map<String,Object> errors,
                 Map<String,Object> params)
Method Detail

getTokens

protected Map<String,String> getTokens(Action action,
                                       Map<String,String> tokens,
                                       String field)

validate

public boolean validate(Action action,
                        MessageContext msgContext)

add

public void add(String field,
                Rule rule,
                String error_id)

requiredFields

public void requiredFields(String error_id,
                           String... fields)

criptedFields

public void criptedFields(String error_id,
                          String... fields)

requiredLists

public void requiredLists(String error_id,
                          String... fields)

add

public void add(String field,
                Rule rule,
                String error_id,
                String... params)

add

public void add(String field,
                Rule rule,
                int error_id)

add

public void add(String field,
                Rule rule,
                int error_id,
                String... params)


Copyright © 2013. All Rights Reserved.