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 Classes Modifier and Type Class Description static classSectionDefinitionBuilder.ComponentParameterizationInfoContainer class for constructing elements inelement(String, EStructuralFeature...).
-
Constructor Summary
Constructors Modifier Constructor Description protectedSectionDefinitionBuilder(Supplier<SectionDefinition> provider, Consumer<SectionDefinition> endAction, R endSectionResult)Instantiates a new builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <R> SectionDefinitionBuilder<R,?>builder(Supplier<SectionDefinition> provider, Consumer<SectionDefinition> endAction, R endSectionResult)Creates a new builder.Tcomponent(Class<? extends IComponent> componentClass, IParameterization parameterization)A convenience wrapper forSetupDefinitionBuilder.component(Class, IParameterization).TcomponentFactory(IComponentFactory componentFactory)A convenience wrapper forSetupDefinitionBuilder.componentFactory(IComponentFactory).Telement(String label, IDefinitionIdentifier definitionIdentifier)Creates a newILabeledDefinitionand adds to the section.Telement(String label, String stringIdentifier)Creates a newILabeledDefinitionand adds to the section.Telement(String label, org.eclipse.emf.ecore.EOperation operation)Creates a newOperationFieldDefinitionand adds to the section.Telement(String label, org.eclipse.emf.ecore.EStructuralFeature... features)Creates a newFieldDefinitionand adds it to the section.RendSection()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.protected SectionDefinitionBuilder.ComponentParameterizationInfogetComponentParameterizationInfo(org.eclipse.emf.ecore.EOperation operation)Returns theSectionDefinitionBuilder.ComponentParameterizationInfofor the given operation.protected SectionDefinitionBuilder.ComponentParameterizationInfogetComponentParameterizationInfo(org.eclipse.emf.ecore.EStructuralFeature... features)Returns theSectionDefinitionBuilder.ComponentParameterizationInfofor the given feature path.protected static 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.TmultiFeatureElement(String label, org.eclipse.emf.ecore.EStructuralFeature... features)Creates a newFieldDefinitionwith specified single-feature paths and adds it to the section.TnavigateTo(IDefinitionIdentifier definitionIdentifier)Finds the definition with the given identifier.TnavigateTo(String stringIdentifier)Finds the definition with the given string identifier.TnavigateTo(org.eclipse.emf.ecore.EOperation operation)Finds the definition with the given operation and positions to it.TnavigateTo(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.Tseparator()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, setPosition
-
Methods inherited from class com._1c.g5.aef2.standard.definitions.builders.AbstractBuilder
apply, build, self
-
-
-
-
Constructor Detail
-
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 Detail
-
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
public T element(String label, org.eclipse.emf.ecore.EStructuralFeature... features)
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
public T multiFeatureElement(String label, org.eclipse.emf.ecore.EStructuralFeature... features)
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
public T element(String label, org.eclipse.emf.ecore.EOperation operation)
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
public T element(String label, IDefinitionIdentifier definitionIdentifier)
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
public T element(String label, String stringIdentifier)
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.
-
navigateTo
public T navigateTo(IDefinitionIdentifier definitionIdentifier)
Finds the definition with the given identifier.- Parameters:
definitionIdentifier- the definition identifier, cannot benull.- Returns:
- the builder instance, never
null.
-
navigateTo
public T navigateTo(String stringIdentifier)
Finds the definition with the given string identifier.- Parameters:
stringIdentifier- the string identifier, cannot benull.- Returns:
- the builder instance, never
null.
-
navigateTo
public T navigateTo(org.eclipse.emf.ecore.EStructuralFeature... features)
Finds the definition with the given feature path and positions to it.- Parameters:
features- the features that represent the feature path, cannot benull- Returns:
- the builder instance, never
null.
-
navigateTo
public T navigateTo(org.eclipse.emf.ecore.EOperation operation)
Finds the definition with the given operation and positions to it.- Parameters:
operation- operation the operation, cannot benull.- Returns:
- the builder instance, never
null.
-
setup
public SetupDefinitionBuilder<AbstractDefinition,? extends SetupDefinitionBuilder<AbstractDefinition,?,T>,T> setup()
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
public T componentFactory(IComponentFactory componentFactory)
A convenience wrapper forSetupDefinitionBuilder.componentFactory(IComponentFactory).- Parameters:
componentFactory- the component factory for the current element- Returns:
- the builder instance, never
null.
-
component
public T component(Class<? extends IComponent> componentClass, IParameterization parameterization)
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
public T separator()
CreatesSeparatorDefinitionand adds it to section definition.- Returns:
- the builder instance, never
null.
-
endSection
public R 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
protected void setElementLogger(Consumer<IDefinition> logger)
Sets a logger that will be called from eachelement(String, EStructuralFeature...)call.
-
-