Class OperatorFileWriter.Side

java.lang.Object
com.ultikits.ultitools.config.document.OperatorFileWriter.Side
Enclosing class:
OperatorFileWriter

private static final class OperatorFileWriter.Side extends Object
One side of the comparison: its document, node tree, lines, nodes by line and owned-line marks.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final ConfigDocument
     
    private final List<String>
     
    private final Map<Integer,List<List<Object>>>
     
    private final boolean[]
     
    private final org.yaml.snakeyaml.nodes.Node
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Side(ConfigDocument document, org.yaml.snakeyaml.nodes.Node tree, List<String> lines)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    mark(int from, int to)
     
    (package private) String
    markComment(List<String> path, int commentLines)
    Marks the commentLines owned comment lines directly above the key at path.
    (package private) String
    markSectionLine(List<String> section, int line)
    Marks the key line of an expanded section (OperatorFileWriter.EmptySections): only that one line, and only when every node on it is the section's own key or value - so a flow collection or a second key on the line is never owned.
    (package private) String
    markValue(List<String> path, int commentLines)
    Marks the span of the key at path - key line to the last line of its value, plus the commentLines owned comment lines directly above it - and returns a reason when a line of that span also holds a node of a path the write does not own, or the comment is not where it belongs.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • document

      private final ConfigDocument document
    • tree

      private final org.yaml.snakeyaml.nodes.Node tree
    • lines

      private final List<String> lines
    • owned

      private final boolean[] owned
    • nodes

      private final Map<Integer,List<List<Object>>> nodes
  • Constructor Details

  • Method Details

    • markValue

      String markValue(List<String> path, int commentLines)
      Marks the span of the key at path - key line to the last line of its value, plus the commentLines owned comment lines directly above it - and returns a reason when a line of that span also holds a node of a path the write does not own, or the comment is not where it belongs.
    • markComment

      String markComment(List<String> path, int commentLines)
      Marks the commentLines owned comment lines directly above the key at path.
    • markSectionLine

      String markSectionLine(List<String> section, int line)
      Marks the key line of an expanded section (OperatorFileWriter.EmptySections): only that one line, and only when every node on it is the section's own key or value - so a flow collection or a second key on the line is never owned.
    • mark

      private void mark(int from, int to)