001    /*
002    @license.text@
003     */
004    package biz.hammurapi.config;
005    
006    import org.w3c.dom.Element;
007    import org.w3c.dom.Node;
008    
009    /**
010     * Uses attribute "component-name" as component name
011     * @author Pavel Vlasov
012     * @revision $Revision$
013     */
014    public class NameAttributeDomConfigurableContainer extends DomConfigurableContainer {
015    
016            public NameAttributeDomConfigurableContainer() {
017                    super();
018            }
019    
020            protected String getComponentName(Node node) {
021                    if (node instanceof Element) {
022                            Element e=(Element) node;
023                            return e.hasAttribute("name") ? e.getAttribute("name") : null;
024                    }
025                    return null;
026            }
027    
028    }