private void ensureNotDefinition(String componentName, Element componentSpec) {
        if (componentSpec.getAttributes().getLength() > 1 || !XML.getChildren(componentSpec).isEmpty())
            throw new IllegalArgumentException("Expecting " + componentName +
                                               " to be a reference to a global component with the same name," +
                                               " so no additional attributes or nested elements are allowed");
    }
@param ancestor The parent config producer
@param componentTypes The allowed component types for 'elementContainingComponentElements' - MUST match &lt;T&gt;
@param elementsContainingComponentElems All elements containing elements with name matching ComponentType.name
@param outerComponentTypeByComponentName Use null if this is the outermost scope, i.e.
                                         every component is a definition, not a reference.
config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/ComponentsBuilder.java