public abstract class AbstractHyphenatorBuilder extends AbstractLoggableComponent implements HyphenatorBuilder
HyphenatorBuilder
interface. WeakReference
s to the Hyphenator
s that have already been build. If a
Hyphenator
is requested several times, it can typically be served from the cache.Modifier and Type | Field and Description |
---|---|
private ConcurrentHashMap<String,WeakReference<Hyphenator>> |
hyphenatorCache
Cache for
getHyphenator(Locale) . |
private NlsResourceLocator |
resourceLocator
The resource locator.
|
Constructor and Description |
---|
AbstractHyphenatorBuilder()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Hyphenator |
createHyphenator(String localeInfix)
This method creates a new
Hyphenator . |
protected void |
doInitialize()
This method performs the actual
initialization . |
Hyphenator |
getHyphenator()
|
Hyphenator |
getHyphenator(Locale locale)
This method gets the
Hyphenator for the given Locale . |
protected NlsResourceLocator |
getResourceLocator() |
void |
setResourceLocator(NlsResourceLocator resourceLocator) |
createLogger, getLogger
doInitialized, getInitializationState, initialize
private final ConcurrentHashMap<String,WeakReference<Hyphenator>> hyphenatorCache
getHyphenator(Locale)
.private NlsResourceLocator resourceLocator
protected void doInitialize()
AbstractComponent
initialization
. It is called when AbstractComponent.initialize()
is
invoked for the first time. super.
AbstractComponent.doInitialize()
.doInitialize
in class AbstractLoggableComponent
public Hyphenator getHyphenator()
HyphenatorBuilder
getHyphenator
in interface HyphenatorBuilder
Hyphenator
.public Hyphenator getHyphenator(Locale locale)
HyphenatorBuilder
Hyphenator
for the given Locale
. If no hyphenation-rules are
available for the given Locale
, a Hyphenator
for a more general Locale
is build.getHyphenator
in interface HyphenatorBuilder
locale
- is the Locale
used to determine the hyphenation-rules for the according country and
region.Hyphenator
.protected abstract Hyphenator createHyphenator(String localeInfix)
Hyphenator
.localeInfix
- is the locale-infix
of the requested
Hyphenator
.Hyphenator
or null
if no hyphenation configuration is available for the given
localeInfix
.getHyphenator(Locale)
protected NlsResourceLocator getResourceLocator()
@Inject public void setResourceLocator(NlsResourceLocator resourceLocator)
resourceLocator
- is the resourceLocator to setCopyright © 2001–2016 mmm-Team. All rights reserved.