Class BaseConstructor

    • Field Detail

      • tagConstructors

        protected final Map<Tag,​ConstructNode> tagConstructors
        It maps the (explicit or implicit) tag to the Construct implementation.
    • Constructor Detail

      • BaseConstructor

        public BaseConstructor​(LoadSettings settings)
    • Method Detail

      • constructSingleDocument

        public Object constructSingleDocument​(Optional<Node> optionalNode)
        Ensure that the stream contains a single document and construct it
        Parameters:
        optionalNode - - composed Node
        Returns:
        constructed instance
      • construct

        protected Object construct​(Node node)
        Construct complete YAML document. Call the second step in case of recursive structures. At the end cleans all the state.
        Parameters:
        node - root Node
        Returns:
        Java instance
      • constructObject

        protected Object constructObject​(Node node)
        Construct object from the specified Node. Return existing instance if the node is already constructed.
        Parameters:
        node - Node to be constructed
        Returns:
        Java instance
      • constructObjectNoCheck

        protected Object constructObjectNoCheck​(Node node)
      • createDefaultList

        protected List<Object> createDefaultList​(int initSize)
      • createDefaultSet

        protected Set<Object> createDefaultSet​(int initSize)
      • createDefaultMap

        protected Map<Object,​Object> createDefaultMap​(int initSize)
      • createArray

        protected Object createArray​(Class<?> type,
                                     int size)
      • postponeSetFilling

        protected void postponeSetFilling​(Set<Object> set,
                                          Object key)