0

生の xml 文字列を DTO.class にマッピングする際に問題があります。

DTO

@ToString
@NoArgsConstructor
@AllArgsConstructor
public class CountyResponse {
    private String name;
    private String engName;
    private String value;

    public CountyDTO toCountyDTO(String cityId) {
        return CountyDTO
                .builder()
                .name(name)
                .countyId(cityId + value)
                .build();
    }

}

生の xml 文字列の例を次に示します。

<name>exampleName</name><engName>exampleEngName</engName><value>exampleValue</value>

例外は、デフォルトのクリエーターが何もないことを示しています。

これは例外のメッセージの一部です。

Cannot construct instance of `..../.CountyResponse` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value...
4

0 に答える 0