Class SectionDefinitionBuilder<R,T extends SectionDefinitionBuilder<R,T>>
java.lang.Object
com._1c.g5.aef2.standard.definitions.builders.AbstractBuilder<R,T>
com._1c.g5.aef2.standard.definitions.builders.AbstractContainerDefinitionBuilder<SectionDefinition,T>
com._1c.g5.aef2.standard.definitions.builders.SectionDefinitionBuilder<R,T>
- Type Parameters:
R- the returning type atendSection().T- the type of the builder.
- Direct Known Subclasses:
DtSectionDefinitionBuilder
public class SectionDefinitionBuilder<R,T extends SectionDefinitionBuilder<R,T>>
extends AbstractContainerDefinitionBuilder<SectionDefinition,T>
Definition builder to build the section definition.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContainer class for constructing elements inelement(String, EStructuralFeature...). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSectionDefinitionBuilder(Supplier<SectionDefinition> provider, Consumer<SectionDefinition> endAction, R endSectionResult) Instantiates a new builder. -
Method Summary
Modifier and TypeMethodDescriptionstatic <R> SectionDefinitionBuilder<R,?> builder(Supplier<SectionDefinition> provider, Consumer<SectionDefinition> endAction, R endSectionResult) Creates a new builder.component(Class<? extends IComponent> componentClass, IParameterization parameterization) A convenience wrapper forSetupDefinitionBuilder.component(Class, IParameterization).componentFactory(IComponentFactory componentFactory) A convenience wrapper forSetupDefinitionBuilder.componentFactory(IComponentFactory).element(String label, IDefinitionIdentifier definitionIdentifier) Creates a newILabeledDefinitionand adds to the section.Creates a newILabeledDefinitionand adds to the section.Creates a newOperationFieldDefinitionand adds to the section.Creates a newFieldDefinitionand adds it to the section.Ends section and performs the action that is given while instantiating the builder.protected IDefinitionfieldDefinition(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, org.eclipse.emf.databinding.FeaturePath... featurePaths) Cretets field definition for the provided parameters.getComponentParameterizationInfo(org.eclipse.emf.ecore.EOperation operation) Returns theSectionDefinitionBuilder.ComponentParameterizationInfofor the given operation.getComponentParameterizationInfo(org.eclipse.emf.ecore.EStructuralFeature... features) Returns theSectionDefinitionBuilder.ComponentParameterizationInfofor the given feature path.protected static final org.eclipse.emf.ecore.EStructuralFeaturegetLastFeature(org.eclipse.emf.ecore.EStructuralFeature... features) Returns the last feature of the given feature array.protected static SectionDefinitionBuilder.ComponentParameterizationInfoinfo(Class<? extends IComponent<?>> componentClass, IParameterization parameterization) BuildsSectionDefinitionBuilder.ComponentParameterizationInfowith the given parameters and returns it.protected IDefinitionlabeledDefinition(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, IDefinitionIdentifier definitionIdentifier) Cretets labeled definition for the provided parameters.multiFeatureElement(String label, org.eclipse.emf.ecore.EStructuralFeature... features) Creates a newFieldDefinitionwith specified single-feature paths and adds it to the section.navigateTo(IDefinitionIdentifier definitionIdentifier) Finds the definition with the given identifier.navigateTo(String stringIdentifier) Finds the definition with the given string identifier.navigateTo(org.eclipse.emf.ecore.EOperation operation) Finds the definition with the given operation and positions to it.navigateTo(org.eclipse.emf.ecore.EStructuralFeature... features) Finds the definition with the given feature path and positions to it.protected IDefinitionoperationFieldDefinition(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, org.eclipse.emf.ecore.EOperation operation) Cretets operation field definition for the provided parameters.CreatesSeparatorDefinitionand adds it to section definition.protected voidsetElementLogger(Consumer<IDefinition> logger) Sets a logger that will be called from eachelement(String, EStructuralFeature...)call.SetupDefinitionBuilder<AbstractDefinition,? extends SetupDefinitionBuilder<AbstractDefinition, ?, T>, T> setup()Returns the instance of the setup builder that allows to setup the currently positioned definition.protected IDefinitionstringIdDefiniton(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, String stringId) Cretets string identified field definition for the provided parameters.Methods inherited from class com._1c.g5.aef2.standard.definitions.builders.AbstractContainerDefinitionBuilder
getAndIncrementPosition, getPosition, insert, setPositionMethods inherited from class com._1c.g5.aef2.standard.definitions.builders.AbstractBuilder
apply, build, self
-
Constructor Details
-
SectionDefinitionBuilder
protected SectionDefinitionBuilder(Supplier<SectionDefinition> provider, Consumer<SectionDefinition> endAction, R endSectionResult) Instantiates a new builder.- Parameters:
provider- the provider of section definition, cannot benull.endAction- the action performed when the builder ends section building.endSectionResult- the object that is returned byendSection().
-
-
Method Details
-
builder
public static <R> SectionDefinitionBuilder<R,?> builder(Supplier<SectionDefinition> provider, Consumer<SectionDefinition> endAction, R endSectionResult) Creates a new builder.- Parameters:
provider- the provider of section definition, cannot benull.endAction- the action performed the builder ends section building.endSectionResult- the object that is returned byendSection().- Returns:
- a newly created builder instance, never
null.
-
element
Creates a newFieldDefinitionand adds it to the section.- Parameters:
label- the label of the field ornullto disable label creationfeatures- the features that represents the feature path, may be empty- Returns:
- the builder instance, never
null.
-
multiFeatureElement
Creates a newFieldDefinitionwith specified single-feature paths and adds it to the section.- Parameters:
label- the label of the field ornullto disable label creationfeatures- the features each of which defines its own single-feature path- Returns:
- the builder instance, never
null.
-
element
Creates a newOperationFieldDefinitionand adds to the section.- Parameters:
label- the label of the field ornullto disable label creationoperation- the operation, cannot benull.- Returns:
- the builder instance, never
null.
-
element
Creates a newILabeledDefinitionand adds to the section.- Parameters:
label- the label of the field ornullto disable label creationdefinitionIdentifier- the definition identifier, cannot benull.- Returns:
- the builder instance, never
null.
-
element
Creates a newILabeledDefinitionand adds to the section.- Parameters:
label- the label of the field ornullto disable label creationstringIdentifier- the string that identifies definition uniquely, cannot benull.- Returns:
- the builder instance, never
null.
-
setup
public SetupDefinitionBuilder<AbstractDefinition,? extends SetupDefinitionBuilder<AbstractDefinition, setup()?, T>, T> Returns the instance of the setup builder that allows to setup the currently positioned definition. If there are no definition added it returns the setup builder for the section definition.- Returns:
- setup definition builder instance, never
null.
-
componentFactory
A convenience wrapper forSetupDefinitionBuilder.componentFactory(IComponentFactory).- Parameters:
componentFactory- the component factory for the current element- Returns:
- the builder instance, never
null.
-
component
A convenience wrapper forSetupDefinitionBuilder.component(Class, IParameterization).- Parameters:
componentClass- Component class for the current elementparameterization- Component parameterization for the current element- Returns:
- The builder instance, never
null.
-
separator
CreatesSeparatorDefinitionand adds it to section definition.- Returns:
- the builder instance, never
null.
-
endSection
Ends section and performs the action that is given while instantiating the builder.- Returns:
- the object given in constructor, never
null.
-
fieldDefinition
protected IDefinition fieldDefinition(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, org.eclipse.emf.databinding.FeaturePath... featurePaths) Cretets field definition for the provided parameters.- Parameters:
componentClass- the component class, cannot benullparameterization- the component parameterization, cannot benulllabel- the component label ornullif nonefeaturePaths- the EMF feature pathes, cannot benull- Returns:
- the created definition, never
null
-
operationFieldDefinition
protected IDefinition operationFieldDefinition(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, org.eclipse.emf.ecore.EOperation operation) Cretets operation field definition for the provided parameters.- Parameters:
componentClass- the component class, cannot benullparameterization- the component parameterization, cannot benulllabel- the component label ornullif noneoperation- the EMF operation, cannot benull- Returns:
- the created definition, never
null
-
stringIdDefiniton
protected IDefinition stringIdDefiniton(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, String stringId) Cretets string identified field definition for the provided parameters.- Parameters:
componentClass- the component class, cannot benullparameterization- the component parameterization, cannot benulllabel- the component label ornullif nonestringId- the string identifier of the definition, cannot benull- Returns:
- the created definition, never
null
-
labeledDefinition
protected IDefinition labeledDefinition(Class<? extends IComponent<?>> componentClass, IParameterization parameterization, String label, IDefinitionIdentifier definitionIdentifier) Cretets labeled definition for the provided parameters.- Parameters:
componentClass- the component class, cannot benullparameterization- the component parameterization, cannot benulllabel- the component label ornullif nonedefinitionIdentifier- theIDefinitionIdentifierinstance, cannot benull.- Returns:
- the created definition, never
null.
-
getComponentParameterizationInfo
protected SectionDefinitionBuilder.ComponentParameterizationInfo getComponentParameterizationInfo(org.eclipse.emf.ecore.EOperation operation) Returns theSectionDefinitionBuilder.ComponentParameterizationInfofor the given operation.- Parameters:
operation- the operation.- Returns:
- the
SectionDefinitionBuilder.ComponentParameterizationInfo.
-
getComponentParameterizationInfo
protected SectionDefinitionBuilder.ComponentParameterizationInfo getComponentParameterizationInfo(org.eclipse.emf.ecore.EStructuralFeature... features) Returns theSectionDefinitionBuilder.ComponentParameterizationInfofor the given feature path.- Parameters:
features- the features that represents the feature path.- Returns:
- the c the
SectionDefinitionBuilder.ComponentParameterizationInfo.
-
getLastFeature
protected static final org.eclipse.emf.ecore.EStructuralFeature getLastFeature(org.eclipse.emf.ecore.EStructuralFeature... features) Returns the last feature of the given feature array.- Parameters:
features- the features, may benull- Returns:
- an
EStructuralFeatureinstance ornull
-
info
protected static SectionDefinitionBuilder.ComponentParameterizationInfo info(Class<? extends IComponent<?>> componentClass, IParameterization parameterization) BuildsSectionDefinitionBuilder.ComponentParameterizationInfowith the given parameters and returns it.- Parameters:
componentClass- the component class.parameterization- the parameterization.- Returns:
SectionDefinitionBuilder.ComponentParameterizationInfo.
-
setElementLogger
Sets a logger that will be called from eachelement(String, EStructuralFeature...)call.
-