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 Detail

      • 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 given Transformation, 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 a structure 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 as expected.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.
      • linkLineage

        Optional<Lineage> linkLineage​(String alias)
        Tries to resolve a lineage link specified by a given alias for a VTL rule defined in this scheme.
        Parameters:
        alias - The alias referring to a rule
        Returns:
        The lineage link