| 1 | /* |
| 2 | * Copyright 2005-2006 The RbUtils Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | * |
| 16 | */ |
| 17 | |
| 18 | // $Id: ErrorType.java,v 1.3 2006/09/16 14:53:31 redfish Exp $ |
| 19 | |
| 20 | package org.ktc.rbutils.rb.check; |
| 21 | |
| 22 | import org.ktc.rbutils.api.i18n.Message; |
| 23 | |
| 24 | /** |
| 25 | * Indicates the type of an error during a check. |
| 26 | * @since RbUtils 0.4.2 |
| 27 | * @version $Revision: 1.3 $ |
| 28 | * @author redfish |
| 29 | */ |
| 30 | public class ErrorType { |
| 31 | // TODO Javadoc - class contract. |
| 32 | // RFE should be an enumerated type with a getdisplay() method |
| 33 | // TODO code - duplicated with RbUtilsHelper |
| 34 | |
| 35 | /** Name of the RessourceBundle for this class. */ |
| 36 | private static final String RESOURCE = errors.class.getName(); |
| 37 | |
| 38 | /** |
| 39 | * Instanciates a new ErrorType object. |
| 40 | */ |
| 41 | protected ErrorType() { |
| 42 | super(); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * {@inheritDoc} |
| 47 | */ |
| 48 | public static Message getLocalizedMessage(final String key, final Object[] args) { |
| 49 | return new Message(RESOURCE, key, args); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * {@inheritDoc} |
| 54 | */ |
| 55 | public static String getMessage(final String key, final Object[] args) { |
| 56 | return getLocalizedMessage(key, args).getMessage(); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * {@inheritDoc} |
| 61 | */ |
| 62 | public static String getMessage(final String key) { |
| 63 | return getLocalizedMessage(key, null).getMessage(); |
| 64 | } |
| 65 | |
| 66 | } |