FileDocCategorySizeDatePackage
ExtensionElementDescriptor.javaAPI DocGlassfish v2 API4494Fri May 04 22:31:22 BST 2007com.sun.enterprise.deployment

ExtensionElementDescriptor

public class ExtensionElementDescriptor extends Descriptor implements Observer
This class contains the deployment extensions element for a particular xml node. It can contains sub elements (other ExtensionElementDescriptor instances) or final leafs like attribute or string elements.
author
Jerome Dochez

Fields Summary
private List
elementNames
private Map
elementValues
private DynamicAttributesDescriptor
attributes
Constructors Summary
Methods Summary
public voidaddElement(java.lang.String elementName, java.lang.Object value)

        if (elementNames==null) {
            elementNames = new LinkedList();
            elementValues = new HashMap();
        }
        elementNames.add(elementName);
        elementValues.put(elementName, value);
        changed();
    
public DynamicAttributesDescriptorgetAttributes()

return
a value holder for all attributes of this deployment extension elements

        if (attributes==null) {
            attributes = new DynamicAttributesDescriptor();
            attributes.addObserver(this);
        }
        return attributes;
    
public java.lang.ObjectgetElement(java.lang.String elementName)

        if (elementValues!=null) {
            return elementValues.get(elementName);
        }
        return null;
    
public java.util.IteratorgetElementNames()

return
the value holder for all sub elements of this deployment extension element

        if (elementNames!=null) {
            return elementNames.iterator();
        }
        return null;
    
public booleanhasAttributes()

return
true if the deployment extension contains attributes

        return attributes!=null;
    
public voidprint(java.lang.StringBuffer toStringBuffer)

return
a meaningful string describing myself

        toStringBuffer.append("ExtensionElementDescriptor");
        toStringBuffer.append("\n");
        super.print(toStringBuffer);
        for (Iterator itr = getElementNames();itr.hasNext();) {
            toStringBuffer.append("\n  Element=").append(getElement((String) itr.next()));
        }
        if (hasAttributes()) {
            toStringBuffer.append("\n  Attributes = ").append(getAttributes());
        }
    
public voidupdate(java.util.Observable o, java.lang.Object arg)
notification of changed from our attributes/elements storage

        setChanged();
        notifyObservers();