FileDocCategorySizeDatePackage
WebPropertyNode.javaAPI DocGlassfish v2 API4636Fri May 04 22:31:48 BST 2007com.sun.enterprise.deployment.node.runtime.web

WebPropertyNode

public class WebPropertyNode extends WebRuntimeNode
node for web property tag
author
Jerome Dochez

Fields Summary
Constructors Summary
Methods Summary
protected booleansetAttributeValue(com.sun.enterprise.deployment.node.XMLElement elementName, com.sun.enterprise.deployment.node.XMLElement attributeName, 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

        RuntimeDescriptor descriptor = 
            (RuntimeDescriptor) getRuntimeDescriptor();
        if (descriptor==null) {
            throw new RuntimeException(
            "Trying to set values on a null descriptor");
        }
        if (attributeName.getQName().equals(RuntimeTagNames.NAME)) {
            descriptor.setAttributeValue(WebProperty.NAME, value);
            return true;
        } else if (attributeName.getQName().equals(RuntimeTagNames.VALUE)) {
            descriptor.setAttributeValue(WebProperty.VALUE, value);
            return true;
        }
        return false;
    
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.web.WebProperty property)
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 propertyElement = 
            (Element) super.writeDescriptor(parent, nodeName, property);

        // description?
        appendTextChild(propertyElement, RuntimeTagNames.DESCRIPTION, property.getDescription());

	setAttribute(propertyElement, RuntimeTagNames.NAME, (String) property.getAttributeValue(WebProperty.NAME));
	setAttribute(propertyElement, RuntimeTagNames.VALUE, (String) property.getAttributeValue(WebProperty.VALUE));
        return propertyElement;
    
public voidwriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.web.WebProperty[] properties)
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 array of descriptors to write

	if (properties==null) 
	    return;
	for (int i=0;i<properties.length;i++) {
	    writeDescriptor(parent, nodeName, properties[i]);
	}