public abstract class AbstractLocalizedEntity extends java.lang.Object implements ILocalized, IDirectional, IElement
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
dir
Text direction conforming to http://www.w3.org/TR/2007/REC-its-20070403/
|
protected java.lang.String |
lang
a Language string conforming to BCP47
|
static java.lang.String |
LEFT_TO_RIGHT |
static java.lang.String |
LEFT_TO_RIGHT_OVERRIDE |
static java.lang.String |
RIGHT_TO_LEFT |
static java.lang.String |
RIGHT_TO_LEFT_OVERRIDE |
| Constructor and Description |
|---|
AbstractLocalizedEntity() |
| Modifier and Type | Method and Description |
|---|---|
void |
fromXML(org.jdom.Element element)
Unmarshall the given XML Element to this Object
|
java.lang.String |
getDir()
Get the direction of text, which can be one of "ltr", "rtl", "lro", or "rlo".
|
java.lang.String |
getLang()
Get the language tag for the element.
|
static java.lang.String |
getLocalizedTextContent(org.jdom.Element element)
Returns the text content of an element, recursively adding
any text nodes found in its child nodes AND any elements
that include localization information
|
static java.lang.String |
getTextDirection(org.jdom.Element element)
Returns the direction (rtl, ltr, lro, rlo) of the child text of an element
|
boolean |
isValid()
Checks whether the language tag for the entity is OK.
|
void |
setDir(java.lang.String dir)
Set the direction of text, which can be one of "ltr", "rtl", "lro", or "rlo".
|
void |
setLang(java.lang.String lang)
Set the language tag for the object
|
protected org.jdom.Element |
setLocalisationAttributes(org.jdom.Element element)
Set the dir and lang attributes of an element representing the entity - used when marshalling an entity to XML
|
protected java.lang.String lang
protected java.lang.String dir
public static final java.lang.String LEFT_TO_RIGHT
public static final java.lang.String RIGHT_TO_LEFT
public static final java.lang.String LEFT_TO_RIGHT_OVERRIDE
public static final java.lang.String RIGHT_TO_LEFT_OVERRIDE
public java.lang.String getLang()
ILocalizedgetLang in interface ILocalizedpublic void setLang(java.lang.String lang)
setLang in interface ILocalizedlang - the language tag to set; this should be a valid BCP-47 language tagpublic java.lang.String getDir()
IDirectionalgetDir in interface IDirectionalpublic void setDir(java.lang.String dir)
IDirectionalsetDir in interface IDirectionaldir - the direction to setpublic boolean isValid()
isValid in interface IDirectionalpublic void fromXML(org.jdom.Element element)
IElementpublic static java.lang.String getLocalizedTextContent(org.jdom.Element element)
element - public static java.lang.String getTextDirection(org.jdom.Element element)
element - the element to parseprotected org.jdom.Element setLocalisationAttributes(org.jdom.Element element)
element - the element to add attributes to2012 Apache Software Foundation.