org.apache.felix.metatype
Class DefaultMetaTypeProvider

java.lang.Object
  extended by org.apache.felix.metatype.DefaultMetaTypeProvider
All Implemented Interfaces:
MetaTypeProvider

public class DefaultMetaTypeProvider
extends Object
implements MetaTypeProvider

The DefaultMetaTypeProvider class is an implementation of the MetaTypeProvider interface whichis configured for a given bundle using a MetaData object.

This class may be used by clients, e.g. ManagedService or ManagedServiceFactory implementations to easily also implement the MetaTypeProvider interface.

Author:
fmeschbe

Constructor Summary
DefaultMetaTypeProvider(Bundle bundle, MetaData metadata)
           
 
Method Summary
 Bundle getBundle()
          Returns the Bundle to which this instance belongs.
 Designate getDesignate(String pid)
           
protected  Map getDesignates()
           
 String[] getLocales()
          Return a list of available locales.
 ObjectClassDefinition getObjectClassDefinition(String id, String locale)
          Returns an object class definition for the specified id localized to the specified locale.
protected  Map getObjectClassDefinitions()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMetaTypeProvider

public DefaultMetaTypeProvider(Bundle bundle,
                               MetaData metadata)
Method Detail

getBundle

public Bundle getBundle()
Returns the Bundle to which this instance belongs.


getLocales

public String[] getLocales()
Description copied from interface: MetaTypeProvider
Return a list of available locales. The results must be names that consists of language [ _ country [ _ variation ]] as is customary in the Locale class.

Specified by:
getLocales in interface MetaTypeProvider
Returns:
An array of locale strings or null if there is no locale specific localization can be found.

getObjectClassDefinition

public ObjectClassDefinition getObjectClassDefinition(String id,
                                                      String locale)
Description copied from interface: MetaTypeProvider
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 the Locale class. This Locale class is not used because certain profiles do not contain it.

Specified by:
getObjectClassDefinition in interface MetaTypeProvider
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 or null for default locale.
Returns:
A ObjectClassDefinition object.

getDesignate

public Designate getDesignate(String pid)

getObjectClassDefinitions

protected Map getObjectClassDefinitions()

getDesignates

protected Map getDesignates()


Copyright © 2011 Apache Software Foundation. All Rights Reserved.