FileDocCategorySizeDatePackage
RoleMapNode.javaAPI DocGlassfish v2 API3666Fri May 04 22:31:48 BST 2007com.sun.enterprise.deployment.node.runtime.connector

RoleMapNode

public class RoleMapNode extends com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode
This node handles the role-map runtime deployment descriptors
author
Jerome Dochez
version

Fields Summary
Constructors Summary
public RoleMapNode()

        registerElementHandler(new XMLElement(RuntimeTagNames.MAP_ELEMENT), 
                               MapElementNode.class, "addMapElement"); 
    
Methods Summary
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.connector.RoleMap descriptor)
write the descriptor class to a DOM tree and return it

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

	Element roleMapNode = (Element) super.writeDescriptor(parent, nodeName, descriptor);
	appendTextChild(roleMapNode, RuntimeTagNames.DESCRIPTION, descriptor.getDescription());
	setAttribute(roleMapNode, RuntimeTagNames.MAP_ID, (String) descriptor.getValue(RoleMap.MAP_ID));

	// map-element*
	MapElement[] maps = descriptor.getMapElement();	
	if (maps.length>0) {
	    MapElementNode men = new MapElementNode();
	    for (int i=0;i<maps.length;i++) {
		men.writeDescriptor(roleMapNode, RuntimeTagNames.MAP_ELEMENT, maps[i]);
	    }
	}
	
	return roleMapNode;