}
return null;
}
private FieldDescriptor getField(String entityType, List<String> propertyPath) {
Descriptor messageDescriptor;
try {
messageDescriptor = serializationContext.getMessageDescriptor(entityType);
} catch (Exception e) {
throw new IllegalStateException("Unknown entity name " + entityType);
}
int i = 0;
for (String p : propertyPath) {
FieldDescriptor field = messageDescriptor.findFieldByName(p);
if (field == null || ++i == propertyPath.size()) {
return field;
}
if (field.getJavaType() == JavaType.MESSAGE) {
messageDescriptor = field.getMessageType();