1 23 24 package com.sun.enterprise.deployment.node.web; 25 26 import java.util.Map ; 27 import java.util.Vector ; 28 import java.util.Enumeration ; 29 import org.w3c.dom.Node ; 30 31 import com.sun.enterprise.deployment.ServletFilterDescriptor; 32 import com.sun.enterprise.deployment.EnvironmentProperty; 33 34 import com.sun.enterprise.deployment.node.DisplayableComponentNode; 35 import com.sun.enterprise.deployment.node.XMLElement; 36 import com.sun.enterprise.deployment.xml.WebTagNames; 37 38 44 public class FilterNode extends DisplayableComponentNode { 45 46 public FilterNode() { 48 super(); 49 registerElementHandler(new XMLElement(WebTagNames.INIT_PARAM), 50 InitParamNode.class, "addInitializationParameter"); 51 } 52 53 59 protected Map getDispatchTable() { 60 Map table = super.getDispatchTable(); 61 table.put(WebTagNames.NAME, "setDisplayName"); 62 table.put(WebTagNames.FILTER_NAME, "setName"); 63 table.put(WebTagNames.FILTER_CLASS, "setClassName"); 64 return table; 65 } 66 67 75 public Node writeDescriptor(Node parent, String nodeName, ServletFilterDescriptor descriptor) { 76 Node myNode = appendChild(parent, nodeName); 77 writeDisplayableComponentInfo(myNode, descriptor); 78 appendTextChild(myNode, WebTagNames.FILTER_NAME, descriptor.getName()); 79 appendTextChild(myNode, WebTagNames.FILTER_CLASS, descriptor.getClassName()); 80 Vector initParams = descriptor.getInitializationParameters(); 81 if (!initParams.isEmpty()) { 82 WebBundleNode.addInitParam(myNode, WebTagNames.INIT_PARAM, initParams.elements()); 83 } 84 85 return myNode; 86 } 87 } 88 | Popular Tags |