For broken doc comments in impl, just deleted them for
the most part rather than writing a bunch of useless docs.
"impl" is now included in the docs because javadoc 8 seems
to explode otherwise, but it's well-labeled as internal ABI.
Fixes#176 by ensuring SerializedConfigValue implements the java.lang.Object
contract without exploding. This is a completely internal class, but
-Dsun.io.serialization.extendedDebugInfo=true calls toString on it.
This is a rearrangement of ConfigFactory so that defaultApplication is public.
Also fixes a bug where we were caching the overload that takes parse and resolve
options, without putting those options in the cache key. Moved to only cache
the actual default config (the one that doesn't take any options).
Fixes#196 plus the separate bug about bad caching.
Clean up the lossless tokens code based on feedback.
* Change nextTokenFromIterator() method to
nextTokenIgnoringWhitespace()
* Use StringBuilder in Tokenizer.render()
* Extract Whitespace token creation into a
`createWhitespaceTokenFromSaver` method
* Add DoubleSlashComment and HashComment subclasses of
Comment. Make Comment abstract.
* Make `tokenText()` method virtual and overload it in
subclasses that derive their original token text entirely
from other fields.
* Use `tokenizerTest` method in all relevant Tokenizer tests
* Add extra multi-line comment Tokenizer tests
Keep the original text of all tokens when Tokenizing a config
minus comments. Add a render method to the TokenIterator class
which generates the original text from which the tokens were
parsed.
Fixes#212 that object and list substitutions could not have
whitespace in between.
This patch carries quoted-ness into ConfigString, which is somewhat
bogus, and we may be able to clean it up later if we start to track
the tokens that each value originates from.
Fixes#228 reported by @derrickburns; since we can interpret
numeric keys as lists, we sort the keys numerically to make
it easy to read the list value in order.
We want to avoid ever getting a ClassCastException, instead we
want a more helpful error. So write out all types explicitly.
This also will make it easier to ensure that tests are
comprehensive, and this commit adds a lot more tests.
This commit now supports typesafe List<T>, and allows you
to have fields of type Object, ConfigObject, Config, ConfigValue,
and Map<String,Object>, so if you want to accept "anything" you
can do that by specifying a vague type and then casting it yourself.
The right way to do these would be analogous to getInt, that is,
with a getter on Config that checks the range and throws the
right exception if the range is incorrect. But, I hesitate to
add getByte, getShort, getByteList, getShortList all to Config,
since they don't seem super useful. If we do want them though,
they should be added to beans and to Config at the same time,
so they are completely parallel to how Integer and Long work.
The advantage of this is that rather than throwing a single
"ConfigException.Missing" we can give the user a list of all
missing and wrong-typed settings for the entire bean up front.
Validation is not perfect (just as the regular checkValid method
isn't, it doesn't find all problems that actually getting the
value could find), but it does find the common cases of leaving
out a setting or having a blatantly incorrect type.