IconNodepublic class IconNode extends LocalizedNode
Fields Summary |
---|
private String | smallIcon | private String | largeIcon |
Methods Summary |
---|
private void | addIconInfo(org.w3c.dom.Node node, java.lang.String lang, java.lang.String smallIconUri, java.lang.String largeIconUri)writes xml tag and fragment for a particular icon information
Element iconNode =appendChild(node, TagNames.ICON);
if (lang!=Locale.ENGLISH.getLanguage()) {
iconNode.setAttributeNS(TagNames.XML_NAMESPACE, TagNames.XML_NAMESPACE_PREFIX + TagNames.LANG, lang);
}
appendTextChild(iconNode, TagNames.SMALL_ICON, smallIconUri);
appendTextChild(iconNode, TagNames.LARGE_ICON, largeIconUri);
| public java.lang.Object | getDescriptor()
return null;
| public void | postParsing()notification of the end of XML parsing for this node
Object o = getParentNode().getDescriptor();
if (o!=null && o instanceof Descriptor) {
Descriptor descriptor = (Descriptor) o;
if (largeIcon!=null) {
descriptor.setLocalizedLargeIconUri(lang, largeIcon);
}
if (smallIcon!=null) {
descriptor.setLocalizedSmallIconUri(lang, smallIcon);
}
}
| public void | setElementValue(XMLElement element, java.lang.String value)receives notification of the value for a particular tag
if (element.getQName().equals(TagNames.SMALL_ICON)) {
smallIcon = value;
} else
if (element.getQName().equals(TagNames.LARGE_ICON)) {
largeIcon = value;
}
| public void | writeLocalizedInfo(org.w3c.dom.Node parentNode, com.sun.enterprise.deployment.Descriptor descriptor)writes all localized icon information
Map largeIcons = descriptor.getLocalizedLargeIconUris();
Map smallIcons = descriptor.getLocalizedSmallIconUris();
if (largeIcons==null && smallIcons==null) {
return;
}
if (smallIcons!=null) {
for (Iterator smallItr = smallIcons.keySet().iterator();smallItr.hasNext();) {
String lang = (String) smallItr.next();
String smallIconUri = (String) smallIcons.get(lang);
String largeIconUri = null;
if (largeIcons!=null) {
largeIconUri = (String) largeIcons.get(lang);
}
addIconInfo(parentNode, lang, smallIconUri, largeIconUri);
}
}
if (largeIcons!=null) {
for (Iterator largeItr = largeIcons.keySet().iterator();largeItr.hasNext();) {
String lang = (String) largeItr.next();
String largeIconUri = (String) largeIcons.get(lang);
if (smallIcons!=null && smallIcons.get(lang)!=null) {
// we already wrote this icon info in the previous loop
continue;
}
addIconInfo(parentNode, lang, null, largeIconUri);
}
}
|
|