FileDocCategorySizeDatePackage
LocaleCharsetMapNode.javaAPI DocGlassfish v2 API4155Fri May 04 22:31:48 BST 2007com.sun.enterprise.deployment.node.runtime.web

LocaleCharsetMapNode

public class LocaleCharsetMapNode extends WebRuntimeNode
node for web property tag
author
Jerome Dochez

Fields Summary
Constructors Summary
Methods Summary
public voidsetElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)
receives notification of the value for a particular tag

param
element the xml element
param
value it's associated value

	RuntimeDescriptor descriptor = getRuntimeDescriptor();
	if (descriptor==null) {
	    throw new RuntimeException("Trying to set name or value on null property");
	}
	if (element.getQName().equals(RuntimeTagNames.LOCALE)) {
	    descriptor.setAttributeValue(LocaleCharsetMap.LOCALE, value);
	} else 
	if (element.getQName().equals(RuntimeTagNames.AGENT)) {
	    descriptor.setAttributeValue(LocaleCharsetMap.AGENT, value);
	}
	if (element.getQName().equals(RuntimeTagNames.CHARSET)) {
	    descriptor.setAttributeValue(LocaleCharsetMap.CHARSET, value);
	} 
    
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.web.LocaleCharsetMap descriptor)
write the descriptor class to a DOM tree and return it

param
parent node for the DOM tree
param
node name for the descriptor
param
the descriptor to write
return
the DOM tree top node

	
	Element locale = (Element) super.writeDescriptor(parent, nodeName, descriptor);
	
	// description?
	appendTextChild(locale, RuntimeTagNames.DESCRIPTION, descriptor.getDescription());
	
	// locale, agent, charset attributes
	setAttribute(locale, RuntimeTagNames.LOCALE, (String) descriptor.getAttributeValue(LocaleCharsetMap.LOCALE));
	setAttribute(locale, RuntimeTagNames.AGENT, (String) descriptor.getAttributeValue(LocaleCharsetMap.AGENT));
	setAttribute(locale, RuntimeTagNames.CHARSET, (String) descriptor.getAttributeValue(LocaleCharsetMap.CHARSET));
	
	return locale;