org.mentawai.rule
Class TimeRule
java.lang.Object
org.mentawai.rule.LocaleRule
org.mentawai.rule.TimeRule
- All Implemented Interfaces:
- Rule
public class TimeRule
- extends LocaleRule
- Author:
- Jocenildo Paraizo
|
Constructor Summary |
TimeRule()
Creates a rule using the default DateFormat style (SHORT). |
TimeRule(int style)
Creates a rule using the given DateFormat style. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TimeRule
public TimeRule()
- Creates a rule using the default DateFormat style (SHORT).
TimeRule
public TimeRule(int style)
- Creates a rule using the given DateFormat style.
- Parameters:
style - The DateFormat style. (Ex: DateFormat.HOUR_OF_DAY0_FIELD, DateFormat.SHORT, etc.)
getInstance
public static TimeRule getInstance()
getInstance
public static TimeRule getInstance(int style)
check
public boolean check(String value,
Locale locale)
- Description copied from class:
LocaleRule
- Check a single input value from this action considering its locale.
Override this method to implement a locale rule for validation.
- Specified by:
check in class LocaleRule
- Parameters:
value - The value to validate.locale - The locale to consider in the validation.
- Returns:
- true if the validation was successful.
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- Overrides:
getTokens in class LocaleRule
- Returns:
- A map with the token values.
Copyright © 2011. All Rights Reserved.