FileDocCategorySizeDatePackage
PrincipalNameNode.javaAPI DocGlassfish v2 API4331Fri May 04 22:31:46 BST 2007com.sun.enterprise.deployment.node.runtime.common

PrincipalNameNode

public class PrincipalNameNode extends com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode
This node handles principal-name information
author
deployment dev team

Fields Summary
Constructors Summary
Methods Summary
protected booleansetAttributeValue(com.sun.enterprise.deployment.node.XMLElement element, com.sun.enterprise.deployment.node.XMLElement attribute, java.lang.String value)
parsed an attribute of an element

param
the element name
param
the attribute name
param
the attribute value
return
true if the attribute was processed


        PrincipalNameDescriptor principal = 
                            (PrincipalNameDescriptor) getDescriptor();
        if (attribute.getQName().equals(RuntimeTagNames.CLASS_NAME)) {
            principal.setClassName(value);
            return true;
        }
        return false;
    
public voidsetElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)
receives notiification of the value for a particular tag

param
element the xml element
param
value it's associated value

   
        PrincipalNameDescriptor principal = 
                (PrincipalNameDescriptor) getDescriptor();
        if (RuntimeTagNames.PRINCIPAL_NAME.equals(element.getQName())) {
            principal.setName(value);
        } else super.setElementValue(element, value);
    
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.common.PrincipalNameDescriptor descriptor)
write the descriptor class to a DOM tree and return it

param
parent node for the DOM tree
param
node name for
param
the descriptor to write
return
the DOM tree top node


        //principal-name
        Element principal = (Element) appendTextChild(
                parent, RuntimeTagNames.PRINCIPAL_NAME, descriptor.getName());

        // class-name
        setAttribute(principal, RuntimeTagNames.CLASS_NAME, descriptor.getClassName());

        return principal;