Я получаю сообщение об ошибке при попытке заполнить поля списка объектов с помощью ObjectMapper
public class FormMap {
private String id;
private String strengthRouteFormId;
private String fdaid;
private String formName;
private String formDescription;
private String ncitQuantityUnitTermId;
private String ncitStrengthFormTermId;
private String ncitId;
private String ncitSubsetCode;
private String ncpdpSubsetPreferredTerm;
private String ncitCode;
private String ncpdpPreferredTerm;
private String ncitPreferredTerm;
private String ncitDefinition;
private StrengthRouteForm strengthRouteForm;
}
public class StrengthRouteForm {
private String id;
private String medicationId;
private String strength;
private String routeName;
private String gsForm;
private String alternativeFormName;
private String clinicalDoseFormName;
private String normalizedFormName;
private String topLevelDoseFormName;
private List<FormMap> formMaps;
}
У меня есть 2 класса, и я хочу создать список StrengthRouteForm, используя ObjectMapper и Json
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
List<StrengthRouteForm> strengthRouteForms = null;
strengthRouteForms = Arrays.asList(objectMapper.readValue("string json", StrengthRouteForm[].class));
и я получаю эту ошибку:
Unrecognized field "FormMap" (class com.cgm.us.ais.core.model.StrengthRouteForm), not marked as ignorable
JSON может выглядеть так:
"StrengthRouteForm": [
{
"Strength": "0.25",
"RouteName": "Oral",
"GSForm": "Oral tablet",
"AlternativeFormName": "Oral Solid",
"ClinicalDoseFormName": "Oral tablet",
"NormalizedFormName": "Oral tablet",
"TopLevelDoseFormName": "Oral preparations - solid forms",
"FormMap": [
{
"FDAID": "500",
"FormName": "Tab",
"FormDescription": "Tablet",
"NCItQuantityUnitTermID": "106",
"NCItStrengthFormTermID": "447",
"NCItId": "106",
"NCItSubsetCode": "C89510",
"NCPDPSubsetPreferredTerm": "NCPDP QuantityUnitOfMeasure Terminology",
"NCItCode": "C48542",
"NCPDPPreferredTerm": "Tablet",
"NCItPreferredTerm": "Tablet Dosing Unit",
"NCItDefinition": "A dosing unit equal to the amount of active ingredient(s) contained in a tablet."
},
{
"FDAID": "500",
"FormName": "Tab",
"FormDescription": "Tablet",
"NCItQuantityUnitTermID": "106",
"NCItStrengthFormTermID": "447",
"NCItId": "447",
"NCItSubsetCode": "C89508",
"NCPDPSubsetPreferredTerm": "NCPDP StrengthForm Terminology",
"NCItCode": "C42998",
"NCPDPPreferredTerm": "Tablet",
"NCItPreferredTerm": "Tablet Dosage Form",
"NCItDefinition": "A solid composed of a mixture of that active and/or inert ingredient(s) are pressed or compacted together, usually in the form of a relatively flat and round, square or oval shape."
}
]
}
]
Мой вопрос: как мне составить этот список: FormMaps для сопоставления FormMap из JSON