Class KeyValueSectionBuilder

java.lang.Object
com.siperf.confio.sections.AbstractSectionBuilder
com.siperf.confio.sections.keyvalue.KeyValueSectionBuilder
All Implemented Interfaces:
SectionBuilder
Direct Known Subclasses:
UppercaseSectionBuilder

public class KeyValueSectionBuilder extends AbstractSectionBuilder
Default implementation of SectionBuilder that provides standard INI-style parsing.
  • Field Details

  • Constructor Details

    • KeyValueSectionBuilder

      public KeyValueSectionBuilder(String name)
  • Method Details

    • addContentLine

      public void addContentLine(String rawLine, String trimmed, String comment)
      Description copied from class: AbstractSectionBuilder
      Processes a content line. This method implements the default parsing logic that can be overridden.
      Specified by:
      addContentLine in interface SectionBuilder
      Overrides:
      addContentLine in class AbstractSectionBuilder
      Parameters:
      rawLine - the raw line
      trimmed - the line content without comments
      comment - the comment part (if any)
    • processLineAsParameterOrContent

      protected void processLineAsParameterOrContent(String rawLine, String lineWithoutComment)
      Processes a line as key-value parameter or content. This method implements the default parsing logic that can be overridden.
      Parameters:
      rawLine - the raw line
      lineWithoutComment - the line content without comments
    • createSection

      protected Section createSection()
      Description copied from class: AbstractSectionBuilder
      Creates the concrete Section instance. This method must be implemented by concrete subclasses.
      Specified by:
      createSection in class AbstractSectionBuilder
      Returns:
      the created section instance
    • computeType

      protected SectionType computeType(Map<String,String> parameters, List<String> contentLines)
      Computes the section type based on parameters and content lines. This method also removes the __type__ meta-parameter from the parameters map if present.
      Parameters:
      parameters - the section parameters
      contentLines - the content lines
      Returns:
      the computed section type