LocalizedNodepublic class LocalizedNode extends DeploymentDescriptorNode This class is responsible for handling the xml lang attribute of
an xml element |
Fields Summary |
---|
protected String | lang | protected String | localizedValue |
Methods Summary |
---|
public java.lang.Object | getDescriptor()
return getParentNode().getDescriptor();
| public void | setElementValue(XMLElement element, java.lang.String value)receives notification of the value for a particular tag
if (element.equals(getXMLRootTag())) {
localizedValue=value;
} else
super.setElementValue(element, value);
| public void | startElement(XMLElement element, org.xml.sax.Attributes attributes)notification of element start with attributes.
if (attributes.getLength()>0) {
for (int i=0;i<attributes.getLength();i++) {
if (attributes.getLocalName(i).equals(TagNames.LANG)) {
lang = attributes.getValue(i);
}
}
}
| public void | writeLocalizedMap(org.w3c.dom.Node parentNode, java.lang.String tagName, java.util.Map localizedMap)writes all the localized map element usign the tagname with
the lang attribute to a DOM node
if (localizedMap!=null) {
for (Iterator itr = localizedMap.keySet().iterator();itr.hasNext();) {
String lang = (String) itr.next();
Element aLocalizedNode = (Element) appendTextChild(parentNode, tagName, (String) localizedMap.get(lang));
if (aLocalizedNode!=null && lang!=Locale.getDefault().getLanguage()) {
aLocalizedNode.setAttributeNS(TagNames.XML_NAMESPACE, TagNames.XML_NAMESPACE_PREFIX + TagNames.LANG, lang);
}
}
}
|
|