org.mentawai.rule
Class CriptRule

java.lang.Object
  extended by org.mentawai.rule.CriptRule
All Implemented Interfaces:
Rule

public class CriptRule
extends Object
implements Rule

A rule that validate if cripted fields are ok and already decript them.

Author:
Robert Willian Gil

Method Summary
 boolean check(String field, Action action)
          Check and validate the given field from the give action.
static CriptRule getCommonInstance()
          Get an instance that use one key pre configured always
static CriptRule getInstance()
          Get an instance that use one key per session
 Map<String,String> getTokens()
          Returns a map with tokens that can be used in the error messages.
protected  String removePrefix(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CriptRule getInstance()
Get an instance that use one key per session

Returns:
CriptRule instance

getCommonInstance

public static CriptRule getCommonInstance()
Get an instance that use one key pre configured always

Returns:
CriptRule instance

check

public boolean check(String field,
                     Action action)
Description copied from interface: Rule
Check and validate the given field from the give action.

Specified by:
check in interface Rule
Parameters:
field - The field to validate.
action - The action from where to get the field.
Returns:
true if the validation succeeds.

getTokens

public Map<String,String> getTokens()
Description copied from interface: Rule
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.

Specified by:
getTokens in interface Rule
Returns:
A map with the token values.

removePrefix

protected String removePrefix(String s)


Copyright © 2013. All Rights Reserved.