Havoc Pennington
d4125f217b
Set Accept header on URL connections
...
This fixes #182 in theory, though test coverage is nonexistent.
2015-03-03 11:02:37 -05:00
Havoc Pennington
d1918a2068
Add symbolic names for content types
2015-03-03 11:02:33 -05:00
Havoc Pennington
600e788bea
Merge pull request #269 from typesafehub/doc-integer-narrowing
...
Document double-to-int behavior, fixes #183
2015-03-03 10:59:28 -05:00
Havoc Pennington
7a4d6c8446
Merge pull request #268 from typesafehub/whitespace-in-concat
...
Allow unquoted whitespace between substitutions that expand to objects/l...
2015-03-03 10:59:15 -05:00
Havoc Pennington
2874f9274b
Merge pull request #267 from typesafehub/resource-origins
...
Properly track resource file origins
2015-03-03 10:58:50 -05:00
Havoc Pennington
0783ad341a
Merge pull request #266 from typesafehub/sorted-rendering
...
Apply numeric sort to object keys when rendering
2015-03-03 10:58:32 -05:00
Havoc Pennington
d57b0c093d
Document double-to-int behavior, fixes #183
2015-03-02 16:38:19 -05:00
Havoc Pennington
2df7b6b419
Allow unquoted whitespace between substitutions that expand to objects/lists
...
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.
2015-03-02 16:11:51 -05:00
Havoc Pennington
a528bf104a
Properly track resource file origins
...
This improves error messages to fix #254 .
2015-03-02 15:26:49 -05:00
Havoc Pennington
988c3441aa
Apply numeric sort to object keys when rendering
...
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.
2015-03-02 11:31:32 -05:00
Havoc Pennington
55bd472c24
Improve ConfigBeanFactory docs in README
2015-03-02 11:03:38 -05:00
Havoc Pennington
c1a7ce0333
Mention ConfigBeanFactory in the README
2015-03-02 11:02:11 -05:00
Havoc Pennington
edd4f14c99
Merge pull request #264 from typesafehub/beanfactory
...
Add ConfigBeanFactory
2015-03-02 10:01:03 -05:00
Havoc Pennington
483f7a87f7
ConfigBeanImpl.java: split up too-long getValue method
2015-03-02 09:53:13 -05:00
Havoc Pennington
e522071442
toCamelCase doesn't need to be public anymore
2015-03-02 09:45:44 -05:00
Havoc Pennington
b692e988a6
ConfigBeanFactory: comprehensively list allowed types
...
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.
2015-03-02 09:45:39 -05:00
Havoc Pennington
26eec7be90
If a bean sees foo-bar and fooBar, prefer camel name
2015-03-02 09:45:32 -05:00
Havoc Pennington
4c9d5aae4f
Remove Byte and Short support from beans for now
...
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.
2015-03-02 09:45:26 -05:00
Havoc Pennington
82fcfe3f5a
ConfigBeanFactory: validate against bean's implied schema
...
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.
2015-03-02 09:45:20 -05:00
Havoc Pennington
11efe879e8
Move ConfigBeanFactory internals to impl.ConfigBeanImpl
...
This is because I want to make some changes that will use
impl-private API.
2015-03-02 09:45:13 -05:00
Havoc Pennington
49dcdcae20
Be sure we test putting hyphen names in bean props
2015-03-02 09:45:08 -05:00
Havoc Pennington
fe385cca06
Test that toCamelCase leaves already-camel-case stuff unchanged
2015-03-02 09:45:04 -05:00
Havoc Pennington
4aab07983f
Avoid ConfigException.Generic in ConfigBeanFactory
2015-03-02 09:45:00 -05:00
Havoc Pennington
7255941bfc
Tweak the ConfigBeanFactory javadoc a bit
2015-03-02 09:44:55 -05:00
Havoc Pennington
3681e5d427
Move ConfigBeanFactorTest and toCamelCase into the impl package
2015-03-02 09:44:47 -05:00
Havoc Pennington
7a74183190
Expand ConfigBeanFactory test coverage to all the primitive types.
2015-03-02 09:44:42 -05:00
Havoc Pennington
14dbe09199
Move to jacoco 2.1.6 which works with Java 8
2015-03-02 09:44:36 -05:00
Havoc Pennington
69f7b48130
Change ConfigBeanFactory to use ConfigMemorySize and java.time.Duration
2015-03-02 09:44:17 -05:00
Andrey Zaytsev
f1f198595a
Second cut at ConfigBeanFactory
...
This version predates ConfigMemorySize and java.time.Duration
support.
2015-03-02 09:43:31 -05:00
Ben McCann
d4a0255520
add first cut at BeanFactory
2015-03-02 09:41:46 -05:00
Havoc Pennington
b44eae9f11
Merge pull request #262 from typesafehub/windows-quoting
...
Properly quote filenames in tests, to attempt to fix Windows
2015-02-26 12:18:22 -05:00
Havoc Pennington
cb5eb350cc
Properly quote filenames in tests, to attempt to fix Windows
...
Reported by @Johnlon via PR #201
2015-02-26 12:12:18 -05:00
Havoc Pennington
191ca2657d
Merge pull request #261 from typesafehub/from-anyref-value
...
Support fromAnyRef(ConfigValue)
2015-02-26 09:43:05 -05:00
Havoc Pennington
db5e95c457
Fix ConfigMemorySizeTest.scala indentation
2015-02-26 09:17:41 -05:00
Havoc Pennington
749b28d6eb
Add docs and tests for fromAnyRef handling ConfigValue
2015-02-26 09:16:57 -05:00
verbeto
b81a45870d
Make fromAnyRef return a ConfigValue unmodified instead of throwing
2015-02-26 09:02:00 -05:00
Havoc Pennington
a73fe1f1e9
Merge pull request #257 from typesafehub/duration
...
Support java.time.Duration getters on Config
2015-02-26 08:55:48 -05:00
Havoc Pennington
0e722a10cd
Merge pull request #260 from typesafehub/newlines-in-description
...
In render, put comment char in front of every description line
2015-02-26 08:52:08 -05:00
Havoc Pennington
2028cff9f6
Merge pull request #258 from typesafehub/scalariform
...
Scalariform the tests, discovering a bug in the process
2015-02-26 08:51:57 -05:00
Havoc Pennington
dddcd0443a
Support java.time.Duration getters on Config
...
Also support fromAnyRef on a Duration
2015-02-26 08:51:34 -05:00
Havoc Pennington
cd634decc5
Merge pull request #256 from typesafehub/config-memory-size
...
add ConfigMemorySize and getters for it
2015-02-26 08:50:03 -05:00
Havoc Pennington
9c2daf8c0f
In render, put comment char in front of every description line
...
Fixes #239 that multiline descriptions created unparseable output.
2015-02-26 00:10:11 -05:00
Havoc Pennington
f1530e64c5
Add scalariform to the build, to format the Scala tests
2015-02-25 23:37:50 -05:00
Havoc Pennington
9348bf2132
Fix Path.render to avoid quoting elements starting with number char
...
This was supposed to be done earlier, but the test for it wasn't
actually being run - it looked like it was in a list due to
indentation, but in fact was not in the list. So Scalariform
revealed the bug.
2015-02-25 23:36:23 -05:00
Havoc Pennington
51f05d9927
Add since 1.3.0 tags to the new ConfigMemorySize methods
2015-02-25 21:25:31 -05:00
Havoc Pennington
97718593c6
Support ConfigMemorySize in fromAnyRef
...
We don't preserve its "memory-size-ness" but we can parse
it into a Long.
2015-02-25 21:01:09 -05:00
Havoc Pennington
2e43d9b21c
Add ConfigMemorySize.toString
2015-02-25 20:53:34 -05:00
Havoc Pennington
5a2b0b7380
Better format javadoc in ConfigMemorySize.java
2015-02-25 20:46:01 -05:00
Havoc Pennington
9d16f3bf61
Merge pull request #255 from typesafehub/java8
...
Switch to Java 8
2015-02-25 20:41:41 -05:00
Havoc Pennington
e72decad92
Use -source 1.6 for now, to avoid Java 8 syntactic sugar
...
We will still be able to use library types, but will keep
it a little easier to make a Java 7 branch this way.
2015-02-25 20:37:01 -05:00