Skip to content
Permalink
Browse files

Merge branch 'release/0.6.0'

* release/0.6.0:
  README: show version 0.6.0
  build as 0.6.0
  tune travis config
  git ignores
  gradle coordinates
  typos
  update a few dependencies to newer versions
  drop Java 6 Support.
  • Loading branch information...
bpsm committed Feb 11, 2019
2 parents b3660f8 + 624ffff commit c5dfdb77431da1aca3c257599b237a21575629b2
@@ -3,5 +3,8 @@ target
.project
.settings
.idea
edn-java.iml
hello/hello.iml
*.iml
*.ipr
*.iws
.project
.settings
@@ -1,6 +1,12 @@
sudo: false

language: java

jdk:
- oraclejdk8
- oraclejdk7
- openjdk7
- openjdk6

cache:
directories:
- $HOME/.m2
@@ -12,14 +12,18 @@ This is a Maven project with the following coordinates:
<dependency>
<groupId>us.bpsm</groupId>
<artifactId>edn-java</artifactId>
<version>0.5.0</version>
<version>0.6.0</version>
</dependency>
```

It is available through the OSS Sonatype Releases repository:

https://oss.sonatype.org/content/repositories/releases

or the Gradle coordinates:
```groovy
compile 'us.bpsm:edn-java:0.6.0'
```
## Parsing

You'll need to create a Parser and supply it with some input. Factory methods to create Parseable input are provided which accept either a `java.lang.CharSequence` or a `java.lang.Readable`. You can then call `nextValue()` on the Parser to get values form the input. When the input is exhausted, `nextValue()` will return `Parser.END_OF_INPUT`.
@@ -59,7 +63,7 @@ Most *edn* values map to regular Java types, except in such cases where Java doe

Integers map to, `Long` or `BigInteger` depending on the magnitude of the number. Appending `N` to an integer literal maps to `BigInteger` irrespective of the magnitude.

Floating point numbers with the suffix `M` are mapeped to `BigDecimal`. All others are mapped to `Double`.
Floating point numbers with the suffix `M` are mapped to `BigDecimal`. All others are mapped to `Double`.

Characters are mapped to `Character`, booleans to `Boolean` and strings to `String`. No great shock there, I trust.

@@ -130,7 +134,7 @@ The package `us.bpsm.edn.parser` makes three handlers for `#inst` available:

- `InstantToDate` is the default and converts each `#inst` to a `java.util.Date`.
- `InstantToCalendar` converts each `#inst` to a `java.util.Calendar`, which preserves the original GTM offset.
- `InstantToTimestamp` converts each `#inst` to a `java.sql.Timstamp`, which presrves nanoseconds.
- `InstantToTimestamp` converts each `#inst` to a `java.sql.Timstamp`, which preserves nanoseconds.

Extend `AbstractInstantHandler` to provide your own implementation of `#inst`.

@@ -356,5 +360,5 @@ public class CustomTagPrinter {
### Limitations

- Edn values must be *acyclic*. Any attempt to print a data structure containing cycles will surely end in a stack overflow.
- The current Printing support stikes me a as a bit of a hack. The API may change with 1.0.0.
- The current Printing support strikes me a as a bit of a hack. The API may change with 1.0.0.
- Edn-Java does not provide much by way of "convenience" methods. As a library it's still to young to really know what would be convenient, though I'm open to suggestions.
16 pom.xml
@@ -8,7 +8,7 @@
</parent>
<groupId>us.bpsm</groupId>
<artifactId>edn-java</artifactId>
<version>0.5.0</version>
<version>0.6.0</version>
<packaging>jar</packaging>
<name>EDN Java</name>
<description>
@@ -48,7 +48,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -63,16 +63,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<version>3.6.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
@@ -86,7 +86,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.1</version>
<version>2.10.4</version>
<configuration>
<show>protected</show>
<nohelp>true</nohelp>
@@ -128,7 +128,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.1</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
@@ -2,7 +2,7 @@
package us.bpsm.edn.parser;

/**
* A Handler for {@code #inst} which translates the intant into a
* A Handler for {@code #inst} which translates the instant into a
* {@link java.util.Calendar}.
*/
public class InstantToCalendar extends AbstractInstantHandler {
@@ -2,7 +2,7 @@
package us.bpsm.edn.parser;

/**
* A Handler for {@code #inst} which translates the intant into a
* A Handler for {@code #inst} which translates the instant into a
* {@link java.util.Date}.
*/
public final class InstantToDate extends AbstractInstantHandler {
@@ -66,7 +66,7 @@ static ParsedInstant parse(String value) {
assert 0 <= nanoseconds && nanoseconds <= 999999999:
"nanoseconds are assured to be in [0..999999999] by INSTANT Pattern";
assert -1 <= offsetSign && offsetSign <= 1:
"parser assuers offsetSign is -1, 0 or 1.";
"parser assures offsetSign is -1, 0 or 1.";
if (offsetHours < 0 || 23 < offsetHours) {
throw new EdnSyntaxException(
String.format("'%02d' is not a valid offset hour in '%s'",
@@ -12,7 +12,7 @@
public Object transform(Tag tag, Object value) {
if (!(value instanceof String)) {
throw new EdnSyntaxException(tag.toString() +
" expectes a String.");
" expects a String.");
}
return UUID.fromString((String) value);
}
@@ -23,8 +23,8 @@
*
* @return The linearization of c: never null and never empty.
*
* @throws EdnException if the inheritance hiearchy of {@code c}
* makes it impossible to compuate a consistent hierarchy
* @throws EdnException if the inheritance hierarchy of {@code c}
* makes it impossible to compute a consistent hierarchy
* for {@code c}.
*/
static List<Class<?>> methodResolutionOrder(Class<?> c) {

0 comments on commit c5dfdb7

Please sign in to comment.
You can’t perform that action at this time.