in src/main/java/org/ini4j/spi/IniParser.java [67:107]
private void parse(IniSource source, IniHandler handler) throws IOException {
handler.startIni();
String sectionName = null;
for (String line = source.readLine(); line != null; line = source.readLine())
{
if (line.charAt(0) == SECTION_BEGIN)
{
if (sectionName != null)
{
handler.endSection();
}
sectionName = parseSectionLine(line, source, handler);
}
else
{
if (sectionName == null)
{
if (getConfig().isGlobalSection())
{
sectionName = getConfig().getGlobalSectionName();
handler.startSection(sectionName);
}
else
{
parseError(line, source.getLineNumber());
}
}
parseOptionLine(line, handler, source.getLineNumber());
}
}
if (sectionName != null)
{
handler.endSection();
}
handler.endIni();
}