Clean up ConfigDocumentParser tests by using the `intercept`
method to handle exception testing, moving some tests, and
removing a test that was re-testing already tested functionality.
Fix bug wherein parsing of a single value would throw an exception
when the value is a map with a key that has an object value and no
separator if the default ConfParserOptions where used. Add a test
to validate this fix.
Update the ConfigNodeTests to reflect the changes to the way
various types of ConfigNode work, including removing all
leading/trailing whitespace from ConfigNodeFields and adding in
ConfigNodeComments in place of ConfigNodeSingleTokens containing
comment tokens.
Cleanup the indentText() method on ConfigNodeComplexValue as per
PR feedback. Add a test for indentation when inserting a value
with an include statement.
Modify the ConfigDocument duplicate removal so that multi-element
paths beginning with the desired path whose value should be set
are always removed as duplicates.
Address numerous pieces of PR feedback, including:
* Change ConfigDocumentParser's parse method to take a
ConfigOrigin as a parameter, and uses this origin when
throwing Parse exceptions rather than a dummy origin
* Pass in the type of an include node on construction so it
does not have to parse the information out itself
* Add tests to ensure an empty object is created inside a
ConfigNodeRoot when an empty document is given
* Remove unused instance variables or variables duplicated
between the two parsers
This is for #186 / #282 as an alternative to adding
a ton of getFooOrNull methods. With these methods apps
can handle null or missing settings in a special way
if they see fit.
Update the single value parsing method to throw an exception
when there is leading or trailing whitespace. Modify concatenation
parsing in the ConfigDocumentParser to put back any trailing
whitespace. Add a hashCode method for AbstractConfigNodes.
Implement an `equals()` method for AbstractConfigNodes. Add a
test to ensure an exception is thrown when calling setValue()
on a ConfigDocument when passing in a value with HOCON syntax
when the document was parsed as JSON. Add a setValue() method to
the ConfigDocument interface that takes a ConfigValue instead of
a String. When parsing a single value, throw an exception if a
concatenation is seen when parsing JSON.
Make the javadoc string for the ConfigDocument interface more
explicit about what it does with the value string when setting
a value. Add support for parsing a reader into a ConfigDocument.
Improve the field addition in node replacement so that it will
create any non-existent objects along the desired path to the
desired value. Modify Path Node parsing so that subpaths can
be retrieved with the necessary tokens for those subpaths.
Ensure that the addition of a new field in a JSON document
results in valid JSON.