org.eclipse.mylyn.wikitext.core.util
Class ServiceLocator

java.lang.Object
  extended by org.eclipse.mylyn.wikitext.core.util.ServiceLocator

public class ServiceLocator
extends Object

A service locator for use both inside and outside of an Eclipse environment. Provides access to markup languages by name.

Since:
1.0
Author:
David Green

Field Summary
protected  ClassLoader classLoader
           
 
Constructor Summary
protected ServiceLocator(ClassLoader classLoader)
           
 
Method Summary
static ServiceLocator getInstance()
          Get an instance of the service locator
static ServiceLocator getInstance(ClassLoader classLoader)
          Get an instance of the service locator
 MarkupLanguage getMarkupLanguage(String languageName)
          get a markup language by name
static void setImplementation(Class<? extends ServiceLocator> implementationClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classLoader

protected final ClassLoader classLoader
Constructor Detail

ServiceLocator

protected ServiceLocator(ClassLoader classLoader)
Method Detail

getInstance

public static ServiceLocator getInstance(ClassLoader classLoader)
Get an instance of the service locator

Parameters:
classLoader - the class loader to use when looking up services
See Also:
getInstance()

getInstance

public static ServiceLocator getInstance()
Get an instance of the service locator

See Also:
getInstance(ClassLoader)

getMarkupLanguage

public MarkupLanguage getMarkupLanguage(String languageName)
                                 throws IllegalArgumentException
get a markup language by name

Parameters:
languageName - the name of the markup language, or the fully qualified name of the class that implements the language
Returns:
the language implementation
Throws:
IllegalArgumentException - if the provided language name is null or if no implementation is available for the given language

setImplementation

public static void setImplementation(Class<? extends ServiceLocator> implementationClass)


Copyright © 2011 FuseSource, Corp.. All Rights Reserved.