Interface TransformationScheme
-
- All Known Subinterfaces:
VTLSession
- All Known Implementing Classes:
DatapointScope
,JoinApplyScope
,ParamScope
,ThisScope
,VTLSessionImpl
public interface TransformationScheme
A Transformation Scheme, as defined by VTL specification, is a collection of VTL statements linked together, that are meant to be evaluated within the same scope.- Author:
- Valentino Pinna
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
contains(String alias)
Determine if an alias is defined in this TransformationScheme.default VTLValue
eval(Transformation rule)
Attempts to compute a givenTransformation
, binding references to aliases defined in this TransformationScheme.VTLValueMetadata
getMetadata(String alias)
Searches and retrieves metadata for value, referred by an alias defined in this TransformationScheme.default TransformationScheme
getParent()
Checks if this transformation scheme is nested inside another one and return it.MetadataRepository
getRepository()
Statement
getRule(String alias)
Returns astructure
a rule referred by an alias defined in this TransformationScheme.Optional<Lineage>
linkLineage(String alias)
Tries to resolve a lineage link specified by a given alias for a VTL rule defined in this scheme.VTLValue
resolve(String alias)
Searches and retrieves a value, referred by an alias defined in this TransformationScheme.default <T extends VTLValue>
Tresolve(String alias, Class<T> expected)
The same asexpected.cast(resolve(alias))
-
-
-
Method Detail
-
getRepository
MetadataRepository getRepository()
- Returns:
- The
MetadataRepository
instance used by this TransformationScheme.
-
resolve
VTLValue resolve(String alias)
Searches and retrieves a value, referred by an alias defined in this TransformationScheme.- Parameters:
alias
- The alias whose value is to be retrieved.- Returns:
- The
VTLValue
if the alias is found. - Throws:
VTLUnboundAliasException
- if the alias is not defined.
-
eval
default VTLValue eval(Transformation rule)
Attempts to compute a givenTransformation
, binding references to aliases defined in this TransformationScheme.- Parameters:
rule
- The rule that must be evaluated.- Returns:
- The
VTLValue
resulting from applying the given rule. - Throws:
VTLUnboundAliasException
- if some references couldn't be resolved.
-
getMetadata
VTLValueMetadata getMetadata(String alias)
Searches and retrieves metadata for value, referred by an alias defined in this TransformationScheme.- Parameters:
alias
- the alias whose value is to be retrieved.- Returns:
- the
metadata
of the value if the alias is found. - Throws:
VTLUnboundAliasException
- if the alias is not defined.
-
getRule
Statement getRule(String alias)
Returns astructure
a rule referred by an alias defined in this TransformationScheme.- Parameters:
alias
- the alias of the rule whose structure is to be retrieved.- Returns:
- a
Statement
instance describing the rule if found. - Throws:
VTLUnboundAliasException
- if the alias is not defined.
-
contains
boolean contains(String alias)
Determine if an alias is defined in this TransformationScheme.- Parameters:
alias
- the alias whose value is to be retrieved.- Returns:
- whether the alias is defined or not.
-
resolve
default <T extends VTLValue> T resolve(String alias, Class<T> expected)
The same asexpected.cast(resolve(alias))
-
getParent
default TransformationScheme getParent()
Checks if this transformation scheme is nested inside another one and return it.- Returns:
- The TransformationScheme encompassing this one, if any.
-
-