in src/main/java/org/ini4j/BasicProfile.java [168:199]
void resolve(StringBuilder buffer, Section owner)
{
Matcher m = EXPRESSION.matcher(buffer);
while (m.find())
{
String sectionName = m.group(G_SECTION);
String optionName = m.group(G_OPTION);
int optionIndex = parseOptionIndex(m);
Section section = parseSection(m, owner);
String value = null;
if (SECTION_ENVIRONMENT.equals(sectionName))
{
value = Config.getEnvironment(optionName);
}
else if (SECTION_SYSTEM_PROPERTIES.equals(sectionName))
{
value = Config.getSystemProperty(optionName);
}
else if (section != null)
{
value = (optionIndex == -1) ? section.fetch(optionName) : section.fetch(optionName, optionIndex);
}
if (value != null)
{
buffer.replace(m.start(), m.end(), value);
m.reset(buffer);
}
}
}