001 /*
002 * JBoss, Home of Professional Open Source.
003 * Copyright 2008, Red Hat Middleware LLC, and individual contributors
004 * as indicated by the @author tags. See the copyright.txt file in the
005 * distribution for a full listing of individual contributors.
006 *
007 * This is free software; you can redistribute it and/or modify it
008 * under the terms of the GNU Lesser General Public License as
009 * published by the Free Software Foundation; either version 2.1 of
010 * the License, or (at your option) any later version.
011 *
012 * This software is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * You should have received a copy of the GNU Lesser General Public
018 * License along with this software; if not, write to the Free
019 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021 */
022 package org.jboss.dna.common;
023
024 import java.util.Locale;
025 import java.util.Set;
026 import org.jboss.dna.common.i18n.I18n;
027
028 /**
029 * @author John Verhaeg
030 * @author Randall Hauch
031 */
032 public final class CommonI18n {
033
034 // Make sure the following I18n.java-related fields are defined before all other fields to ensure a valid error message is
035 // produced in the event of a missing/duplicate/unused property
036
037 public static I18n i18nClassInterface;
038 public static I18n i18nClassNotPublic;
039 public static I18n i18nFieldFinal;
040 public static I18n i18nFieldInvalidType;
041 public static I18n i18nFieldNotPublic;
042 public static I18n i18nFieldNotStatic;
043 public static I18n i18nLocalizationFileNotFound;
044 public static I18n i18nLocalizationProblems;
045 public static I18n i18nPropertyDuplicate;
046 public static I18n i18nPropertyMissing;
047 public static I18n i18nPropertyUnused;
048 public static I18n i18nRequiredToSuppliedParameterMismatch;
049
050 // Core-related fields
051 public static I18n argumentDidNotContainKey;
052 public static I18n argumentDidNotContainObject;
053 public static I18n argumentMayNotBeEmpty;
054 public static I18n argumentMayNotBeGreaterThan;
055 public static I18n argumentMayNotBeLessThan;
056 public static I18n argumentMayNotBeNegative;
057 public static I18n argumentMayNotBeNull;
058 public static I18n argumentMayNotBeNullOrZeroLength;
059 public static I18n argumentMayNotBeNullOrZeroLengthOrEmpty;
060 public static I18n argumentMayNotBePositive;
061 public static I18n argumentMayNotContainNullValue;
062 public static I18n argumentMustBeEmpty;
063 public static I18n argumentMustBeEquals;
064 public static I18n argumentMustBeGreaterThan;
065 public static I18n argumentMustBeGreaterThanOrEqualTo;
066 public static I18n argumentMustBeInstanceOf;
067 public static I18n argumentMustBeLessThan;
068 public static I18n argumentMustBeLessThanOrEqualTo;
069 public static I18n argumentMustBeNegative;
070 public static I18n argumentMustBeNull;
071 public static I18n argumentMustBeNumber;
072 public static I18n argumentMustBeOfMaximumSize;
073 public static I18n argumentMustBeOfMinimumSize;
074 public static I18n argumentMustBePositive;
075 public static I18n argumentMustBeSameAs;
076 public static I18n argumentMustNotBeEquals;
077 public static I18n argumentMustNotBeSameAs;
078 public static I18n componentClassnameNotValid;
079 public static I18n componentNotConfigured;
080 public static I18n dateParsingFailure;
081 public static I18n initialActivityMonitorTaskName;
082 public static I18n nullActivityMonitorTaskName;
083 public static I18n pathAncestorDegreeIsInvalid;
084 public static I18n pathCannotBeNormalized;
085 public static I18n pathIsAlreadyAbsolute;
086 public static I18n pathIsNotAbsolute;
087 public static I18n pathIsNotRelative;
088 public static I18n requiredToSuppliedParameterMismatch;
089
090 static {
091 try {
092 I18n.initialize(CommonI18n.class);
093 } catch (final Exception err) {
094 System.err.println(err);
095 }
096 }
097
098 public static Set<Locale> getLocalizationProblemLocales() {
099 return I18n.getLocalizationProblemLocales(CommonI18n.class);
100 }
101
102 public static Set<String> getLocalizationProblems() {
103 return I18n.getLocalizationProblems(CommonI18n.class);
104 }
105
106 public static Set<String> getLocalizationProblems( Locale locale ) {
107 return I18n.getLocalizationProblems(CommonI18n.class, locale);
108 }
109 }