Class LayoutEngineFactoryImpl
- java.lang.Object
-
- org.daisy.dotify.formatter.impl.engine.LayoutEngineFactoryImpl
-
- All Implemented Interfaces:
FormatterEngineFactoryService
public class LayoutEngineFactoryImpl extends Object implements FormatterEngineFactoryService
Provides a
layout engine factory
.Produces instances of
LayoutEngineImpl
.
-
-
Constructor Summary
Constructors Constructor Description LayoutEngineFactoryImpl()
Creates a new layout engine factory instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.daisy.dotify.formatter.impl.engine.LayoutEngineImpl
newFormatterEngine(String locale, String mode, PagedMediaWriter writer)
Returns a new FormatterEngine configured for the specified locale, mode and output writer.FormatterEngine
newFormatterEngine(FormatterConfiguration config, PagedMediaWriter writer)
Returns a new FormatterEngine configured with the specified configuration and output writer.void
setCreatedWithSPI()
Informs the implementation that it was discovered and instantiated using information collected from a file within theMETA-INF/services
directory.void
setExpressionFactory(ExpressionFactory service)
Sets a factory dependency.void
setFormatterFactory(FormatterFactory service)
Sets a factory dependency.void
setObflParserFactory(ObflParserFactoryService service)
Sets a factory dependency.void
setTextBorderFactoryMaker(TextBorderFactoryMakerService service)
Sets a factory dependency.void
unsetExpressionFactory(ExpressionFactory service)
Removes a factory dependency.void
unsetFormatterFactory(FormatterFactory service)
Removes a factory dependency.void
unsetObflParserFactory(ObflParserFactoryService service)
Removes a factory dependency.void
unsetTextBorderFactoryMaker(TextBorderFactoryMakerService service)
Removes a factory dependency.
-
-
-
Method Detail
-
newFormatterEngine
public org.daisy.dotify.formatter.impl.engine.LayoutEngineImpl newFormatterEngine(String locale, String mode, PagedMediaWriter writer)
Description copied from interface:FormatterEngineFactoryService
Returns a new FormatterEngine configured for the specified locale, mode and output writer.- Specified by:
newFormatterEngine
in interfaceFormatterEngineFactoryService
- Parameters:
locale
- the localemode
- the braille modewriter
- the output writer- Returns:
- returns a new FormatterEngine
-
newFormatterEngine
public FormatterEngine newFormatterEngine(FormatterConfiguration config, PagedMediaWriter writer)
Description copied from interface:FormatterEngineFactoryService
Returns a new FormatterEngine configured with the specified configuration and output writer.- Specified by:
newFormatterEngine
in interfaceFormatterEngineFactoryService
- Parameters:
config
- the configurationwriter
- the output writer- Returns:
- returns a new instance
-
setObflParserFactory
public void setObflParserFactory(ObflParserFactoryService service)
Sets a factory dependency.- Parameters:
service
- the dependency
-
unsetObflParserFactory
public void unsetObflParserFactory(ObflParserFactoryService service)
Removes a factory dependency.- Parameters:
service
- the dependency to remove
-
setFormatterFactory
public void setFormatterFactory(FormatterFactory service)
Sets a factory dependency.- Parameters:
service
- the dependency
-
unsetFormatterFactory
public void unsetFormatterFactory(FormatterFactory service)
Removes a factory dependency.- Parameters:
service
- the dependency to remove
-
setTextBorderFactoryMaker
public void setTextBorderFactoryMaker(TextBorderFactoryMakerService service)
Sets a factory dependency.- Parameters:
service
- the dependency
-
unsetTextBorderFactoryMaker
public void unsetTextBorderFactoryMaker(TextBorderFactoryMakerService service)
Removes a factory dependency.- Parameters:
service
- the dependency to remove
-
setExpressionFactory
public void setExpressionFactory(ExpressionFactory service)
Sets a factory dependency.- Parameters:
service
- the dependency
-
unsetExpressionFactory
public void unsetExpressionFactory(ExpressionFactory service)
Removes a factory dependency.- Parameters:
service
- the dependency to remove
-
setCreatedWithSPI
public void setCreatedWithSPI()
Description copied from interface:FormatterEngineFactoryService
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.
- Specified by:
setCreatedWithSPI
in interfaceFormatterEngineFactoryService
-
-