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

IdempotentUrlPatternNode

public class IdempotentUrlPatternNode extends WebRuntimeNode
node to handle idempotent-url-pattern node

Fields Summary
com.sun.enterprise.deployment.runtime.web.IdempotentUrlPattern
descriptor
Constructors Summary
Methods Summary
public java.lang.ObjectgetDescriptor()

return
the descriptor instance to associate with this XMLNode


                 
       
        if (descriptor == null) {
            descriptor = new IdempotentUrlPattern();
        }
        return descriptor;
    
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

        if (attributeName.getQName().equals(RuntimeTagNames.URL_PATTERN)) {
            descriptor.setAttributeValue(IdempotentUrlPattern.URL_PATTERN, 
                value);
            return true;
        } else if (attributeName.getQName().equals(
            RuntimeTagNames.NUM_OF_RETRIES)) {
            descriptor.setAttributeValue(IdempotentUrlPattern.NUM_OF_RETRIES,
                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.IdempotentUrlPattern pattern)
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 patternNode = 
            (Element)super.writeDescriptor(parent, nodeName, pattern);
        
        // url-pattern
        if (pattern.getAttributeValue(pattern.URL_PATTERN) != null) {
            setAttribute(patternNode, RuntimeTagNames.URL_PATTERN, pattern.getAttributeValue(pattern.URL_PATTERN));
        }   

        // num-of-retries
        if (pattern.getAttributeValue(pattern.NUM_OF_RETRIES) != null) {
            setAttribute(patternNode, RuntimeTagNames.NUM_OF_RETRIES, pattern.getAttributeValue(pattern.NUM_OF_RETRIES));
        }

        return patternNode;