Package org.daisy.dotify.api.hyphenator
Class HyphenatorFactoryMaker
- java.lang.Object
-
- org.daisy.dotify.api.hyphenator.HyphenatorFactoryMaker
-
- All Implemented Interfaces:
HyphenatorFactoryMakerService
public class HyphenatorFactoryMaker extends Object implements HyphenatorFactoryMakerService
Provides a hyphenator factory maker. This is the entry point for creating hyphenator instances.
-
-
Constructor Summary
Constructors Constructor Description HyphenatorFactoryMaker()
Creates a new formatter factory maker.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFactory(HyphenatorFactoryService factory)
Adds a factory (intended for use by the OSGi framework)Collection<String>
listLocales()
Returns a list of supported locales as defined by IETF RFC 3066.HyphenatorFactory
newFactory(String target)
Gets a HyphenatorFactory that supports the specified localeHyphenatorInterface
newHyphenator(String target)
Creates a new hyphenator.static HyphenatorFactoryMaker
newInstance()
Creates a new HyphenatorFactoryMaker and populates it using the SPI (java service provider interface).void
removeFactory(HyphenatorFactoryService factory)
Removes a factory (intended for use by the OSGi framework)
-
-
-
Method Detail
-
newInstance
public static HyphenatorFactoryMaker newInstance()
Creates a new HyphenatorFactoryMaker 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 HyphenatorFactoryMakerService interface.
- Returns:
- returns a new HyphenatorFactoryMakerService
-
addFactory
public void addFactory(HyphenatorFactoryService factory)
Adds a factory (intended for use by the OSGi framework)- Parameters:
factory
- the factory to add
-
removeFactory
public void removeFactory(HyphenatorFactoryService factory)
Removes a factory (intended for use by the OSGi framework)- Parameters:
factory
- the factory to remove
-
newFactory
public HyphenatorFactory newFactory(String target) throws HyphenatorConfigurationException
Description copied from interface:HyphenatorFactoryMakerService
Gets a HyphenatorFactory that supports the specified locale- Specified by:
newFactory
in interfaceHyphenatorFactoryMakerService
- Parameters:
target
- the target locale- Returns:
- returns a hyphenator factory for the specified locale
- Throws:
HyphenatorConfigurationException
- if the locale is not supported
-
newHyphenator
public HyphenatorInterface newHyphenator(String target) throws HyphenatorConfigurationException
Description copied from interface:HyphenatorFactoryMakerService
Creates a new hyphenator. This is a convenience method for getFactory(target).newHyphenator(target). Using this method excludes the possibility of setting features of the hyphenator factory.- Specified by:
newHyphenator
in interfaceHyphenatorFactoryMakerService
- Parameters:
target
- the target locale- Returns:
- returns a new hyphenator
- Throws:
HyphenatorConfigurationException
- if the locale is not supported
-
listLocales
public Collection<String> listLocales()
Description copied from interface:HyphenatorFactoryMakerService
Returns a list of supported locales as defined by IETF RFC 3066.- Specified by:
listLocales
in interfaceHyphenatorFactoryMakerService
- Returns:
- returns a list of locales
-
-