|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.errai.ui.shared.TemplateVisitor
public class TemplateVisitor
Visits the dom and finds elements that need translating.
Constructor Summary | |
---|---|
TemplateVisitor(String i18nPrefix)
|
Method Summary | |
---|---|
protected String |
getElementKey(Element element)
|
Map<String,String> |
getI18nValues()
|
protected String |
getOrGenerateTranslationKey(Element element)
Gets a translation key associated with the given element. |
boolean |
hasAttribute(Element element,
String attributeName)
Called to determine if an element has an attribute defined. |
boolean |
isTextOnly(Element element)
Returns true if the given element has some text and no element children. |
void |
setI18nPrefix(String i18nPrefix)
|
boolean |
visit(Element element)
Visits an element in the dom, returns true if the visitor should continue visiting down the dom. |
protected void |
visitAttribute(String i18nKeyPrefix,
Element element,
String attributeName)
Records the translation key/value for an attribute. |
protected void |
visitElement(String i18nKeyPrefix,
Element element)
Records the translation key/value for an element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TemplateVisitor(String i18nPrefix)
Method Detail |
---|
public boolean visit(Element element)
DomVisitor
visit
in interface DomVisitor
element
- the root element to visitprotected void visitElement(String i18nKeyPrefix, Element element)
i18nKeyPrefix
- element
- protected void visitAttribute(String i18nKeyPrefix, Element element, String attributeName)
i18nKeyPrefix
- element
- attributeName
- protected String getElementKey(Element element)
protected String getOrGenerateTranslationKey(Element element)
element
- public boolean isTextOnly(Element element)
element
- public boolean hasAttribute(Element element, String attributeName)
element
- attributeName
- public void setI18nPrefix(String i18nPrefix)
public Map<String,String> getI18nValues()
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |