diff options
author | gjoranv <gv@verizonmedia.com> | 2022-06-08 19:17:47 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-06-08 19:17:47 +0200 |
commit | 33d629ae957d828fd9c14a7ea8ee633c38b10573 (patch) | |
tree | 524ff72b2a86a623bd4cb7a8b0fcebfa12bb47df /config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/InheritanceBuilder.java | |
parent | 26c06870f4d39e5a74bc32c17f2c88a14d23ca50 (diff) |
Clean up 'searchchain' and 'searchchains' syntax in services.xml
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/InheritanceBuilder.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/InheritanceBuilder.java | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/InheritanceBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/InheritanceBuilder.java index 1d32c644f97..fb11ba32a1e 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/InheritanceBuilder.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/InheritanceBuilder.java @@ -18,38 +18,22 @@ public class InheritanceBuilder { public InheritanceBuilder(Element spec) { inheritance = new ChainSpecification.Inheritance( - // XXX: for this to work, the tagname in the spec must match the tagname inside the 'inherits' elem, e.g. 'searchchain->inherits->searchchain' - read(spec, "inherits", spec.getTagName()), - read(spec, "excludes", "exclude")); + read(spec, "inherits"), + read(spec, "excludes")); } public ChainSpecification.Inheritance build() { return inheritance; } - private Set<ComponentSpecification> read(Element spec, String attributeName, String elementName) { + private Set<ComponentSpecification> read(Element spec, String attributeName) { Set<ComponentSpecification> componentSpecifications = new LinkedHashSet<>(); componentSpecifications.addAll(spaceSeparatedComponentSpecificationsFromAttribute(spec, attributeName)); - // TODO: the 'inherits' element is undocumented, and can be removed in an upcoming version of Vespa - componentSpecifications.addAll(idRefFromElements(XML.getChild(spec, "inherits"), elementName)); - - return componentSpecifications; } - private Collection<ComponentSpecification> idRefFromElements(Element spec, String elementName) { - Collection<ComponentSpecification> result = new ArrayList<>(); - if (spec == null) - return result; - - for (Element element : XML.getChildren(spec, elementName)) { - result.add(XmlHelper.getIdRef(element)); - } - return result; - } - private Collection<ComponentSpecification> spaceSeparatedComponentSpecificationsFromAttribute(Element spec, String attributeName) { return toComponentSpecifications(XmlHelper.spaceSeparatedSymbolsFromAttribute(spec, attributeName)); } |