private void readComponent(DeployState deployState, TreeConfigProducer<AnyConfigProducer> ancestor,
                               Element componentElement,
                               ComponentType<T> componentType,
                               Map<String, ComponentType<?>> outerComponentTypeByComponentName) {

        ComponentSpecification componentSpecification = XmlHelper.getIdRef(componentElement);

        if (outerComponentTypeByComponentName.containsKey(componentSpecification.getName())) {
            readComponentReference(componentElement, componentType, componentSpecification, outerComponentTypeByComponentName);
        } else {
            readComponentDefinition(deployState, ancestor, componentElement, componentType);
        }
    }
@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