Browse Source

Updated docs.

pull/56/head
Kalle Stenflo 10 years ago
parent
commit
3c278552fc
  1. 9
      README.md

9
README.md

@ -5,7 +5,7 @@ Jayway JsonPath (1.0.0)
[![Build Status](https://travis-ci.org/jayway/JsonPath.svg?branch=master)](https://travis-ci.org/jayway/JsonPath) [![Build Status](https://travis-ci.org/jayway/JsonPath.svg?branch=master)](https://travis-ci.org/jayway/JsonPath)
Jayway JsonPath is a Java port of [Stefan Goessner JSONPath implementation](http://goessner.net/articles/JsonPath/). JsonPath expressions always refer to a JSON structure in the same way as XPath expression are used in combination Jayway JsonPath is a Java port of [Stefan Goessner JsonPath implementation](http://goessner.net/articles/JsonPath/). JsonPath expressions always refer to a JSON structure in the same way as XPath expression are used in combination
with an XML document. The "root member object" in JsonPath is always referred to as `$` regardless if it is an with an XML document. The "root member object" in JsonPath is always referred to as `$` regardless if it is an
object or array. object or array.
@ -145,7 +145,7 @@ String author2 = JsonPath.read(document, compiledPath);
What is Returned When? What is Returned When?
---------------------- ----------------------
When using JsonPath in java its important to know what type you expect in your result. Json path will automatically When using JsonPath in java its important to know what type you expect in your result. JsonPath will automatically
try to cast the result to the type expected by the invoker. try to cast the result to the type expected by the invoker.
```java ```java
@ -165,9 +165,8 @@ When evaluating a path you need to understand the concept of when a path is `def
`Indefinite` paths always returns a list. `Indefinite` paths always returns a list.
By default some simple object mapping is provided by the MappingProvider SPI. This allows to specify the return type you want and the MappingProvider will By default a simple object mapper is provided by the MappingProvider SPI. This allows you to specify the return type you want and the MappingProvider will
try to perform the mapping. If a book, in the sample json above, had a long value 'published' you could perform object mapping between `Long` and `Date` try to perform the mapping. In the example below mapping between `Long` and `Date` is demonstrated.
as shown below.
```java ```java
String json = "{\"date_as_long\" : 1411455611975}"; String json = "{\"date_as_long\" : 1411455611975}";

Loading…
Cancel
Save