org.daisy.dotify.api.obfl.ExpressionFactory Maven / Gradle / Ivy
package org.daisy.dotify.api.obfl;
/**
* Provides a factory for expressions.
*
* @author Joel Håkansson
*/
public interface ExpressionFactory {
/**
* Creates a new expression implementation.
*
* @return returns a new expression implementation
*/
public Expression newExpression();
/**
* Informs the implementation that it was discovered and instantiated using
* information collected from a file within the META-INF/services
directory.
* In other words, it was created using SPI (service provider interfaces).
*
* This information, in turn, enables the implementation to use the same mechanism
* to set dependencies as needed.
*
* If this information is not given, an implementation
* should avoid using SPIs and instead use
* declarative services
* for dependency injection as specified by OSGi. Note that this also applies to
* several newInstance() methods in the Java API.
*
* The class that created an instance with SPI must call this method before
* putting it to use.
*/
public default void setCreatedWithSPI() {
}
}