001package org.gwtbootstrap3.client.ui.form.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    public static class Keys {
038
039        public static final String BLANK = "org.gwtbootstrap3.validation.Blank.message";
040
041        public static final String DECIMAL_MAX = "org.gwtbootstrap3.validation.DecimalMax.message";
042
043        public static final String DECIMAL_MIN = "org.gwtbootstrap3.validation.DecimalMin.message";
044
045        public static final String FIELD_MATCH = "org.gwtbootstrap3.validation.FieldMatch.message";
046
047        public static final String FUTURE = "org.gwtbootstrap3.validation.Future.message";
048
049        public static final String PAST = "org.gwtbootstrap3.validation.Past.message";
050
051        public static final String REGEX = "org.gwtbootstrap3.validation.RegEx.message";
052
053        public static final String SIZE = "org.gwtbootstrap3.validation.Size.message";
054
055    }
056
057    /**
058     * @return the blank validation message.
059     */
060    @Key(Keys.BLANK)
061    @DefaultStringValue("Field cannot be blank")
062    String org_gwtbootstrap3_validation_Blank_message();
063
064    /**
065     * @return the decimal max validation message.
066     */
067    @Key(Keys.DECIMAL_MAX)
068    @DefaultStringValue("Value must be less than or equal to {1}")
069    String org_gwtbootstrap3_validation_DecimalMax_message();
070
071    /**
072     * @return the decimal min validation message.
073     */
074    @Key(Keys.DECIMAL_MIN)
075    @DefaultStringValue("Value must be greater than or equal to {1}")
076    String org_gwtbootstrap3_validation_DecimalMin_message();
077
078    /**
079     * @return the field match validation message.
080     */
081    @Key(Keys.FIELD_MATCH)
082    @DefaultStringValue("{1} do not match")
083    String org_gwtbootstrap3_validation_FieldMatch_message();
084
085    /**
086     * @return the future validation message.
087     */
088    @Key(Keys.FUTURE)
089    @DefaultStringValue("Value must be in the future")
090    String org_gwtbootstrap3_validation_Future_message();
091
092    /**
093     * @return the past validation message.
094     */
095    @Key(Keys.PAST)
096    @DefaultStringValue("Value must be in the past")
097    String org_gwtbootstrap3_validation_Past_message();
098
099    /**
100     * @return the regular expression validation message.
101     */
102    @Key(Keys.REGEX)
103    @DefaultStringValue("Must match regex")
104    String org_gwtbootstrap3_validation_RegEx_message();
105
106    /**
107     * @return the size validation message.
108     */
109    @Key(Keys.SIZE)
110    @DefaultStringValue("Size must be between {1} and {2}")
111    String org_gwtbootstrap3_validation_Size_message();
112
113}