Class Node

    • Field Detail

      • resolved

        protected boolean resolved
        true when the tag is assigned by the resolver
    • Constructor Detail

      • Node

        public Node​(Tag tag,
                    Optional<Mark> startMark,
                    Optional<Mark> endMark)
        Create Node to be parsed
        Parameters:
        tag - - the tag
        startMark - - start mark when available
        endMark - - end mark when available
    • Method Detail

      • getTag

        public Tag getTag()
        Tag of this node.

        Every node has a tag assigned. The tag is either local or global.

        Returns:
        Tag of this node.
      • getNodeType

        public abstract NodeType getNodeType()
        Returns:
        scalar, sequence, mapping
      • setTag

        public void setTag​(Tag tag)
      • equals

        public final boolean equals​(Object obj)
        Node is only equal to itself
        Overrides:
        equals in class Object
      • setRecursive

        public void setRecursive​(boolean recursive)
      • isRecursive

        public boolean isRecursive()
        Indicates if this node must be constructed in two steps.

        Two-step construction is required whenever a node is a child (direct or indirect) of it self. That is, if a recursive structure is build using anchors and aliases.

        Set by Composer, used during the construction process.

        Only relevant during loading.

        Returns:
        true if the node is self referenced.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • setProperty

        public Object setProperty​(String key,
                                  Object value)
        Define a custom runtime property. It is not used by Engine but may be used by other tools.
        Parameters:
        key - - the key for the custom property
        value - - the value for the custom property
        Returns:
        the previous value for the provided key if it was defined
      • getProperty

        public Object getProperty​(String key)
        Get the custom runtime property.
        Parameters:
        key - - the key of the runtime property
        Returns:
        the value if it was specified