FileDocCategorySizeDatePackage
ProxyElementAdapter.javaAPI DocExample5722Mon Jul 23 13:26:44 BST 2007org.apache.struts2.views.xslt

ProxyElementAdapter

public class ProxyElementAdapter extends ProxyNodeAdapter implements Element
ProxyElementAdapter is a pass-through adapter for objects which already implement the Element interface. All methods are proxied to the underlying Node except getParent(), getNextSibling() and getPreviousSibling(), which are implemented by the abstract adapter node to work with the parent adapter. Note: this class wants to be (extend) both an AbstractElementAdapter and ProxyElementAdapter, but its proxy-ness is winning right now.

Fields Summary
private Log
log
Constructors Summary
public ProxyElementAdapter(AdapterFactory factory, AdapterNode parent, Element value)


           
        super(factory, parent, value);
    
Methods Summary
protected java.util.ListbuildChildAdapters()

        List<Node> adapters = new ArrayList<Node>();
        NodeList children = node().getChildNodes();
        for (int i = 0; i < children.getLength(); i++) {
            Node child = children.item(i);
            Node adapter = wrap(child);
            if (adapter != null) {
                log.debug("wrapped child node: " + child.getNodeName());
                adapters.add(adapter);
            }
        }
        return adapters;
    
protected org.w3c.dom.Elementelement()
Get the proxied Element

        return (Element) getPropertyValue();
    
public java.lang.StringgetAttribute(java.lang.String name)

        return element().getAttribute(name);
    
public java.lang.StringgetAttributeNS(java.lang.String namespaceURI, java.lang.String localName)

        return element().getAttributeNS(namespaceURI, localName);
    
public org.w3c.dom.AttrgetAttributeNode(java.lang.String name)

        log.debug("wrapping attribute");
        return (Attr) wrap(element().getAttributeNode(name));
    
public org.w3c.dom.AttrgetAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)

        return (Attr) wrap(element().getAttributeNodeNS(namespaceURI, localName));
    
public org.w3c.dom.NodeListgetElementsByTagName(java.lang.String name)

        return super.getElementsByTagName(name);
    
public org.w3c.dom.NodeListgetElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)

        return super.getElementsByTagNameNS(namespaceURI, localName);
    
public org.w3c.dom.TypeInfogetSchemaTypeInfo()

        throw operationNotSupported();
    
public java.lang.StringgetTagName()

        return element().getTagName();
    
public booleanhasAttribute(java.lang.String name)

        return element().hasAttribute(name);
    
public booleanhasAttributeNS(java.lang.String namespaceURI, java.lang.String localName)

        return element().hasAttributeNS(namespaceURI, localName);
    
public voidremoveAttribute(java.lang.String name)

        throw new UnsupportedOperationException();
    
public voidremoveAttributeNS(java.lang.String namespaceURI, java.lang.String localName)

        throw new UnsupportedOperationException();
    
public org.w3c.dom.AttrremoveAttributeNode(org.w3c.dom.Attr oldAttr)

        throw new UnsupportedOperationException();
    
public voidsetAttribute(java.lang.String name, java.lang.String value)

        throw new UnsupportedOperationException();
    
public voidsetAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value)

        throw new UnsupportedOperationException();
    
public org.w3c.dom.AttrsetAttributeNode(org.w3c.dom.Attr newAttr)

        throw new UnsupportedOperationException();
    
public org.w3c.dom.AttrsetAttributeNodeNS(org.w3c.dom.Attr newAttr)

        throw new UnsupportedOperationException();
    
public voidsetIdAttribute(java.lang.String string, boolean b)

        throw operationNotSupported();
    
public voidsetIdAttributeNS(java.lang.String string, java.lang.String string1, boolean b)

        throw operationNotSupported();
    
public voidsetIdAttributeNode(org.w3c.dom.Attr attr, boolean b)

        throw operationNotSupported();
    
public java.lang.StringtoString()

        return "ProxyElement for: " + element();