1 23 24 package com.sun.enterprise.deployment.node.web; 25 26 import java.util.Map ; 27 import java.util.Enumeration ; 28 import org.w3c.dom.Node ; 29 30 import com.sun.enterprise.deployment.JspGroupDescriptor; 31 import com.sun.enterprise.deployment.node.DeploymentDescriptorNode; 32 import com.sun.enterprise.deployment.node.LocalizedInfoNode; 33 import com.sun.enterprise.deployment.node.XMLElement; 34 import com.sun.enterprise.deployment.xml.TagNames; 35 import com.sun.enterprise.deployment.xml.WebTagNames; 36 37 41 public class JspGroupNode extends DeploymentDescriptorNode { 42 43 public JspGroupNode() { 44 super(); 45 registerElementHandler(new XMLElement(WebTagNames.NAME), LocalizedInfoNode.class); 46 } 47 48 56 protected Map getDispatchTable() { 57 Map table = super.getDispatchTable(); 58 table.put(WebTagNames.URL_PATTERN, "addUrlPattern"); 59 table.put(TagNames.NAME, "setDisplayName"); 60 table.put(WebTagNames.EL_IGNORED, "setElIgnored"); 61 table.put(WebTagNames.PAGE_ENCODING, "setPageEncoding"); 62 table.put(WebTagNames.SCRIPTING_INVALID, "setScriptingInvalid"); 63 table.put(WebTagNames.INCLUDE_PRELUDE, "addIncludePrelude"); 64 table.put(WebTagNames.INCLUDE_CODA, "addIncludeCoda"); 65 table.put(WebTagNames.IS_XML, "setIsXml"); 66 table.put(WebTagNames.DEFERRED_SYNTAX_ALLOWED_AS_LITERAL, 67 "setDeferredSyntaxAllowedAsLiteral"); 68 table.put(WebTagNames.TRIM_DIRECTIVE_WHITESPACES, 69 "setTrimDirectiveWhitespaces"); 70 return table; 71 } 72 73 81 public Node writeDescriptor(Node parent, String nodeName, JspGroupDescriptor descriptor) { 82 Node myNode = appendChild(parent, nodeName); 83 84 LocalizedInfoNode localizedNode = new LocalizedInfoNode(); 85 writeLocalizedDescriptions(myNode, descriptor); 86 localizedNode.writeLocalizedMap(myNode, TagNames.NAME, descriptor.getLocalizedDisplayNames()); 87 88 for (Enumeration urlPatterns = descriptor.getUrlPatterns(); urlPatterns.hasMoreElements();) { 90 appendTextChild(myNode, WebTagNames.URL_PATTERN, (String ) urlPatterns.nextElement()); 91 } 92 appendTextChild(myNode, WebTagNames.EL_IGNORED, descriptor.getElIgnored()); 93 appendTextChild(myNode, WebTagNames.PAGE_ENCODING, descriptor.getPageEncoding()); 94 appendTextChild(myNode, WebTagNames.SCRIPTING_INVALID, descriptor.getScriptingInvalid()); 95 appendTextChild(myNode, WebTagNames.IS_XML, descriptor.getIsXml()); 96 for (Enumeration includePreludes = descriptor.getIncludePreludes(); includePreludes.hasMoreElements();) { 98 appendTextChild(myNode, WebTagNames.INCLUDE_PRELUDE, (String ) includePreludes.nextElement()); 99 } 100 for (Enumeration includeCodas = descriptor.getIncludeCodas(); includeCodas.hasMoreElements();) { 102 appendTextChild(myNode, WebTagNames.INCLUDE_CODA, (String ) includeCodas.nextElement()); 103 } 104 appendTextChild(myNode, WebTagNames.DEFERRED_SYNTAX_ALLOWED_AS_LITERAL, descriptor.getDeferredSyntaxAllowedAsLiteral()); 105 appendTextChild(myNode, WebTagNames.TRIM_DIRECTIVE_WHITESPACES, descriptor.getTrimDirectiveWhitespaces()); 106 return myNode; 107 } 108 } 109 | Popular Tags |