1 /* 2 * Copyright 1999-2005 The Apache Software Foundation. 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 package org.apache.cocoon.i18n; 17 18 import java.util.MissingResourceException; 19 20 import org.apache.avalon.framework.component.Component; 21 22 /** 23 * Resource bundle component interface. 24 * Provide the minimal number of methods to be used for i18n. 25 * 26 * @author <a HREF="mailto:kpiroumian@apache.org">Konstantin Piroumian</a> 27 * @version $Id: Bundle.java 312968 2005-10-11 22:28:46Z vgritsenko $ 28 */ 29 public interface Bundle extends Component { 30 31 String ROLE = Bundle.class.getName(); 32 33 /** 34 * Get string value by key. 35 * 36 * @param key 37 * @return Resource as string. 38 * @exception MissingResourceException if resource was not found 39 */ 40 String getString(String key) throws MissingResourceException; 41 42 /** 43 * Get object value by key. 44 * 45 * @param key The resource key. 46 * @return The resource as object. 47 * @exception MissingResourceException if resource was not found 48 */ 49 Object getObject(String key) throws MissingResourceException; 50 51 } 52