Interface BlockContext<V>

    • Method Detail

      • getContext

        BlockContext<?> getContext​(String nameOfSubcontext)
        Called after reading a key of map entry in YAML file and before reading its value. The key of the entry is represented as nameOfSubcontext parameter, and provides means to specify a YamlContext for transforming the mapping value into appropriate Java object.
        Parameters:
        nameOfSubcontext - Key of the map entry
        Returns:
        Context used for transforming the value, or null if the default primitive / sequence / mapping context should be used instead.
        See Also:
        BlockContext.DefaultObjectContext, BlockContext.DefaultListContext, BlockContext.DefaultMapContext
      • add

        default void add​(String name,
                         Object value)
        Modifies the result returned from within this context by providing the read mapping entry name to given value.

        Called after reading a map entry (both key and value) from the YAML file is finished. The entry is represented as name parameter (key part of the entry) and value (value part of the entry).

        The method is called in the same order as the mapping items appear in the source YAML mapping.

        Parameters:
        name -
        value -
      • add

        default void add​(Object value)
        Modifies the result returned from within this context by providing the read primitive value or a single sequence item in the value parameter.

        Called after reading a primitive value or a single sequence item from the YAML file is finished.

        If the parsed YAML part was a sequence, this method is called in the same order as the sequence items appear in the source YAML sequence.

        Parameters:
        value -
      • getResult

        V getResult()
        Returns the result of parsing the given part of YAML file.
        Returns:
      • getScalarType

        Class<?> getScalarType()