@Override public ConfigParseable relativeTo(String s) { ConfigParseable parseable = configIncludeContext.relativeTo(s); assert parseable != null; // Here is where we fix the parseOptions.... // since the SimpleIncluder's RelativeNameSource.nameToParseable disregards the passed in // options return new CustomConfigParseable(parseable, parseOptions); }
@Override public ConfigObject include(ConfigIncludeContext configIncludeContext, String s) { ConfigSyntax syntax = null; if (s.endsWith("conf")) { syntax = ConfigSyntax.CONF; } else if (s.endsWith("json")) { syntax = ConfigSyntax.JSON; } else if (s.endsWith("properties")) { syntax = ConfigSyntax.PROPERTIES; } if (syntax != null) { ConfigParseOptions newParseOptions = configIncludeContext.parseOptions().setSyntax(syntax); return includer.include( new CustomConfigIncludeContext(configIncludeContext, newParseOptions), s); } else { // who knows what the syntax was suppose to be return includer.include(configIncludeContext, s); } }