blob: 299d8172f6cfaca775bfb28c777744316ec65e43 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.builder.xml.dom.chains.docproc;
import com.yahoo.collections.Pair;
import com.yahoo.component.chain.model.ChainSpecification;
import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.model.producer.AbstractConfigProducer;
import com.yahoo.vespa.model.builder.xml.dom.chains.ComponentsBuilder;
import com.yahoo.vespa.model.builder.xml.dom.chains.DomChainBuilderBase;
import com.yahoo.vespa.model.container.docproc.DocprocChain;
import com.yahoo.vespa.model.container.docproc.DocumentProcessor;
import org.w3c.dom.Element;
import java.util.Arrays;
import java.util.Map;
/**
* Builds a docproc chain from xml
*
* @author gjoranv
*/
public class DomDocprocChainBuilder extends DomChainBuilderBase<DocumentProcessor, DocprocChain> {
public DomDocprocChainBuilder(Map<String, ComponentsBuilder.ComponentType> outerComponentTypeByComponentName) {
super(Arrays.asList(ComponentsBuilder.ComponentType.documentprocessor), outerComponentTypeByComponentName);
}
@Override
protected DocprocChain buildChain(DeployState deployState, AbstractConfigProducer ancestor, Element producerSpec,
ChainSpecification specWithoutInnerComponents) {
Map<Pair<String, String>, String> fieldNameSchemaMap = DocumentProcessorModelBuilder.parseFieldNameSchemaMap(producerSpec);
return new DocprocChain(specWithoutInnerComponents, fieldNameSchemaMap);
}
}
|