Class TypeDefinitions
java.lang.Object
com.aquima.interactions.expressions.r7.semantics.TypeDefinitions
- All Implemented Interfaces:
ITypeDefinitions
This class encapsulates an definition source and adds functions and expression templates for usage within the
expression parsing process.
- Since:
- 6.0
- Author:
- F. van der Meer
-
Constructor Summary
ConstructorsConstructorDescriptionTypeDefinitions
(IDefinitionSource definitionSource, Map<String, IExpr> expressionTemplates) Constructs a type definitions with a definition source, the definition source is mandatory. -
Method Summary
Modifier and TypeMethodDescriptiongetExpressionTemplate
(String templateName) This function returns the expression object corresponding to the template name.getFunctionDefinitions
(String functionName) This method looks up all function definitions for it's name.getSharedAncestor
(String expectedType, String receivedType) This function locates the shared ancestor type for the 2 passed arguments.lookupRecordType
(String entityTypeName) This function locates the type object for an entity-type name.lookupRecordType
(String entityTypeName, String accessorName) This method looks for the type of record access (field) element.lookupVariable
(String recordTypeName, String instanceName) This function looks up a variable ( named-instance ) from the definitions.
-
Constructor Details
-
TypeDefinitions
Constructs a type definitions with a definition source, the definition source is mandatory.- Parameters:
definitionSource
- The definition source which defines the root object definitions.expressionTemplates
- The map of expression templates available during runtime.
-
-
Method Details
-
getFunctionDefinitions
Description copied from interface:ITypeDefinitions
This method looks up all function definitions for it's name. Function parameter matching is done by the parser itself.- Specified by:
getFunctionDefinitions
in interfaceITypeDefinitions
- Parameters:
functionName
- The name of the function which should not be null or empty.- Returns:
- An array of functions, an empty array should be returned when there was no match.
-
lookupRecordType
Description copied from interface:ITypeDefinitions
This method looks for the type of record access (field) element.- Specified by:
lookupRecordType
in interfaceITypeDefinitions
- Parameters:
entityTypeName
- The record type name.accessorName
- The field name within the record.- Returns:
- The type of this field when found, null otherwise.
-
lookupRecordType
Description copied from interface:ITypeDefinitions
This function locates the type object for an entity-type name.- Specified by:
lookupRecordType
in interfaceITypeDefinitions
- Parameters:
entityTypeName
- The type name of the entity which should be non-zero length.- Returns:
- The type of this entity type when found, null otherwise.
-
lookupVariable
Description copied from interface:ITypeDefinitions
This function looks up a variable ( named-instance ) from the definitions. In this case the variable is a statically created instance which should be available on runtime at all times.- Specified by:
lookupVariable
in interfaceITypeDefinitions
- Parameters:
recordTypeName
- The type name of the record ( entity-type )instanceName
- The instance name which is unique for this entity-type.- Returns:
- The type object for this named instance, null otherwise.
-
getExpressionTemplate
Description copied from interface:ITypeDefinitions
This function returns the expression object corresponding to the template name.- Specified by:
getExpressionTemplate
in interfaceITypeDefinitions
- Parameters:
templateName
- The name of the expression template.- Returns:
- The parsed expression object corresponding to this template, null when it was not found.
-