BAEL-2237 Using Jackson to parse XML and return JSON (#5401)

This commit is contained in:
Felipe Santiago Corro
2018-10-08 03:36:38 -03:00
committed by maibin
parent acf37e52ef
commit f046857975
4 changed files with 104 additions and 1 deletions
@@ -0,0 +1,5 @@
package com.baeldung.jackson.xmlToJson;
public enum Color {
PINK, BLUE, YELLOW, RED;
}
@@ -0,0 +1,42 @@
package com.baeldung.jackson.xmlToJson;
public class Flower {
private String name;
private Color color;
private Integer petals;
public Flower() { }
public Flower(String name, Color color, Integer petals) {
this.name = name;
this.color = color;
this.petals = petals;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Color getColor() {
return color;
}
public void setColor(Color color) {
this.color = color;
}
public Integer getPetals() {
return petals;
}
public void setPetals(Integer petals) {
this.petals = petals;
}
}