1 23 24 package com.sun.enterprise.deployment.node.runtime.common; 25 26 import com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode; 27 import com.sun.enterprise.deployment.node.XMLElement; 28 import com.sun.enterprise.deployment.runtime.common.PrincipalNameDescriptor; 29 import com.sun.enterprise.deployment.xml.RuntimeTagNames; 30 import org.w3c.dom.Element ; 31 import org.w3c.dom.Node ; 32 33 38 public class PrincipalNameNode extends RuntimeDescriptorNode { 39 40 46 public void setElementValue(XMLElement element, String value) { 47 PrincipalNameDescriptor principal = 48 (PrincipalNameDescriptor) getDescriptor(); 49 if (RuntimeTagNames.PRINCIPAL_NAME.equals(element.getQName())) { 50 principal.setName(value); 51 } else super.setElementValue(element, value); 52 } 53 54 62 protected boolean setAttributeValue( 63 XMLElement element, XMLElement attribute, String value) { 64 65 PrincipalNameDescriptor principal = 66 (PrincipalNameDescriptor) getDescriptor(); 67 if (attribute.getQName().equals(RuntimeTagNames.CLASS_NAME)) { 68 principal.setClassName(value); 69 return true; 70 } 71 return false; 72 } 73 74 82 public Node writeDescriptor( 83 Node parent, String nodeName, PrincipalNameDescriptor descriptor) { 84 85 Element principal = (Element) appendTextChild( 87 parent, RuntimeTagNames.PRINCIPAL_NAME, descriptor.getName()); 88 89 setAttribute(principal, RuntimeTagNames.CLASS_NAME, descriptor.getClassName()); 91 92 return principal; 93 } 94 } 95 | Popular Tags |