/** * @param owner The ClassMetadata that owns this field * @param field The field this metadata is for * @param copyStrategy The CopyStrategy appropriate for the type of the field * @param factory The reflection provider */ @SuppressWarnings("unchecked") public FieldMetadata(ClassMetadata<T, ?> owner, Field field, CopyStrategy<U> copyStrategy, ReflectFactory factory) throws InaccessibleFieldException { this.owner = owner; this.copyStrategy = copyStrategy; this.type = (Class<U>) determineType(field, owner.getType()); this.accessor = factory.createFieldAccessor(owner.getType(), field, type); this.field = field; SerializedName name = field.getAnnotation(SerializedName.class); if (name != null) { serializationName = name.value(); } else { serializationName = field.getName(); } }