forked from eugenp/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BAEL-19675] - Move articles out of jackson part 2
- Loading branch information
1 parent
5df99fa
commit 1a63ca1
Showing
119 changed files
with
1,087 additions
and
469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## Jackson Conversions | ||
|
||
This module contains articles about Jackson conversions. | ||
|
||
### Relevant Articles: | ||
- [Mapping a Dynamic JSON Object with Jackson](https://www.baeldung.com/jackson-mapping-dynamic-object) | ||
- [Jackson Unmarshalling JSON with Unknown Properties](https://www.baeldung.com/jackson-deserialize-json-unknown-properties) | ||
- [Ignore Null Fields with Jackson](https://www.baeldung.com/jackson-ignore-null-fields) | ||
- [Mapping Multiple JSON Fields to a Single Java Field](https://www.baeldung.com/json-multiple-fields-single-java-field) | ||
- [Convert XML to JSON Using Jackson](https://www.baeldung.com/jackson-convert-xml-json) | ||
- [Converting JSON to CSV in Java](https://www.baeldung.com/java-converting-json-to-csv) | ||
- [How to Process YAML with Jackson](https://www.baeldung.com/jackson-yaml) | ||
- [Jackson Streaming API](https://www.baeldung.com/jackson-streaming-api) | ||
- More articles: [[<-- prev]](../jackson-conversions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>jackson-conversions-2</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<name>jackson-conversions-2</name> | ||
|
||
<parent> | ||
<groupId>com.baeldung</groupId> | ||
<artifactId>parent-java</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<relativePath>../parent-java</relativePath> | ||
</parent> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
<version>${jackson.version}</version> | ||
</dependency> | ||
<!--jackson for xml --> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.dataformat</groupId> | ||
<artifactId>jackson-dataformat-xml</artifactId> | ||
<version>${jackson.version}</version> | ||
</dependency> | ||
<!-- YAML --> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.dataformat</groupId> | ||
<artifactId>jackson-dataformat-yaml</artifactId> | ||
<version>${jackson.version}</version> | ||
</dependency> | ||
<!-- Allow use of LocalDate --> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.datatype</groupId> | ||
<artifactId>jackson-datatype-jsr310</artifactId> | ||
<version>2.9.8</version> | ||
</dependency> | ||
<!-- CSV --> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.dataformat</groupId> | ||
<artifactId>jackson-dataformat-csv</artifactId> | ||
<version>${jackson.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<version>${assertj.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>jackson-conversions-2</finalName> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
</build> | ||
|
||
<properties> | ||
<assertj.version>3.11.0</assertj.version> | ||
</properties> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../baeldung/jackson/entities/OrderLine.java → ...a/com/baeldung/jackson/csv/OrderLine.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.baeldung.jackson.entities; | ||
package com.baeldung.jackson.csv; | ||
|
||
import java.math.BigDecimal; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...eldung/jackson/mixin/OrderLineForCsv.java → ...baeldung/jackson/csv/OrderLineForCsv.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.baeldung.jackson.mixin; | ||
package com.baeldung.jackson.csv; | ||
|
||
import java.math.BigDecimal; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...eserialization/dynamicobject/Product.java → ...eldung/jackson/dynamicobject/Product.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...zation/dynamicobject/ProductJsonNode.java → ...ackson/dynamicobject/ProductJsonNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rialization/dynamicobject/ProductMap.java → ...ung/jackson/dynamicobject/ProductMap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...om/baeldung/jackson/entities/Weather.java → ...ldung/jackson/multiplefields/Weather.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
jackson-conversions-2/src/main/java/com/baeldung/jackson/unknownproperties/MyDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.baeldung.jackson.unknownproperties; | ||
|
||
public class MyDto { | ||
|
||
private String stringValue; | ||
private int intValue; | ||
private boolean booleanValue; | ||
|
||
public MyDto() { | ||
super(); | ||
} | ||
|
||
public MyDto(final String stringValue, final int intValue, final boolean booleanValue) { | ||
super(); | ||
|
||
this.stringValue = stringValue; | ||
this.intValue = intValue; | ||
this.booleanValue = booleanValue; | ||
} | ||
|
||
// API | ||
|
||
public String getStringValue() { | ||
return stringValue; | ||
} | ||
|
||
public void setStringValue(final String stringValue) { | ||
this.stringValue = stringValue; | ||
} | ||
|
||
public int getIntValue() { | ||
return intValue; | ||
} | ||
|
||
public void setIntValue(final int intValue) { | ||
this.intValue = intValue; | ||
} | ||
|
||
public boolean isBooleanValue() { | ||
return booleanValue; | ||
} | ||
|
||
public void setBooleanValue(final boolean booleanValue) { | ||
this.booleanValue = booleanValue; | ||
} | ||
|
||
// | ||
|
||
@Override | ||
public String toString() { | ||
return "MyDto [stringValue=" + stringValue + ", intValue=" + intValue + ", booleanValue=" + booleanValue + "]"; | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
.../jackson/dtos/ignore/MyDtoIgnoreType.java → ...on/unknownproperties/MyDtoIgnoreType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ckson/dtos/ignore/MyDtoIgnoreUnknown.java → ...unknownproperties/MyDtoIgnoreUnknown.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../com/baeldung/jackson/entities/Order.java → ...java/com/baeldung/jackson/yaml/Order.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
jackson-conversions-2/src/main/java/com/baeldung/jackson/yaml/OrderLine.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.baeldung.jackson.yaml; | ||
|
||
import java.math.BigDecimal; | ||
|
||
public class OrderLine { | ||
private String item; | ||
private int quantity; | ||
private BigDecimal unitPrice; | ||
|
||
public OrderLine() { | ||
|
||
} | ||
|
||
public OrderLine(String item, int quantity, BigDecimal unitPrice) { | ||
super(); | ||
this.item = item; | ||
this.quantity = quantity; | ||
this.unitPrice = unitPrice; | ||
} | ||
|
||
public String getItem() { | ||
return item; | ||
} | ||
|
||
public void setItem(String item) { | ||
this.item = item; | ||
} | ||
|
||
public int getQuantity() { | ||
return quantity; | ||
} | ||
|
||
public void setQuantity(int quantity) { | ||
this.quantity = quantity; | ||
} | ||
|
||
public BigDecimal getUnitPrice() { | ||
return unitPrice; | ||
} | ||
|
||
public void setUnitPrice(BigDecimal unitPrice) { | ||
this.unitPrice = unitPrice; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "OrderLine [item=" + item + ", quantity=" + quantity + ", unitPrice=" + unitPrice + "]"; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.