|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.component.base.AbstractComponent
net.sf.mmm.util.component.base.AbstractLoggableComponent
net.sf.mmm.util.text.base.AbstractHyphenatorBuilder
public abstract class AbstractHyphenatorBuilder
This is the abstract base-implementation of the HyphenatorBuilder
interface.
It uses a cache with WeakReferences to the Hyphenators that
have already been build. If a Hyphenator is requested several times,
it can typically be served from the cache.
| Field Summary | |
|---|---|
private ConcurrentHashMap<String,WeakReference<Hyphenator>> |
hyphenatorCache
Cache for getHyphenator(Locale). |
private NlsResourceLocator |
resourceLocator
The resource locator. |
| Constructor Summary | |
|---|---|
AbstractHyphenatorBuilder()
The constructor. |
|
| Method Summary | |
|---|---|
protected abstract Hyphenator |
createHyphenator(String localeInfix)
This method creates a new Hyphenator. |
protected void |
doInitialize()
This method performs the actual initialization. |
Hyphenator |
getHyphenator()
This method gets the Hyphenator for
the default locale. |
Hyphenator |
getHyphenator(Locale locale)
This method gets the Hyphenator for the given Locale. |
protected NlsResourceLocator |
getResourceLocator()
|
void |
setResourceLocator(NlsResourceLocator resourceLocator)
|
| Methods inherited from class net.sf.mmm.util.component.base.AbstractLoggableComponent |
|---|
getLogger, setLogger |
| Methods inherited from class net.sf.mmm.util.component.base.AbstractComponent |
|---|
doInitialized, getInitializationState, initialize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final ConcurrentHashMap<String,WeakReference<Hyphenator>> hyphenatorCache
getHyphenator(Locale).
private NlsResourceLocator resourceLocator
| Constructor Detail |
|---|
public AbstractHyphenatorBuilder()
| Method Detail |
|---|
protected void doInitialize()
initialization. It is
called when AbstractComponent.initialize() is invoked for the first time.super.AbstractComponent.doInitialize().
doInitialize in class AbstractLoggableComponentpublic Hyphenator getHyphenator()
gets the Hyphenator for
the default locale.
getHyphenator in interface HyphenatorBuilderHyphenator.public Hyphenator getHyphenator(Locale locale)
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 HyphenatorBuilderlocale - 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 set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||