Class MapEntityContext<T>

    • Field Detail

      • objectClass

        protected final Class<T> objectClass
      • result

        protected final T result

        protected static final String ATTRIBUTES_NAME
    • Constructor Detail

      • MapEntityContext

        public MapEntityContext​(Class<T> clazz)
      • MapEntityContext

        public MapEntityContext​(Class<T> clazz,
                                boolean topContext)
    • Method Detail

      • setEntityField

        public static <T> boolean setEntityField​(T result,
                                                 EntityField<? super T> ef,
                                                 Object value)
      • add

        public void add​(String name,
                        Object value)
        Description copied from interface: BlockContext
        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.

        Specified by:
        add in interface BlockContext<T>
      • getResult

        public T getResult()
        Description copied from interface: BlockContext
        Returns the result of parsing the given part of YAML file.
        Specified by:
        getResult in interface BlockContext<T>
      • getContext

        public BlockContext<?> getContext​(String nameOfSubcontext)
        Description copied from interface: BlockContext
        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.
        Specified by:
        getContext in interface BlockContext<T>
        nameOfSubcontext - Key of the map entry
        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