for(java.lang.reflect.Field field : fields){
if(isEntity(field)){
mapEntity(xContentBuilder, field.getType(), false, EMPTY, field.getName());
}
Field fieldAnnotation = field.getAnnotation(Field.class);
if(isRootObject && fieldAnnotation != null && isIdField(field, idFieldName)){
applyDefaultIdFieldMapping(xContentBuilder, field);
}else if(fieldAnnotation != null){
applyFieldAnnotationMapping(xContentBuilder, field, fieldAnnotation);
}