Class AbstractItemBuilder<T extends AbstractItemBuilder<T,P>,P extends ExpressionCompiler & BuilderParent>

java.lang.Object
io.dialob.session.engine.program.AbstractItemBuilder<T,P>
All Implemented Interfaces:
Builder<P>, AliasesProvider
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 Details

    • EMPTY_LABEL

      public static final ImmutableLabel EMPTY_LABEL
    • label

      protected Label label
    • description

      protected Label description
    • activeWhen

      protected Expression activeWhen
    • props

      protected Map<String,?> props
  • Constructor Details

  • Method Details

    • getProgramBuilder

      protected ProgramBuilder getProgramBuilder()
    • addClassname

      public T addClassname(@NonNull String className)
    • addClassname

      public T addClassname(String when, @NonNull String className)
    • setLabel

      public T setLabel(Map<String,String> label)
    • setLabel

      public T setLabel(String language, String label)
    • setDescription

      public T setDescription(Map<String,String> description)
    • setDescription

      public T setDescription(String language, String description)
    • setActiveWhen

      public T setActiveWhen(String activeWhen)
    • getIndex

      protected Optional<Integer> getIndex()
    • getActiveWhenExpressionErrorType

      @NonNull protected io.dialob.api.form.FormValidationError.Type getActiveWhenExpressionErrorType()
    • setProps

      public T setProps(Map<String,Object> props)
    • getAliases

      public Map<String,ItemId> getAliases()
      Specified by:
      getAliases in interface AliasesProvider
    • 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)
    • addClassnames

      public T addClassnames(List<String> classNames)
    • build

      public P build()
      Specified by:
      build in interface Builder<T extends AbstractItemBuilder<T,P>>
    • 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()
    • getValueType

      public Optional<ValueType> getValueType()
    • getHoistingGroup

      protected Optional<GroupBuilder> getHoistingGroup()
    • findHostingRowgroupId

      protected Optional<ItemId> findHostingRowgroupId()