Class IniFileTypeBuilder

java.lang.Object
nz.org.riskscape.engine.ini.IdentifiedObjectBuilder.Base<nz.org.riskscape.engine.typeset.CanonicalType>
nz.org.riskscape.engine.typexp.IniFileTypeBuilder
All Implemented Interfaces:
IdentifiedObjectBuilder<nz.org.riskscape.engine.typeset.CanonicalType>

public class IniFileTypeBuilder extends IdentifiedObjectBuilder.Base<nz.org.riskscape.engine.typeset.CanonicalType>

Can add Types to a TypeSet via an ini file and the riskscape type expression dsl

  • Field Details

    • TYPE

      public static final String TYPE

      The key to use to identify a type that is described in a single line, e.g. [my-type] type = nullable(text)

      See Also:
    • MULTILINE_TYPE_PREFIX

      public static final String MULTILINE_TYPE_PREFIX

      The prefix of keys to use to identify struct member type definitions across many lines, e.g. [my-type] type.animal = enum('cat', 'dog', 'pig') type.weight = range(floating, 0, 1000000)

      See Also:
    • TYPE_KEY

      public static final String TYPE_KEY

      The INI section keyword to look for, e.g. [type my-type] ...

      See Also:
  • Constructor Details

    • IniFileTypeBuilder

      public IniFileTypeBuilder(nz.org.riskscape.engine.Project project)
  • Method Details

    • buildType

      public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.types.Type> buildType(nz.org.riskscape.engine.typexp.TypeBuilder builder, nz.org.riskscape.config.ConfigSection sectionValues)
    • build

      public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.typeset.CanonicalType> build(String id, nz.org.riskscape.config.ConfigSection section)
      Description copied from interface: IdentifiedObjectBuilder

      Builds the item based on the given INI section.

      Returns:
      the item successfully built, or any problems that occurred.