Package org.daisy.dotify.api.writer
Class PagedMediaWriterFactoryMaker
- java.lang.Object
-
- org.daisy.dotify.api.writer.PagedMediaWriterFactoryMaker
-
- All Implemented Interfaces:
PagedMediaWriterFactoryMakerService
public class PagedMediaWriterFactoryMaker extends Object implements PagedMediaWriterFactoryMakerService
Provides a PagedMediaWriter factory maker. This is the entry point for creating PagedMediaWriter instances.
-
-
Constructor Summary
Constructors Constructor Description PagedMediaWriterFactoryMaker()
Creates a new paged media writer factory maker.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFactory(PagedMediaWriterFactoryService factory)
Adds a factory (intended for use by the OSGi framework)PagedMediaWriterFactory
getFactory(String target)
Gets a PagedMediaWriterFactory that supports the specified media typeCollection<String>
listMediaTypes()
Returns a list of supported Internet media types.static PagedMediaWriterFactoryMaker
newInstance()
Creates a new PagedMediaWriterFactoryMaker and populates it using the SPI (java service provider interface).PagedMediaWriter
newPagedMediaWriter(String target)
Creates a new PagedMediaWriter.void
removeFactory(PagedMediaWriterFactoryService factory)
Removes a factory (intended for use by the OSGi framework)
-
-
-
Method Detail
-
newInstance
public static PagedMediaWriterFactoryMaker newInstance()
Creates a new PagedMediaWriterFactoryMaker and populates it using the SPI (java service provider interface).
In an OSGi context, an instance should be retrieved using the service registry. It will be registered under the PagedMediaWriterFactoryMakerService interface.
- Returns:
- returns a new PagedMediaWriterFactoryMaker
-
addFactory
public void addFactory(PagedMediaWriterFactoryService factory)
Adds a factory (intended for use by the OSGi framework)- Parameters:
factory
- the factory to add
-
removeFactory
public void removeFactory(PagedMediaWriterFactoryService factory)
Removes a factory (intended for use by the OSGi framework)- Parameters:
factory
- the factory to remove
-
getFactory
public PagedMediaWriterFactory getFactory(String target) throws PagedMediaWriterConfigurationException
Description copied from interface:PagedMediaWriterFactoryMakerService
Gets a PagedMediaWriterFactory that supports the specified media type- Specified by:
getFactory
in interfacePagedMediaWriterFactoryMakerService
- Parameters:
target
- the target Internet media type- Returns:
- returns a integer2text factory for the specified media type
- Throws:
PagedMediaWriterConfigurationException
- if the media type is not supported
-
newPagedMediaWriter
public PagedMediaWriter newPagedMediaWriter(String target) throws PagedMediaWriterConfigurationException
Description copied from interface:PagedMediaWriterFactoryMakerService
Creates a new PagedMediaWriter. This is a convenience method for getFactory(target).newPagedMediaWriter(target). Using this method excludes the possibility of setting features of the PagedMediaWriter factory.- Specified by:
newPagedMediaWriter
in interfacePagedMediaWriterFactoryMakerService
- Parameters:
target
- the target Internet media type- Returns:
- returns a new PagedMediaWriter
- Throws:
PagedMediaWriterConfigurationException
- if the media type is not supported
-
listMediaTypes
public Collection<String> listMediaTypes()
Description copied from interface:PagedMediaWriterFactoryMakerService
Returns a list of supported Internet media types.- Specified by:
listMediaTypes
in interfacePagedMediaWriterFactoryMakerService
- Returns:
- returns a list of media types
-
-