001 /*
002 * Copyright (c) OSGi Alliance (2001, 2008). All Rights Reserved.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.osgi.service.metatype;
017
018 /**
019 * Provides access to metatypes.
020 *
021 * @version $Revision: 5673 $
022 */
023 public interface MetaTypeProvider {
024 /**
025 * Returns an object class definition for the specified id localized to the
026 * specified locale.
027 *
028 * <p>
029 * The locale parameter must be a name that consists of <code>language</code>[
030 * "_" <code>country</code>[ "_" <code>variation</code>] ] as is customary in
031 * the <code>Locale</code> class. This <code>Locale</code> class is not used
032 * because certain profiles do not contain it.
033 *
034 * @param id The ID of the requested object class. This can be a pid or
035 * factory pid returned by getPids or getFactoryPids.
036 * @param locale The locale of the definition or <code>null</code> for default
037 * locale.
038 * @return A <code>ObjectClassDefinition</code> object.
039 * @throws IllegalArgumentException If the id or locale arguments are not
040 * valid
041 */
042 public ObjectClassDefinition getObjectClassDefinition(String id, String locale);
043
044 /**
045 * Return a list of available locales.
046 *
047 * The results must be names that consists of language [ _ country [ _
048 * variation ]] as is customary in the <code>Locale</code> class.
049 *
050 * @return An array of locale strings or <code>null</code> if there is no
051 * locale specific localization can be found.
052 *
053 */
054 public String[] getLocales();
055 }