public class HyphenatorBuilderImpl extends AbstractHyphenatorBuilder
HyphenatorBuilder
.Modifier and Type | Field and Description |
---|---|
static String |
HYPHENATION_XML_CONFIG_PREFIX |
static String |
HYPHENATION_XML_CONFIG_SUFFIX |
private static HyphenatorBuilder |
instance |
private StaxUtil |
staxUtil |
private StringHasher |
stringHasher |
private StringUtil |
stringUtil |
private static QName |
XML_ATR_HYPHEN
The XML attribute for the hyphen character (
hyphen ). |
private static QName |
XML_TAG_EXCEPTION
The XML tag for an exception (
e ). |
private static QName |
XML_TAG_EXCEPTION_LIST
The XML tag for the list of exceptions to hyphenation rules (
exceptions ). |
private static QName |
XML_TAG_HYPHENATION
The XML root tag (
hyphenation ). |
private static QName |
XML_TAG_PATTERN
The XML tag for a pattern (
p ). |
private static QName |
XML_TAG_PATTERN_LIST
The XML tag for the list of patterns (
patterns ). |
Constructor and Description |
---|
HyphenatorBuilderImpl()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Hyphenator |
createHyphenator(Locale locale,
DataResource resource)
This method creates a new
Hyphenator instance from the XML-configuration identified by the given
DataResource . |
protected Hyphenator |
createHyphenator(String localeInfix)
This method creates a new
Hyphenator . |
protected void |
doInitialize()
This method performs the actual
initialization . |
static HyphenatorBuilder |
getInstance()
This method gets the singleton instance of this
HyphenatorBuilderImpl . |
protected StaxUtil |
getStaxUtil() |
protected StringHasher |
getStringHasher() |
protected StringUtil |
getStringUtil() |
private List<String> |
parseStringList(XMLEventReader reader,
QName elementName)
This method parses a list of strings enclosed by elements with the given
elementName until the
current element ends. |
void |
setStaxUtil(StaxUtil staxUtil) |
void |
setStringHasher(StringHasher stringHasher) |
void |
setStringUtil(StringUtil stringUtil) |
getHyphenator, getHyphenator, getResourceLocator, setResourceLocator
createLogger, getLogger
doInitialized, getInitializationState, initialize
public static final String HYPHENATION_XML_CONFIG_PREFIX
createHyphenator(String)
,
Constant Field Valuespublic static final String HYPHENATION_XML_CONFIG_SUFFIX
createHyphenator(String)
,
Constant Field Valuesprivate static final QName XML_TAG_HYPHENATION
hyphenation
).private static final QName XML_ATR_HYPHEN
hyphen
).private static final QName XML_TAG_EXCEPTION_LIST
exceptions
).private static final QName XML_TAG_PATTERN_LIST
patterns
).private static final QName XML_TAG_EXCEPTION
e
).private static final QName XML_TAG_PATTERN
p
).private static HyphenatorBuilder instance
private StaxUtil staxUtil
private StringUtil stringUtil
private StringHasher stringHasher
protected void doInitialize()
AbstractComponent
initialization
. It is called when AbstractComponent.initialize()
is
invoked for the first time. super.
AbstractComponent.doInitialize()
.doInitialize
in class AbstractHyphenatorBuilder
public static HyphenatorBuilder getInstance()
HyphenatorBuilderImpl
. Cdi.GET_INSTANCE
before using.protected Hyphenator createHyphenator(String localeInfix)
AbstractHyphenatorBuilder
Hyphenator
.createHyphenator
in class AbstractHyphenatorBuilder
localeInfix
- is the locale-infix
of the requested
Hyphenator
.Hyphenator
or null
if no hyphenation configuration is available for the given
localeInfix
.AbstractHyphenatorBuilder.getHyphenator(Locale)
protected Hyphenator createHyphenator(Locale locale, DataResource resource)
Hyphenator
instance from the XML-configuration identified by the given
DataResource
.locale
- is the locale
.resource
- is the DataResource
with the XML-configuration.Hyphenator
instance.private List<String> parseStringList(XMLEventReader reader, QName elementName) throws XMLStreamException
elementName
until the
current element ends. E.g. if you have this XML:
<foo> <bar>text1</bar> <bar>text2</bar> <bar>text3</bar> </foo>And your XML-reader is pointing after the opening <foo> and you call this method, you will get a list with "text1", "text2", and "text3".
reader
- is the XMLEventReader pointing after the StartElement
of the surrounding element.elementName
- is the name of the element containing a single string.XMLStreamException
- if caused by the reader.protected StaxUtil getStaxUtil()
@Inject public void setStaxUtil(StaxUtil staxUtil)
staxUtil
- is the staxUtil to setprotected StringUtil getStringUtil()
@Inject public void setStringUtil(StringUtil stringUtil)
stringUtil
- is the stringUtil to setprotected StringHasher getStringHasher()
public void setStringHasher(StringHasher stringHasher)
stringHasher
- is the stringHasher to setCopyright © 2001–2016 mmm-Team. All rights reserved.