Class ExpressionFactoryImpl
- java.lang.Object
-
- org.daisy.dotify.formatter.impl.obfl.ExpressionFactoryImpl
-
- All Implemented Interfaces:
ExpressionFactory
public class ExpressionFactoryImpl extends Object implements ExpressionFactory
Provides an expression factory implementation.
-
-
Constructor Summary
Constructors Constructor Description ExpressionFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExpressionnewExpression()Creates a new expression implementation.voidsetCreatedWithSPI()Informs the implementation that it was discovered and instantiated using information collected from a file within theMETA-INF/servicesdirectory.voidsetInteger2TextFactory(Integer2TextFactoryMakerService service)Sets a factory dependency.voidunsetInteger2TextFactory(Integer2TextFactoryMakerService service)Removes a factory dependency.
-
-
-
Method Detail
-
newExpression
public Expression newExpression()
Description copied from interface:ExpressionFactoryCreates a new expression implementation.- Specified by:
newExpressionin interfaceExpressionFactory- Returns:
- returns a new expression implementation
-
setInteger2TextFactory
public void setInteger2TextFactory(Integer2TextFactoryMakerService service)
Sets a factory dependency.- Parameters:
service- the dependency
-
unsetInteger2TextFactory
public void unsetInteger2TextFactory(Integer2TextFactoryMakerService service)
Removes a factory dependency.- Parameters:
service- the dependency to remove
-
setCreatedWithSPI
public void setCreatedWithSPI()
Description copied from interface:ExpressionFactoryInforms the implementation that it was discovered and instantiated using information collected from a file within the
META-INF/servicesdirectory. 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.
- Specified by:
setCreatedWithSPIin interfaceExpressionFactory
-
-