Package net.loomchild.segment.srx
Class SrxDocument
java.lang.Object
net.loomchild.segment.srx.SrxDocument
Represents SRX document. Responsible for storing and searching matching
language rules for given language code.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SrxDocumentCache
private boolean
static final boolean
Default cascade value.private List<LanguageMap>
-
Constructor Summary
ConstructorsConstructorDescriptionCreates empty document with default cascade.SrxDocument
(boolean cascade) Creates empty document. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLanguageMap
(String pattern, LanguageRule languageRule) Add language map to this document.getCache()
boolean
getLanguageRuleList
(String languageCode) If cascade is true then returns all language rules matching given language code.void
setCascade
(boolean cascade) Sets if document is cascading or not.
-
Field Details
-
DEFAULT_CASCADE
public static final boolean DEFAULT_CASCADEDefault cascade value.- See Also:
-
cascade
private boolean cascade -
languageMapList
-
cache
-
-
Constructor Details
-
SrxDocument
public SrxDocument(boolean cascade) Creates empty document.- Parameters:
cascade
- true if document is cascading
-
SrxDocument
public SrxDocument()Creates empty document with default cascade. SeeDEFAULT_CASCADE
.
-
-
Method Details
-
setCascade
public void setCascade(boolean cascade) Sets if document is cascading or not.- Parameters:
cascade
- true f document is cascading
-
getCascade
public boolean getCascade()- Returns:
- true if document is cascading
-
addLanguageMap
Add language map to this document.- Parameters:
pattern
- language code patternlanguageRule
-
-
getLanguageMapList
-
getLanguageRuleList
If cascade is true then returns all language rules matching given language code. If cascade is false returns first language rule matching given language code. If no matching language rules are found returns empty list.- Parameters:
languageCode
- language code, for example en_US- Returns:
- matching language rules
-
getCache
-