Package nz.org.riskscape.engine.typexp
Interface TypeConstructor
- All Known Subinterfaces:
ComplexTypeConstructor
,SimpleTypeConstructor
- All Known Implementing Classes:
Anything
,Bool
,Date
,Decimal
,Floating
,Geom
,GeomType
,GeomType.Line
,GeomType.Point
,GeomType.Polygon
,Integer
,Nothing
,SimpleType
,Text
public interface TypeConstructor
Interface for types that can construct a Type
based on an AST
. This interface is not expected to be
implemented directly, implementors are instead expected to use the functional interfaces of
ComplexTypeConstructor
or SimpleTypeConstructor
- but this is optional.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Type
construct
(TypeBuilder typeBuilder, AST.ComplexType type) Attempt to build the type represented by thisTypeConstructor
default Type
construct
(TypeBuilder typeBuilder, AST.Symbol symbol) Attempt to build the type represented by thisTypeConstructor
-
Method Details
-
construct
Attempt to build the type represented by this
TypeConstructor
- Parameters:
typeBuilder
- the type builder that is being used to build types. Contains helper methods for implementations.type
- the ast that a type is being constructed from- Returns:
- the fully constructed type. Note that this might contain further nested types - these can/should be parsed using DefaultTypeBuilder#expectType(AST, java.util.function.Function).
- Throws:
TypeBuildingException
- if something went wrong
-
construct
Attempt to build the type represented by this
TypeConstructor
- Parameters:
typeBuilder
- the type builder that is being used to build types. Contains helper methods for implementations.symbol
- the ast that a type is being constructed from- Returns:
- the fully constructed type
- Throws:
TypeBuildingException
- if something went wrong
-