Class ConfigModelBuilder<MODEL extends ConfigModel>
- java.lang.Object
-
- com.yahoo.component.AbstractComponent
-
- com.yahoo.config.model.builder.xml.ConfigModelBuilder<MODEL>
-
- All Implemented Interfaces:
com.yahoo.component.Component
,com.yahoo.component.Deconstructable
,com.yahoo.config.model.api.ConfigModelPlugin
,Comparable<com.yahoo.component.Component>
- Direct Known Subclasses:
AdminModel.BuilderV2
,AdminModel.BuilderV4
,ContainerModelBuilder
,Content.Builder
,DomRoutingBuilder
,GenericServicesBuilder
,LegacyConfigModelBuilder
,ModelBuilderAddingAccessControlFilter
public abstract class ConfigModelBuilder<MODEL extends ConfigModel> extends com.yahoo.component.AbstractComponent implements com.yahoo.config.model.api.ConfigModelPlugin
Builds a config model using DOM parsers- Author:
- vegardh
-
-
Constructor Summary
Constructors Constructor Description ConfigModelBuilder(Class<MODEL> configModelClass)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description MODEL
build(ConfigModelInstanceFactory<MODEL> factory, Element spec, ConfigModelContext context)
Builds an instance of this component model.MODEL
build(DeployState deployState, VespaModel vespaModel, ConfigModelRepo configModelRepo, AbstractConfigProducer<?> parent, Element spec)
Builds an instance of this component model.abstract void
doBuild(MODEL model, Element spec, ConfigModelContext modelContext)
boolean
equals(Object other)
Class<MODEL>
getModelClass()
abstract List<ConfigModelId>
handlesElements()
Method that must return the XML elements this builder handles.
-
-
-
Method Detail
-
handlesElements
public abstract List<ConfigModelId> handlesElements()
Method that must return the XML elements this builder handles. Subclasses must implement this in order to get called when one of the elements have been encountered when parsing.- Returns:
- a list of elements that this builder handles
-
doBuild
public abstract void doBuild(MODEL model, Element spec, ConfigModelContext modelContext)
Convenience hook called frombuild(com.yahoo.config.model.deploy.DeployState, com.yahoo.vespa.model.VespaModel, com.yahoo.config.model.ConfigModelRepo, com.yahoo.config.model.producer.AbstractConfigProducer<?>, org.w3c.dom.Element)
. Implement this method to build a config model.- Parameters:
spec
- the XML element that this builder should handlemodelContext
- a model context that contains the application package and other data needed by the config model constructor
-
build
public final MODEL build(DeployState deployState, VespaModel vespaModel, ConfigModelRepo configModelRepo, AbstractConfigProducer<?> parent, Element spec)
Builds an instance of this component model. This calls instantiate(...), instance.setUp(...), doBuild(instance, ...).- Parameters:
deployState
- a global deployment state used for this model.parent
- the root config producer this should be added tospec
- the XML element this is constructed from
-
build
public MODEL build(ConfigModelInstanceFactory<MODEL> factory, Element spec, ConfigModelContext context)
Builds an instance of this component model. This calls instantiate(...), instance.setUp(...), doBuild(instance, ...).- Parameters:
factory
- A factory capable of creating models.spec
- the XML element this is constructed fromcontext
- A context object containing various data used by builders.
-
-