org.robokind.api.interpolation
Class InterpolatorDirectory

java.lang.Object
  extended by org.robokind.api.interpolation.InterpolatorDirectory

public class InterpolatorDirectory
extends Object

A class for tracking various InterpolatorFactories. Capable of tracking InterpolatorFactories with or without OSGi support.

Author:
Matthew Stevenson

Field Summary
static String INTERPOLATOR_VERSION
          Interpolator VersionProperty XML type attribute value.
 
Constructor Summary
InterpolatorDirectory()
          Creates an empty InterpolatoryDirectory.
 
Method Summary
 List<InterpolatorFactory> buildFactoryList()
          Returns a List of all available InterpolatorFactories.
 InterpolatorFactory getDefaultFactory()
          Returns the InterpolatorFactory for creating default Interpolators.
 InterpolatorFactory getFactory(org.robokind.api.common.config.VersionProperty version)
          Returns an InterpolatorFactory for the given VersionProperty.
static InterpolatorDirectory instance()
          Retrieves the InterpolatorDirectory instance.
static org.osgi.framework.ServiceRegistration registerFactory(org.osgi.framework.BundleContext context, InterpolatorFactory fact)
          Registers an InterpolatorFactory to the directory using OSGi.
 void setContext(org.osgi.framework.BundleContext context)
          Sets the directory's BundleContext.
 void setDefault(InterpolatorFactory factory)
          Sets the default InterpolatorFactory.
 void useOSGi(boolean val)
          Sets if the InterpolatorDirectory should use OSGi or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERPOLATOR_VERSION

public static final String INTERPOLATOR_VERSION
Interpolator VersionProperty XML type attribute value.

See Also:
Constant Field Values
Constructor Detail

InterpolatorDirectory

public InterpolatorDirectory()
Creates an empty InterpolatoryDirectory. By default, does not utilize OSGi.

Method Detail

instance

public static InterpolatorDirectory instance()
Retrieves the InterpolatorDirectory instance.

Returns:
InterpolatorDirectory instance

registerFactory

public static org.osgi.framework.ServiceRegistration registerFactory(org.osgi.framework.BundleContext context,
                                                                     InterpolatorFactory fact)
Registers an InterpolatorFactory to the directory using OSGi.

Parameters:
context - BundleContext to register with
fact - InterpolatorFactory to register
Returns:
ServiceRegistration of the InterpolatorFactory

getDefaultFactory

public InterpolatorFactory getDefaultFactory()
Returns the InterpolatorFactory for creating default Interpolators.

Returns:
InterpolatorFactory for creating default Interpolators

getFactory

public InterpolatorFactory getFactory(org.robokind.api.common.config.VersionProperty version)
Returns an InterpolatorFactory for the given VersionProperty. If an InterpolatorFactory cannot be found for the VersionProperty, the default factory is returned.

Parameters:
version - Interpolator Version of the Factory to retrieve
Returns:
InterpolatorFactory for the given VersionProperty. If an InterpolatorFactory cannot be found for the VersionProperty, the default factory is returned

buildFactoryList

public List<InterpolatorFactory> buildFactoryList()
Returns a List of all available InterpolatorFactories.

Returns:
List of all available InterpolatorFactories

setDefault

public void setDefault(InterpolatorFactory factory)
Sets the default InterpolatorFactory.

Parameters:
factory - InterpolatorFactory to set as default

setContext

public void setContext(org.osgi.framework.BundleContext context)
Sets the directory's BundleContext.

Parameters:
context - BundleContext to set

useOSGi

public void useOSGi(boolean val)
Sets if the InterpolatorDirectory should use OSGi or not.

Parameters:
val - if true, this InterpolatorDirectory will use OSGi


Copyright © 2011. All Rights Reserved.