Class KeyValueSectionBuilder
java.lang.Object
com.siperf.confio.sections.AbstractSectionBuilder
com.siperf.confio.sections.keyvalue.KeyValueSectionBuilder
- All Implemented Interfaces:
SectionBuilder
- Direct Known Subclasses:
UppercaseSectionBuilder
Default implementation of SectionBuilder that provides standard INI-style parsing.
-
Field Summary
FieldsFields inherited from class com.siperf.confio.sections.AbstractSectionBuilder
contentLines, id, name, parent, rawLines, subsections, subsectionsById, subsectionsByName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContentLine(String rawLine, String trimmed, String comment) Processes a content line.protected SectionTypeComputes the section type based on parameters and content lines.protected SectionCreates the concrete Section instance.protected voidprocessLineAsParameterOrContent(String rawLine, String lineWithoutComment) Processes a line as key-value parameter or content.Methods inherited from class com.siperf.confio.sections.AbstractSectionBuilder
addRawLine, addSubsection, build, getId, getParent, getSectionName, getSubsection, getSubsection, getSubsections, hasSubsection, hasSubsection, isRoot, isValidKey, setParent, toString
-
Field Details
-
parameters
-
-
Constructor Details
-
KeyValueSectionBuilder
-
-
Method Details
-
addContentLine
Description copied from class:AbstractSectionBuilderProcesses a content line. This method implements the default parsing logic that can be overridden.- Specified by:
addContentLinein interfaceSectionBuilder- Overrides:
addContentLinein classAbstractSectionBuilder- Parameters:
rawLine- the raw linetrimmed- the line content without commentscomment- the comment part (if any)
-
processLineAsParameterOrContent
Processes a line as key-value parameter or content. This method implements the default parsing logic that can be overridden.- Parameters:
rawLine- the raw linelineWithoutComment- the line content without comments
-
createSection
Description copied from class:AbstractSectionBuilderCreates the concrete Section instance. This method must be implemented by concrete subclasses.- Specified by:
createSectionin classAbstractSectionBuilder- Returns:
- the created section instance
-
computeType
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 parameterscontentLines- the content lines- Returns:
- the computed section type
-