Package org.osgi.service.metatype
Interface MetaTypeProvider
-
- All Known Subinterfaces:
MetaTypeInformation
- All Known Implementing Classes:
DefaultMetaTypeProvider
@ConsumerType public interface MetaTypeProvider
Provides access to metatypes. This interface can be implemented on a Managed Service or Managed Service Factory as well as registered as a service. When registered as a service, it must be registered with aMETATYPE_FACTORY_PIDorMETATYPE_PIDservice property (or both). Any PID mentioned in either of these factories must be a valid argument to thegetObjectClassDefinition(String, String)method.
-
-
Field Summary
Fields Modifier and Type Field Description static StringMETATYPE_FACTORY_PIDService property to signal that this service hasObjectClassDefinitionobjects for the given factory PIDs.static StringMETATYPE_PIDService property to signal that this service hasObjectClassDefinitionobjects for the given PIDs.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String[]getLocales()Return a list of available locales.ObjectClassDefinitiongetObjectClassDefinition(String id, String locale)Returns an object class definition for the specified id localized to the specified locale.
-
-
-
Field Detail
-
METATYPE_PID
static final String METATYPE_PID
Service property to signal that this service hasObjectClassDefinitionobjects for the given PIDs. The type of this service property isString+.- Since:
- 1.2
- See Also:
- Constant Field Values
-
METATYPE_FACTORY_PID
static final String METATYPE_FACTORY_PID
Service property to signal that this service hasObjectClassDefinitionobjects for the given factory PIDs. The type of this service property isString+.- Since:
- 1.2
- See Also:
- Constant Field Values
-
-
Method Detail
-
getObjectClassDefinition
ObjectClassDefinition getObjectClassDefinition(String id, String locale)
Returns an object class definition for the specified id localized to the specified locale.The locale parameter must be a name that consists of
language[ "_"country[ "_"variation] ] as is customary in theLocaleclass. ThisLocaleclass is not used because certain profiles do not contain it.- Parameters:
id- The ID of the requested object class. This can be a pid or factory pid returned by getPids or getFactoryPids.locale- The locale of the definition ornullfor default locale.- Returns:
- A
ObjectClassDefinitionobject. - Throws:
IllegalArgumentException- If the id or locale arguments are not valid
-
getLocales
String[] getLocales()
Return a list of available locales. The results must be names that consists of language [ _ country [ _ variation ]] as is customary in theLocaleclass.- Returns:
- An array of locale strings or
nullif there is no locale specific localization can be found.
-
-