org.mentawai.validation
Class Validator

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

public class Validator
extends java.lang.Object

Author:
Sergio Oliveira

Field Summary
static java.lang.String FIELD_TOKEN
           
 
Constructor Summary
Validator(java.util.Map<java.lang.String,java.lang.Object> rules, java.util.Map<java.lang.String,java.lang.Object> errors)
           
Validator(java.util.Map<java.lang.String,java.lang.Object> rules, java.util.Map<java.lang.String,java.lang.Object> errors, java.util.Map<java.lang.String,java.lang.Object> params)
           
 
Method Summary
 void add(java.lang.String field, Rule rule, int error_id)
           
 void add(java.lang.String field, Rule rule, int error_id, java.lang.String... params)
           
 void add(java.lang.String field, Rule rule, java.lang.String error_id)
           
 void add(java.lang.String field, Rule rule, java.lang.String error_id, java.lang.String... params)
           
protected  java.util.Map<java.lang.String,java.lang.String> getTokens(Action action, java.util.Map<java.lang.String,java.lang.String> tokens, java.lang.String field)
           
 void requiredFields(java.lang.String error_id, java.lang.String... fields)
           
 void requiredLists(java.lang.String error_id, java.lang.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 java.lang.String FIELD_TOKEN
Constructor Detail

Validator

public Validator(java.util.Map<java.lang.String,java.lang.Object> rules,
                 java.util.Map<java.lang.String,java.lang.Object> errors)

Validator

public Validator(java.util.Map<java.lang.String,java.lang.Object> rules,
                 java.util.Map<java.lang.String,java.lang.Object> errors,
                 java.util.Map<java.lang.String,java.lang.Object> params)
Method Detail

getTokens

protected java.util.Map<java.lang.String,java.lang.String> getTokens(Action action,
                                                                     java.util.Map<java.lang.String,java.lang.String> tokens,
                                                                     java.lang.String field)

validate

public boolean validate(Action action,
                        MessageContext msgContext)

add

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

requiredFields

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

requiredLists

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

add

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

add

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

add

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


Copyright © 2005 Mentawai Team. All Rights Reserved.