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 voidaddFactory(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.HyphenatorFactorynewFactory(String target)Gets a HyphenatorFactory that supports the specified locale.HyphenatorInterfacenewHyphenator(String target)Creates a new hyphenator.static HyphenatorFactoryMakernewInstance()Creates a new HyphenatorFactoryMaker and populates it using the SPI (java service provider interface).voidremoveFactory(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:HyphenatorFactoryMakerServiceGets a HyphenatorFactory that supports the specified locale.- Specified by:
newFactoryin 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:HyphenatorFactoryMakerServiceCreates 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:
newHyphenatorin 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:HyphenatorFactoryMakerServiceReturns a list of supported locales as defined by IETF RFC 3066.- Specified by:
listLocalesin interfaceHyphenatorFactoryMakerService- Returns:
- returns a list of locales
-
-