Package nz.org.riskscape.engine.typexp
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 Type
s to a TypeSet
via an ini file and the riskscape type expression dsl
-
Nested Class Summary
Nested classes/interfaces inherited from interface nz.org.riskscape.engine.ini.IdentifiedObjectBuilder
IdentifiedObjectBuilder.Base<T extends nz.org.riskscape.engine.Identified>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The prefix of keys to use to identify struct member type definitions across many lines, e.g.static final String
The key to use to identify a type that is described in a single line, e.g.static final String
The INI section keyword to look for, e.g. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionnz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.typeset.CanonicalType>
Builds the item based on the given INI section.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) Methods inherited from class nz.org.riskscape.engine.ini.IdentifiedObjectBuilder.Base
getIdentifiedClass, getKeyword
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nz.org.riskscape.engine.ini.IdentifiedObjectBuilder
addToProject
-
Field Details
-
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
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
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.
-