1 23 24 package com.sun.enterprise.deployment.node; 25 26 import java.util.Map ; 27 import java.util.Iterator ; 28 import org.w3c.dom.Node ; 29 import com.sun.enterprise.deployment.NameValuePairDescriptor; 30 import com.sun.enterprise.deployment.xml.TagNames; 31 32 37 public class NameValuePairNode extends DeploymentDescriptorNode { 38 39 45 protected Map getDispatchTable() { 46 Map table = super.getDispatchTable(); 47 table.put(TagNames.NAME_VALUE_PAIR_NAME, "setName"); 48 table.put(TagNames.NAME_VALUE_PAIR_VALUE, "setValue"); 49 return table; 50 } 51 52 60 public Node writeDescriptor(Node parent, String nodeName, NameValuePairDescriptor descriptor) { 61 Node envEntryNode = super.writeDescriptor(parent, nodeName, descriptor); 62 appendTextChild(envEntryNode, TagNames.NAME_VALUE_PAIR_NAME, 63 descriptor.getName()); 64 appendTextChild(envEntryNode, TagNames.NAME_VALUE_PAIR_VALUE, 65 descriptor.getValue()); 66 return envEntryNode; 67 } 68 69 77 public void writeDescriptor(Node parent, String nodeName, Iterator props) { 78 if (props==null) 79 return; 80 81 while(props.hasNext()) { 82 NameValuePairDescriptor aProp = (NameValuePairDescriptor) props.next(); 83 writeDescriptor(parent, nodeName, aProp); 84 } 85 } 86 } 87 | Popular Tags |