BAEL-2237 Using Jackson to parse XML and return JSON (#5401)
This commit is contained in:
committed by
maibin
parent
acf37e52ef
commit
f046857975
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user