FileDocCategorySizeDatePackage
Resources.javaAPI DocGlassfish v2 API3482Fri May 04 22:35:10 BST 2007com.sun.enterprise.tools.upgrade.transform.elements

Resources

public class Resources extends BaseElement
author
prakash

Fields Summary
Constructors Summary
public Resources()
Creates a new instance of Element

    
Methods Summary
public voidtransform(org.w3c.dom.Element element, org.w3c.dom.Element parentSource, org.w3c.dom.Element parentResult)
element - resources parentSource - server element for source for as7.x. domain for 8.x parentResult - domain element of result for 8.1PE, Config element for SE/EE

    
        // There should only be one or zero resources element
        if(!parentResult.getTagName().equals("domain")){
            // This fix is required, otherwise it would create resources element under cofig element.
            parentResult = parentResult.getOwnerDocument().getDocumentElement();
        }
        NodeList resources = parentResult.getElementsByTagName("resources");
        Element resource = null;
        if(resources.getLength() == 0){
            resource = parentResult.getOwnerDocument().createElement("resources");
            this.appendElementToParent(parentResult,resource);  
        }else {
            resource = (Element)resources.item(0);           
        } 
        super.transform(element,  parentSource, resource);