@Override public String nameForField(MapperConfig<?> config, AnnotatedField field, String defaultName) { if (field.getDeclaringClass().isAnnotationPresent(JsonSnakeCase.class)) { return snakeCase.nameForField(config, field, defaultName); } return super.nameForField(config, field, defaultName); }
@Override public AnnotatedField getField() { if (_fields == null) { return null; } // If multiple, verify that they do not conflict... AnnotatedField field = _fields.value; Linked<AnnotatedField> next = _fields.next; for (; next != null; next = next.next) { AnnotatedField nextField = next.value; Class<?> fieldClass = field.getDeclaringClass(); Class<?> nextClass = nextField.getDeclaringClass(); if (fieldClass != nextClass) { if (fieldClass.isAssignableFrom(nextClass)) { // next is more specific field = nextField; continue; } if (nextClass.isAssignableFrom(fieldClass)) { // getter more specific continue; } } throw new IllegalArgumentException("Multiple fields representing property \""+getName()+"\": " +field.getFullName()+" vs "+nextField.getFullName()); } return field; }
public String getFullName() { return getDeclaringClass().getName() + "#" + getName(); }
public String getFullName() { return getDeclaringClass().getName() + "#" + getName(); }
public String getFullName() { return getDeclaringClass().getName() + "#" + getName(); }
public String getFullName() { return getDeclaringClass().getName() + "#" + getName(); }
public String getFullName() { return getDeclaringClass().getName() + "#" + getName(); }
@Override public String nameForField(MapperConfig<?> config, AnnotatedField field, String defaultName) { if (field.getDeclaringClass().isAnnotationPresent(JsonSnakeCase.class)) { return snakeCase.nameForField(config, field, defaultName); } return super.nameForField(config, field, defaultName); }
@Override public String nameForField(MapperConfig<?> config, AnnotatedField field, String defaultName) { if (field.getDeclaringClass() == this.effectiveType) { return fieldToJsonMapping .getOrDefault(defaultName, super.nameForField(config, field, defaultName)); } else { return super.nameForField(config, field, defaultName); } }
@Override public String nameForField(MapperConfig<?> config, AnnotatedField field, String defaultName) { if (field.getDeclaringClass().isAnnotationPresent(JsonSnakeCase.class)) { return snakeCase.nameForField(config, field, defaultName); } return super.nameForField(config, field, defaultName); }
@Override public AnnotatedField getField() { if (_fields == null) { return null; } // If multiple, verify that they do not conflict... AnnotatedField field = _fields.value; Linked<AnnotatedField> next = _fields.next; for (; next != null; next = next.next) { AnnotatedField nextField = next.value; Class<?> fieldClass = field.getDeclaringClass(); Class<?> nextClass = nextField.getDeclaringClass(); if (fieldClass != nextClass) { if (fieldClass.isAssignableFrom(nextClass)) { // next is more specific field = nextField; continue; } if (nextClass.isAssignableFrom(fieldClass)) { // getter more specific continue; } } throw new IllegalArgumentException("Multiple fields representing property \""+getName()+"\": " +field.getFullName()+" vs "+nextField.getFullName()); } return field; }
@Override public AnnotatedField getField() { if (_fields == null) { return null; } // If multiple, verify that they do not conflict... AnnotatedField field = _fields.value; Linked<AnnotatedField> next = _fields.next; for (; next != null; next = next.next) { AnnotatedField nextField = next.value; Class<?> fieldClass = field.getDeclaringClass(); Class<?> nextClass = nextField.getDeclaringClass(); if (fieldClass != nextClass) { if (fieldClass.isAssignableFrom(nextClass)) { // next is more specific field = nextField; continue; } if (nextClass.isAssignableFrom(fieldClass)) { // getter more specific continue; } } throw new IllegalArgumentException("Multiple fields representing property \""+getName()+"\": " +field.getFullName()+" vs "+nextField.getFullName()); } return field; }
@Override public AnnotatedField getField() { if (_fields == null) { return null; } // If multiple, verify that they do not conflict... AnnotatedField field = _fields.value; Linked<AnnotatedField> next = _fields.next; for (; next != null; next = next.next) { AnnotatedField nextField = next.value; Class<?> fieldClass = field.getDeclaringClass(); Class<?> nextClass = nextField.getDeclaringClass(); if (fieldClass != nextClass) { if (fieldClass.isAssignableFrom(nextClass)) { // next is more specific field = nextField; continue; } if (nextClass.isAssignableFrom(fieldClass)) { // getter more specific continue; } } throw new IllegalArgumentException("Multiple fields representing property \""+getName()+"\": " +field.getFullName()+" vs "+nextField.getFullName()); } return field; }
@Override public AnnotatedField getField() { if (_fields == null) { return null; } // If multiple, verify that they do not conflict... AnnotatedField field = _fields.value; Linked<AnnotatedField> next = _fields.next; for (; next != null; next = next.next) { AnnotatedField nextField = next.value; Class<?> fieldClass = field.getDeclaringClass(); Class<?> nextClass = nextField.getDeclaringClass(); if (fieldClass != nextClass) { if (fieldClass.isAssignableFrom(nextClass)) { // next is more specific field = nextField; continue; } if (nextClass.isAssignableFrom(fieldClass)) { // getter more specific continue; } } throw new IllegalArgumentException("Multiple fields representing property \""+getName()+"\": " +field.getFullName()+" vs "+nextField.getFullName()); } return field; }
@Override public AnnotatedField getField() { if (_fields == null) { return null; } // If multiple, verify that they do not conflict... AnnotatedField field = _fields.value; Linked<AnnotatedField> next = _fields.next; for (; next != null; next = next.next) { AnnotatedField nextField = next.value; Class<?> fieldClass = field.getDeclaringClass(); Class<?> nextClass = nextField.getDeclaringClass(); if (fieldClass != nextClass) { if (fieldClass.isAssignableFrom(nextClass)) { // next is more specific field = nextField; continue; } if (nextClass.isAssignableFrom(fieldClass)) { // getter more specific continue; } } throw new IllegalArgumentException("Multiple fields representing property \""+getName()+"\": " +field.getFullName()+" vs "+nextField.getFullName()); } return field; }
@Override public AnnotatedField getField() { if (_fields == null) { return null; } // If multiple, verify that they do not conflict... AnnotatedField field = _fields.value; Linked<AnnotatedField> next = _fields.next; for (; next != null; next = next.next) { AnnotatedField nextField = next.value; Class<?> fieldClass = field.getDeclaringClass(); Class<?> nextClass = nextField.getDeclaringClass(); if (fieldClass != nextClass) { if (fieldClass.isAssignableFrom(nextClass)) { // next is more specific field = nextField; continue; } if (nextClass.isAssignableFrom(fieldClass)) { // getter more specific continue; } } throw new IllegalArgumentException("Multiple fields representing property \""+getName()+"\": " +field.getFullName()+" vs "+nextField.getFullName()); } return field; }
AnnotatedField field = ((AnnotatedField) annotated); try { Arrays.stream(Introspector.getBeanInfo(field.getDeclaringClass()).getPropertyDescriptors()) .filter(prop -> field.getName().equals(prop.getName())) .findFirst() } catch (IntrospectionException e) { log.warn("Introspection of {} failed. GraphQL input fields might be incorrectly mapped.", field.getDeclaringClass());
AnnotatedField field, String defaultName) { PropertyPrefix ann = field.getDeclaringClass().getAnnotation(PropertyPrefix.class); if (ann != null) { return ann.value() + defaultName;
clazz = ((AnnotatedField) annotated).getDeclaringClass(); } else if (annotated instanceof AnnotatedMethod) { clazz = ((AnnotatedMethod) annotated).getDeclaringClass();