001/* 002 * #%L 003 * GwtBootstrap3 004 * %% 005 * Copyright (C) 2015 GwtBootstrap3 006 * %% 007 * Licensed under the Apache License, Version 2.0 (the "License"); 008 * you may not use this file except in compliance with the License. 009 * You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 * #L% 019 */ 020package gwt.material.design.client.base.validator; 021 022import com.google.gwt.i18n.client.ConstantsWithLookup; 023import com.google.gwt.i18n.client.LocalizableResource.DefaultLocale; 024 025/** 026 * Validation messages. 027 * <p> 028 * Message functions should be the key with "_" replacing any periods. This allows the 029 * ValidationMessageResolver to find the message by key. 030 * 031 * @author Steven Jardine 032 */ 033@DefaultLocale("en") 034public interface ValidationMessages extends ConstantsWithLookup { 035 036 class Keys { 037 038 public static final String BLANK = "gwt.material.design.validation.Blank.message"; 039 040 public static final String DECIMAL_MAX = "gwt.material.design.validation.DecimalMax.message"; 041 042 public static final String DECIMAL_MIN = "gwt.material.design.validation.DecimalMin.message"; 043 044 public static final String FIELD_MATCH = "gwt.material.design.validation.FieldMatch.message"; 045 046 public static final String FUTURE = "gwt.material.design.validation.Future.message"; 047 048 public static final String PAST = "gwt.material.design.validation.Past.message"; 049 050 public static final String REGEX = "gwt.material.design.validation.RegEx.message"; 051 052 public static final String SIZE = "gwt.material.design.validation.Size.message"; 053 } 054 055 /** 056 * @return the blank validation message. 057 */ 058 @Key(Keys.BLANK) 059 @DefaultStringValue("Field cannot be blank") 060 String gwt_material_design_validation_Blank_message(); 061 062 /** 063 * @return the decimal max validation message. 064 */ 065 @Key(Keys.DECIMAL_MAX) 066 @DefaultStringValue("Value must be less than or equal to {1}") 067 String gwt_material_design_validation_DecimalMax_message(); 068 069 /** 070 * @return the decimal min validation message. 071 */ 072 @Key(Keys.DECIMAL_MIN) 073 @DefaultStringValue("Value must be greater than or equal to {1}") 074 String gwt_material_design_validation_DecimalMin_message(); 075 076 /** 077 * @return the field match validation message. 078 */ 079 @Key(Keys.FIELD_MATCH) 080 @DefaultStringValue("{1} do not match") 081 String gwt_material_design_validation_FieldMatch_message(); 082 083 /** 084 * @return the future validation message. 085 */ 086 @Key(Keys.FUTURE) 087 @DefaultStringValue("Value must be in the future") 088 String gwt_material_design_validation_Future_message(); 089 090 /** 091 * @return the past validation message. 092 */ 093 @Key(Keys.PAST) 094 @DefaultStringValue("Value must be in the past") 095 String gwt_material_design_validation_Past_message(); 096 097 /** 098 * @return the regular expression validation message. 099 */ 100 @Key(Keys.REGEX) 101 @DefaultStringValue("Must match regex") 102 String gwt_material_design_validation_RegEx_message(); 103 104 /** 105 * @return the size validation message. 106 */ 107 @Key(Keys.SIZE) 108 @DefaultStringValue("Size must be between {1} and {2}") 109 String gwt_material_design_validation_Size_message(); 110 111}