Class SerializationContext


  • public class SerializationContext
    extends FunctionReferenceContext
    Context needed to serialize an expression to a string. This has the lifetime of a single serialization
    Author:
    bratseth
    • Constructor Detail

      • SerializationContext

        public SerializationContext()
        Create a context for a single serialization task
      • SerializationContext

        public SerializationContext​(Collection<ExpressionFunction> functions)
        Create a context for a single serialization task
      • SerializationContext

        public SerializationContext​(Map<String,​ExpressionFunction> functions)
        Create a context for a single serialization task
      • SerializationContext

        public SerializationContext​(Collection<ExpressionFunction> functions,
                                    Map<String,​String> bindings,
                                    Map<String,​String> serializedFunctions)
        Create a context for a single serialization task
        Parameters:
        functions - the functions of this
        bindings - the arguments of this
        serializedFunctions - a cache of serializedFunctions - the ownership of this map is transferred to this and will be modified in it
      • SerializationContext

        public SerializationContext​(com.google.common.collect.ImmutableMap<String,​ExpressionFunction> functions,
                                    Map<String,​String> bindings,
                                    Map<String,​String> serializedFunctions)
        Create a context for a single serialization task
        Parameters:
        functions - the functions of this
        bindings - the arguments of this
        serializedFunctions - a cache of serializedFunctions - the ownership of this map is transferred to this and will be modified in it
    • Method Detail

      • addFunctionSerialization

        public void addFunctionSerialization​(String name,
                                             String expressionString)
        Adds the serialization of a function
      • addArgumentTypeSerialization

        public void addArgumentTypeSerialization​(String functionName,
                                                 String argumentName,
                                                 com.yahoo.tensor.TensorType type)
        Adds the serialization of the an argument type to a function
      • addFunctionTypeSerialization

        public void addFunctionTypeSerialization​(String functionName,
                                                 com.yahoo.tensor.TensorType type)
        Adds the serialization of the return type of a function
      • needSerialization

        public boolean needSerialization​(String functionName)