File tree 3 files changed +31
-3
lines changed
main/java/de/agilecoders/wicket/jquery/util/serializer
test/java/de/agilecoders/wicket/jquery
3 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 20
20
<mvn .build.java.version>${java.version} </mvn .build.java.version>
21
21
<mvn .version>3.0.0</mvn .version>
22
22
23
- <com .fasterxml.jackson.version>2.3.0 </com .fasterxml.jackson.version>
23
+ <com .fasterxml.jackson.version>2.6.0-SNAPSHOT </com .fasterxml.jackson.version>
24
24
<junit .version>4.12</junit .version>
25
25
<hamcrest .version>1.3</hamcrest .version>
26
26
<maven-bundle-plugin .version>2.5.2</maven-bundle-plugin .version>
166
166
</plugins >
167
167
</build >
168
168
169
+ <repositories >
170
+ <repository >
171
+ <id >Sonatype OSS snapshots</id >
172
+ <url >https://oss.sonatype.org/content/repositories/snapshots/</url >
173
+ <releases ><enabled >false</enabled ></releases >
174
+ <snapshots ><enabled >true</enabled ></snapshots >
175
+ </repository >
176
+ </repositories >
169
177
</project >
Original file line number Diff line number Diff line change 3
3
import com .fasterxml .jackson .core .JsonGenerator ;
4
4
import com .fasterxml .jackson .databind .JsonSerializer ;
5
5
import com .fasterxml .jackson .databind .SerializerProvider ;
6
+ import com .fasterxml .jackson .databind .util .RawValue ;
6
7
import de .agilecoders .wicket .jquery .util .Json ;
7
8
8
9
import java .io .IOException ;
15
16
public class RawSerializer extends JsonSerializer <Json .RawValue > {
16
17
@ Override
17
18
public void serialize (Json .RawValue value , JsonGenerator jsonGenerator , SerializerProvider provider ) throws IOException {
18
- jsonGenerator .writeObject (value .value ());
19
+ jsonGenerator .writeObject (new RV (value .value ()));
20
+ }
21
+
22
+ /**
23
+ * An extension of com.fasterxml.jackson.databind.util.RawValue that delegates
24
+ * toString() to the rawValue
25
+ */
26
+ private static class RV extends RawValue {
27
+
28
+ public RV (String v ) {
29
+ super (v );
30
+ }
31
+
32
+ @ Override
33
+ public String toString () {
34
+ return rawValue ().toString ();
35
+ }
19
36
}
20
37
}
Original file line number Diff line number Diff line change 6
6
import org .junit .Test ;
7
7
8
8
import static de .agilecoders .wicket .jquery .JQuery .$ ;
9
- import static org .hamcrest .CoreMatchers .*;
9
+ import static org .hamcrest .CoreMatchers .containsString ;
10
+ import static org .hamcrest .CoreMatchers .endsWith ;
11
+ import static org .hamcrest .CoreMatchers .is ;
12
+ import static org .hamcrest .CoreMatchers .startsWith ;
10
13
11
14
/**
12
15
* Tests for serializing AbstractConfig to JSON
You can’t perform that action at this time.
0 commit comments