|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wookie.w3c.impl.AbstractLocalizedEntity
public abstract class AbstractLocalizedEntity
Abstract base class for entities containing i18n or l10n content, including utility methods for extracting and processing text that uses language tags and text direction (e.g. RTL)
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
AbstractLocalizedEntity()
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.wookie.w3c.xml.IElement |
|---|
toXml |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public AbstractLocalizedEntity()
| Method Detail |
|---|
public java.lang.String getLang()
ILocalized
getLang 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()
IDirectional
getDir in interface IDirectionalpublic void setDir(java.lang.String dir)
IDirectional
setDir in interface IDirectionaldir - the direction to setpublic boolean isValid()
isValid in interface IDirectionalpublic void fromXML(org.jdom.Element element)
IElement
fromXML in interface IElementelement - The Element to unmarshallpublic static java.lang.String getLocalizedTextContent(org.jdom.Element element)
element -
public static java.lang.String getTextDirection(org.jdom.Element element)
element - the element to parse
protected org.jdom.Element setLocalisationAttributes(org.jdom.Element element)
element - the element to add attributes to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||