Skip to content

Commit 9220584

Browse files
committed
Add video tutorial module and Jackson annotation code
1 parent 7a4d666 commit 9220584

90 files changed

Lines changed: 4341 additions & 4 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎pom.xml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<module>algorithms</module>
1919
<module>annotations</module>
2020
<module>apache-cxf</module>
21-
<module>apache-fop</module>
22-
<module>apache-poi</module>
21+
<module>apache-fop</module>
22+
<module>apache-poi</module>
2323
<module>aspectj</module>
2424
<module>assertj</module>
2525
<module>autovalue</module>
@@ -122,7 +122,7 @@
122122
<module>spring-hibernate3</module>
123123
<module>spring-hibernate4</module>
124124
<module>spring-integration</module>
125-
<module>spring-jersey</module>
125+
<module>spring-jersey</module>
126126
<module>spring-jms</module>
127127
<module>spring-jooq</module>
128128
<module>spring-jpa</module>
@@ -176,12 +176,14 @@
176176

177177
<module>testing</module>
178178

179+
<module>video-tutorials</module>
180+
179181
<module>wicket</module>
180182

181183
<module>xml</module>
182184
<module>xmlunit2</module>
183185
<module>xstream</module>
184-
<module>java-mongodb</module>
186+
185187
<module>struts2</module>
186188
</modules>
187189

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.baeldung</groupId>
5+
<artifactId>jackson-annotations</artifactId>
6+
<version>1.0.0-SNAPSHOT</version>
7+
8+
<packaging>war</packaging>
9+
<name>jacksonannotation</name>
10+
<url>http://www.baeldung.com</url>
11+
12+
<parent>
13+
<groupId>com.baeldung</groupId>
14+
<artifactId>video-tutorials</artifactId>
15+
<version>1.0.0-SNAPSHOT</version>
16+
</parent>
17+
18+
<dependencies>
19+
20+
<!-- utils -->
21+
<dependency>
22+
<groupId>com.google.guava</groupId>
23+
<artifactId>guava</artifactId>
24+
<version>${guava.version}</version>
25+
</dependency>
26+
27+
<dependency>
28+
<groupId>commons-io</groupId>
29+
<artifactId>commons-io</artifactId>
30+
<version>${commons-io.version}</version>
31+
</dependency>
32+
33+
<!--jackson for xml-->
34+
<dependency>
35+
<groupId>com.fasterxml.jackson.dataformat</groupId>
36+
<artifactId>jackson-dataformat-xml</artifactId>
37+
<version>${jackson.version}</version>
38+
</dependency>
39+
40+
<dependency>
41+
<groupId>org.apache.commons</groupId>
42+
<artifactId>commons-collections4</artifactId>
43+
<version>${commons-collections4.version}</version>
44+
</dependency>
45+
46+
<dependency>
47+
<groupId>org.apache.commons</groupId>
48+
<artifactId>commons-lang3</artifactId>
49+
<version>${commons-lang3.version}</version>
50+
</dependency>
51+
52+
<!-- web -->
53+
54+
<!-- marshalling -->
55+
56+
<dependency>
57+
<groupId>com.fasterxml.jackson.core</groupId>
58+
<artifactId>jackson-databind</artifactId>
59+
<version>${jackson.version}</version>
60+
</dependency>
61+
62+
<dependency>
63+
<groupId>com.fasterxml.jackson.datatype</groupId>
64+
<artifactId>jackson-datatype-jsr310</artifactId>
65+
<version>${jackson.version}</version>
66+
</dependency>
67+
68+
<dependency>
69+
<groupId>com.fasterxml.jackson.datatype</groupId>
70+
<artifactId>jackson-datatype-joda</artifactId>
71+
<version>${jackson.version}</version>
72+
</dependency>
73+
74+
<dependency>
75+
<groupId>com.fasterxml.jackson.module</groupId>
76+
<artifactId>jackson-module-jsonSchema</artifactId>
77+
<version>${jackson.version}</version>
78+
</dependency>
79+
80+
<dependency>
81+
<groupId>joda-time</groupId>
82+
<artifactId>joda-time</artifactId>
83+
<version>${joda-time.version}</version>
84+
</dependency>
85+
86+
<dependency>
87+
<groupId>com.google.code.gson</groupId>
88+
<artifactId>gson</artifactId>
89+
<version>${gson.version}</version>
90+
</dependency>
91+
92+
<!-- test scoped -->
93+
<dependency>
94+
<groupId>io.rest-assured</groupId>
95+
<artifactId>rest-assured</artifactId>
96+
<version>3.0.1</version>
97+
<scope>test</scope>
98+
</dependency>
99+
100+
<!-- https://mvnrepository.com/artifact/io.rest-assured/json-schema-validator -->
101+
<dependency>
102+
<groupId>io.rest-assured</groupId>
103+
<artifactId>json-schema-validator</artifactId>
104+
<version>3.0.0</version>
105+
<scope>test</scope>
106+
</dependency>
107+
108+
<dependency>
109+
<groupId>io.rest-assured</groupId>
110+
<artifactId>json-path</artifactId>
111+
<version>${json-path.version}</version>
112+
<scope>test</scope>
113+
</dependency>
114+
115+
<dependency>
116+
<groupId>com.github.fge</groupId>
117+
<artifactId>json-schema-validator</artifactId>
118+
<version>${json-schema-validator.version}</version>
119+
<scope>test</scope>
120+
</dependency>
121+
122+
<dependency>
123+
<groupId>junit</groupId>
124+
<artifactId>junit</artifactId>
125+
<version>${junit.version}</version>
126+
<scope>test</scope>
127+
</dependency>
128+
129+
<dependency>
130+
<groupId>org.assertj</groupId>
131+
<artifactId>assertj-core</artifactId>
132+
<version>${assertj-core.version}</version>
133+
<scope>test</scope>
134+
</dependency>
135+
136+
<!-- logging -->
137+
<dependency>
138+
<groupId>ch.qos.logback</groupId>
139+
<artifactId>logback-classic</artifactId>
140+
<version>${logback.version}</version>
141+
<!-- <scope>runtime</scope> -->
142+
</dependency>
143+
144+
<dependency>
145+
<groupId>org.slf4j</groupId>
146+
<artifactId>slf4j-api</artifactId>
147+
<version>${org.slf4j.version}</version>
148+
</dependency>
149+
150+
<dependency>
151+
<groupId>org.slf4j</groupId>
152+
<artifactId>jcl-over-slf4j</artifactId>
153+
<version>${org.slf4j.version}</version>
154+
</dependency>
155+
156+
<dependency>
157+
<groupId>org.slf4j</groupId>
158+
<artifactId>log4j-over-slf4j</artifactId>
159+
<version>${org.slf4j.version}</version>
160+
</dependency>
161+
162+
</dependencies>
163+
164+
<build>
165+
<finalName>jackson-annotations</finalName>
166+
<resources>
167+
<resource>
168+
<directory>src/main/resources</directory>
169+
<filtering>true</filtering>
170+
</resource>
171+
</resources>
172+
173+
<plugins>
174+
<plugin>
175+
<groupId>org.apache.maven.plugins</groupId>
176+
<artifactId>maven-compiler-plugin</artifactId>
177+
<version>${maven-compiler-plugin.version}</version>
178+
<configuration>
179+
<source>${maven-compiler-plugin.source}</source>
180+
<target>${maven-compiler-plugin.source}</target>
181+
</configuration>
182+
</plugin>
183+
184+
<plugin>
185+
<groupId>org.apache.maven.plugins</groupId>
186+
<artifactId>maven-surefire-plugin</artifactId>
187+
<version>${maven-surefire-plugin.version}</version>
188+
</plugin>
189+
190+
</plugins>
191+
192+
</build>
193+
194+
<properties>
195+
196+
<!-- persistence -->
197+
<hibernate.version>4.3.11.Final</hibernate.version>
198+
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
199+
200+
<!-- marshalling -->
201+
<jackson.version>2.8.5</jackson.version>
202+
203+
<!-- logging -->
204+
<org.slf4j.version>1.7.21</org.slf4j.version>
205+
<logback.version>1.1.7</logback.version>
206+
207+
<!-- various -->
208+
<hibernate-validator.version>5.1.3.Final</hibernate-validator.version>
209+
<joda-time.version>2.9.6</joda-time.version>
210+
<gson.version>2.8.0</gson.version>
211+
<commons-collections4.version>4.1</commons-collections4.version>
212+
213+
<!-- util -->
214+
<guava.version>20.0</guava.version>
215+
<commons-lang3.version>3.5</commons-lang3.version>
216+
<commons-io.version>2.5</commons-io.version>
217+
218+
<!-- testing -->
219+
<org.hamcrest.version>1.3</org.hamcrest.version>
220+
<junit.version>4.12</junit.version>
221+
<mockito.version>2.2.26</mockito.version>
222+
223+
<httpcore.version>4.4.1</httpcore.version>
224+
<httpclient.version>4.5</httpclient.version>
225+
226+
<rest-assured.version>2.9.0</rest-assured.version>
227+
228+
<assertj-core.version>3.6.1</assertj-core.version>
229+
<json-schema-validator.version>2.2.6</json-schema-validator.version>
230+
<json-path.version>3.0.1</json-path.version>
231+
232+
<!-- maven plugins -->
233+
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
234+
<maven-war-plugin.version>2.6</maven-war-plugin.version>
235+
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
236+
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
237+
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
238+
239+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
240+
<maven-compiler-plugin.source>1.8</maven-compiler-plugin.source>
241+
242+
</properties>
243+
244+
</project>
245+
246+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.baeldung.jacksonannotation.deserialization.jacksoninject;
2+
3+
import com.baeldung.jacksonannotation.domain.Item;
4+
5+
import java.util.ArrayList;
6+
import java.util.List;
7+
8+
/**
9+
* Source code github.com/eugenp/tutorials
10+
*
11+
* @author Alex Theedom www.baeldung.com
12+
* @version 1.0
13+
*/
14+
public class Author extends Person {
15+
16+
List<Item> items = new ArrayList<>();
17+
18+
public Author(){
19+
super();
20+
}
21+
public Author(String firstName, String lastName) {
22+
super(firstName, lastName);
23+
}
24+
25+
public List<Item> getItems() {
26+
return items;
27+
}
28+
29+
public void setItems(List<Item> items) {
30+
this.items = items;
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.baeldung.jacksonannotation.deserialization.jacksoninject;
2+
3+
import com.fasterxml.jackson.annotation.JacksonInject;
4+
5+
import java.util.UUID;
6+
7+
/**
8+
* Source code github.com/eugenp/tutorials
9+
*
10+
* @author Alex Theedom www.baeldung.com
11+
* @version 1.0
12+
*/
13+
public class Person {
14+
15+
@JacksonInject
16+
private UUID id;
17+
private String firstName;
18+
private String lastName;
19+
20+
public Person(){
21+
22+
}
23+
24+
public Person(String firstName, String lastName) {
25+
this.id = UUID.randomUUID();
26+
this.firstName = firstName;
27+
this.lastName = lastName;
28+
}
29+
30+
public String getFirstName() {
31+
return firstName;
32+
}
33+
34+
public void setFirstName(String firstName) {
35+
this.firstName = firstName;
36+
}
37+
38+
public String getLastName() {
39+
return lastName;
40+
}
41+
42+
public void setLastName(String lastName) {
43+
this.lastName = lastName;
44+
}
45+
46+
public UUID getId() {
47+
return id;
48+
}
49+
}

0 commit comments

Comments
 (0)