FileDocCategorySizeDatePackage
PropertiesNode.javaAPI DocGlassfish v2 API4128Fri May 04 22:31:38 BST 2007com.sun.enterprise.deployment.node

PropertiesNode

public class PropertiesNode extends DeploymentDescriptorNode
This node is responsible for handling property (name, value) DTD elements to java.util.Properties mapping
author
Jerome Dochez

Fields Summary
private String
name
private Properties
descriptor
Constructors Summary
Methods Summary
public java.lang.ObjectgetDescriptor()

return
the descriptor instance to associate with this XMLNode

   
                      
       
        return descriptor;
    
public voidsetElementValue(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

        if (TagNames.NAME_VALUE_PAIR_NAME.equals(element.getQName())) {
            name = value;
        } else if (TagNames.NAME_VALUE_PAIR_VALUE.equals(element.getQName())) {
            descriptor.put(name, value);
        }
    
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, java.util.Properties descriptor)
write the descriptor class to a DOM tree and return it

param
parent node in the DOM tree
param
node name for the root element of this xml fragment
param
the descriptor to write
return
the DOM tree top node

        
        Node propertiesNode = super.appendChild(parent, nodeName);
        for (Enumeration keys = descriptor.propertyNames(); keys.hasMoreElements();) {  
            Node aProperty = this.appendChild(propertiesNode, RuntimeTagNames.PROPERTY);
            String key = (String) keys.nextElement();
            appendTextChild(aProperty, TagNames.NAME_VALUE_PAIR_NAME, key);
            appendTextChild(aProperty, TagNames.NAME_VALUE_PAIR_VALUE, 
                        descriptor.getProperty(key));        
        }
        return propertiesNode;