org.clearsilver
Class FactoryLoader

java.lang.Object
  extended by org.clearsilver.FactoryLoader

public final class FactoryLoader
extends Object

This class holds static methods for getting and setting the CS and HDF factory used throughout the Java Clearsilver Framework. Clients are strongly encouraged to not use this class, and instead directly inject ClearsilverFactory into the classes that need to create HDF and CS instances. For now, projects should set the ClearsilverFactory in FactoryLoader and use the singleton accessor getClearsilverFactory() if proper dependency injection is not easy to implement.

Allows the default implementation to be the original JNI version without requiring users that don't want to use the JNI version to have to link it in. The ClearsilverFactory object to use can be either passed into the setClearsilverFactory(org.clearsilver.ClearsilverFactory) method or the class name can be specified in the Java property org.clearsilver.defaultClearsilverFactory.


Constructor Summary
FactoryLoader()
           
 
Method Summary
static ClearsilverFactory getClearsilverFactory()
          Get the ClearsilverFactory object to be used by disparate parts of the application.
static ClearsilverFactory setClearsilverFactory(ClearsilverFactory clearsilverFactory)
          Set the ClearsilverFactory to be used by the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryLoader

public FactoryLoader()
Method Detail

getClearsilverFactory

public static ClearsilverFactory getClearsilverFactory()
Get the ClearsilverFactory object to be used by disparate parts of the application.


setClearsilverFactory

public static ClearsilverFactory setClearsilverFactory(ClearsilverFactory clearsilverFactory)
Set the ClearsilverFactory to be used by the application. If parameter is null, then the default factory implementation will be used the next time getClearsilverFactory() is called.

Returns:
the previous factory (may return null)


Copyright © 2010-2012 Google. All Rights Reserved.