FileDocCategorySizeDatePackage
WSDDElement.javaAPI DocApache Axis 1.43278Sat Apr 22 18:57:26 BST 2006org.apache.axis.deployment.wsdd

WSDDElement

public abstract class WSDDElement extends WSDDConstants implements Serializable
abstract class extended by all WSDD Element classes

Fields Summary
private String
name
Constructors Summary
public WSDDElement()
Default constructor

    
public WSDDElement(Element e)
Create an element in WSDD that wraps an extant DOM element

param
e (Element) XXX
throws
WSDDException XXX

        validateCandidateElement(e);
    
Methods Summary
public org.w3c.dom.ElementgetChildElement(org.w3c.dom.Element e, java.lang.String name)

        Element [] elements = getChildElements(e, name);
        if (elements.length == 0)
            return null;
        return elements[0];
    
public org.w3c.dom.Element[]getChildElements(org.w3c.dom.Element e, java.lang.String name)

        NodeList nl = e.getChildNodes();
        Vector els = new Vector();
        
        for (int i = 0; i < nl.getLength(); i++) {
            Node thisNode = nl.item(i);
            if (!(thisNode instanceof Element))
                continue;
            
            Element el = (Element)thisNode;
            if (el.getLocalName().equals(name)) {
                els.add(el);
            }
        }
        
        Element [] elements = new Element [els.size()];
        els.toArray(elements);

        return elements;
    
protected abstract javax.xml.namespace.QNamegetElementName()
Return the element name of a particular subclass.

private voidvalidateCandidateElement(org.w3c.dom.Element e)
Make sure everything looks kosher with the element name.

        QName name = getElementName();
        
        if ((null == e) || (null == e.getNamespaceURI())
                || (null == e.getLocalName())
                ||!e.getNamespaceURI().equals(name.getNamespaceURI())
                ||!e.getLocalName().equals(name.getLocalPart())) {
            throw new WSDDException(Messages.getMessage("invalidWSDD00",
                                    e.getLocalName(),
                                    name.getLocalPart()));
        }
    
public abstract voidwriteToContext(org.apache.axis.encoding.SerializationContext context)
Write this element out to a SerializationContext