MCPcopy Create free account
hub / github.com/apache/solr / reflectWrite

Method reflectWrite

solr/solrj/src/java/org/apache/solr/common/util/Utils.java:815–826  ·  view source on GitHub ↗

Convert the input object to a map, writing only those fields annotated with a JsonProperty annotation @param ew an org.apache.solr.common.MapWriter.EntryWriter to do the actual map insertion/writing @param o the object to be converted

(MapWriter.EntryWriter ew, Object o)

Source from the content-addressed store, hash-verified

813 Object o,
814 Predicate<Field> fieldFilterer,
815 Class<? extends Annotation> catchAllAnnotation,
816 Function<Field, String> fieldNamer) {
817 List<FieldWriter> fieldWriters = null;
818 try {
819 fieldWriters = getReflectData(o.getClass(), fieldFilterer, catchAllAnnotation, fieldNamer);
820 } catch (IllegalAccessException e) {
821 throw new RuntimeException(e);
822 }
823 reflectWrite(ew, o, fieldWriters);
824 }
825
826 private static List<FieldWriter> getReflectData(
827 Class<?> c,
828 Predicate<Field> fieldFilterer,
829 Class<? extends Annotation> catchAllAnnotation,

Callers 2

writeMapMethod · 0.95

Calls 5

getReflectDataMethod · 0.95
getNameMethod · 0.65
writeMethod · 0.65
isEmptyMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected