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