You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I am using gwt-jackson. Parsing an object like {"name":"VALUE"} I get an error "Error at line 1 and column 2 of input <{"name": "AUSTRIA"}>.
I am trying to parse it into enum object like:
public enum Countries {
AUSTRIA(2, 2, 1, 1, 1, 1),
......
@JsonProperty(value = "name")
private String name;
public CountryRegions getName(){return valueOf(name);}
public void setName(String name){this.name = name;}
}
Here is the mapper: public interface CountryMapper extends ObjectMapper<Countries>{}
Mapper creation: CountryMapper mapper = GWT.create(CountryMapper.class);
and Countries country = mapper.read("{\"name\": \"AUSTRIA\"}");
I have tried without property, getter and setter in the enum - this also didn't help. The only way to parse it is to create a proxy model with string property and first parse json to that model.
I suppose the issue is in the enum.
What would be your suggestion? What do I do wrong?
The text was updated successfully, but these errors were encountered:
Hello. I am using gwt-jackson. Parsing an object like
{"name":"VALUE"}
I get an error "Error at line 1 and column 2 of input <{"name": "AUSTRIA"}>.I am trying to parse it into enum object like:
Here is the mapper:
public interface CountryMapper extends ObjectMapper<Countries>{}
Mapper creation:
CountryMapper mapper = GWT.create(CountryMapper.class);
and
Countries country = mapper.read("{\"name\": \"AUSTRIA\"}");
I have tried without property, getter and setter in the enum - this also didn't help. The only way to parse it is to create a proxy model with string property and first parse json to that model.
I suppose the issue is in the enum.
What would be your suggestion? What do I do wrong?
The text was updated successfully, but these errors were encountered: