Package io.dialob.program
Class AbstractItemBuilder<T extends AbstractItemBuilder<T,P>,P extends ExpressionCompiler & BuilderParent>
- java.lang.Object
-
- io.dialob.program.AbstractItemBuilder<T,P>
-
- All Implemented Interfaces:
AliasesProvider,Builder<P>
- Direct Known Subclasses:
GroupBuilder,QuestionBuilder,SurveyGroupBuilder,ValidationBuilder,ValueSetBuilder,ValueSetEntryBuilder,VariableBuilder
public abstract class AbstractItemBuilder<T extends AbstractItemBuilder<T,P>,P extends ExpressionCompiler & BuilderParent> extends Object implements Builder<P>, AliasesProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected ExpressionactiveWhenprotected Labeldescriptionstatic ImmutableLabelEMPTY_LABELprotected Labellabelprotected Map<String,? extends Object>props
-
Constructor Summary
Constructors Constructor Description AbstractItemBuilder(ProgramBuilder programBuilder, P parent, GroupBuilder hoistingGroupBuilder, String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaddClassname(String className)TaddClassname(String when, String className)TaddClassnames(List<String> classNames)protected voidafterExpressionCompilation(Consumer<io.dialob.api.form.FormValidationError> errorConsumer)protected voidbeforeExpressionCompilation(Consumer<io.dialob.api.form.FormValidationError> errorConsumer)Pbuild()protected voiddoBuild()protected Optional<ItemId>findHostingRowgroupId()protected io.dialob.api.form.FormValidationError.TypegetActiveWhenExpressionErrorType()Map<String,ItemId>getAliases()Optional<GroupBuilder>getHoistingGroup()ItemIdgetId()protected Optional<Integer>getIndex()ProgramBuildergetProgramBuilder()Optional<ValueType>getValueType()protected voidrequireBooleanExpression(Expression expression, io.dialob.api.form.FormValidationError.Type type, Consumer<io.dialob.api.form.FormValidationError> errorConsumer)protected TsetActiveWhen(Expression activeWhen)TsetActiveWhen(String activeWhen)TsetDescription(String language, String description)TsetDescription(Map<String,String> description)TsetLabel(String language, String label)TsetLabel(Map<String,String> label)TsetProps(Map<String,Object> props)
-
-
-
Field Detail
-
EMPTY_LABEL
public static final ImmutableLabel EMPTY_LABEL
-
label
protected Label label
-
description
protected Label description
-
activeWhen
protected Expression activeWhen
-
-
Constructor Detail
-
AbstractItemBuilder
public AbstractItemBuilder(ProgramBuilder programBuilder, P parent, GroupBuilder hoistingGroupBuilder, @Nonnull String id)
-
-
Method Detail
-
getProgramBuilder
public ProgramBuilder getProgramBuilder()
-
getActiveWhenExpressionErrorType
@NotNull protected io.dialob.api.form.FormValidationError.Type getActiveWhenExpressionErrorType()
-
getAliases
public Map<String,ItemId> getAliases()
- Specified by:
getAliasesin interfaceAliasesProvider
-
setActiveWhen
protected T setActiveWhen(Expression activeWhen)
-
requireBooleanExpression
protected void requireBooleanExpression(Expression expression, io.dialob.api.form.FormValidationError.Type type, Consumer<io.dialob.api.form.FormValidationError> errorConsumer)
-
build
public P build()
-
doBuild
protected void doBuild()
-
beforeExpressionCompilation
protected void beforeExpressionCompilation(Consumer<io.dialob.api.form.FormValidationError> errorConsumer)
-
afterExpressionCompilation
protected void afterExpressionCompilation(Consumer<io.dialob.api.form.FormValidationError> errorConsumer)
-
getId
@Nonnull public ItemId getId()
-
getHoistingGroup
public Optional<GroupBuilder> getHoistingGroup()
-
-