@Override public ColumnInfo getColumnInfo() { return fieldDescriptor.getColumnInfo(); }
@Override public PropertyWrapper<Method, ?, P> getGetter() { return fieldDescriptor.getGetter(); }
@Override public PropertyWrapper<Field, ?, P> getField() { return fieldDescriptor.getField(); }
private <A extends Annotation, P> Optional<A> findAnnotation(FieldDescriptorImpl<BEAN, P> classField, Class<A> annotationType) { return ReflectionUtils.findAnnotation(mainClazz, classField.getField().getAccessor(), classField.getGetter().getAccessor(), classField.getSetter().getAccessor(), annotationType); }
private <P> PropertyWrapper<Field, ?, P> buildPropertyFieldWrapper(Field accessor) { if (isOptional(accessor.getType())) { return new PropertyWrapperDefault<>(Optional.ofNullable(accessor), OptionalValueProcessor.build()); } return new PropertyWrapperDefault<>(Optional.ofNullable(accessor), NoOpsValueProcessor.build()); }
private <P> void setColumnInfo(FieldDescriptorImpl<BEAN, P> classField) { classField.setColumnInfo(new InferedColumnName(classField.getFieldName())); findAnnotation(classField, Column.class) .ifPresent(column -> { classField.setColumnInfo(new AnnotationColumnInfo(column.name())); }); }
@Override public GeneratorInfo getGeneratorInfo() { return fieldDescriptor.getGeneratorInfo(); }
private <P> void setIdentifier(FieldDescriptorImpl<BEAN, P> classField) { classField.setIdentifier(findAnnotation(classField, Id.class).isPresent()); }
private <P> void setIgnored(FieldDescriptorImpl<BEAN, P> classField) { classField.setIgnored(findAnnotation(classField, Ignore.class).isPresent()); }
private <P> void setVersionInfo(FieldDescriptorImpl<BEAN, P> classField) { classField.setVersionInfo(new VersionInfoImpl(findAnnotation(classField, Version.class).isPresent())); }
@Override public String[] generatedColumnNames() { return ormClassTool.getDescriptor().getAllGeneratedColumnDBNames(); } };
private <P> void setJsonInfo(FieldDescriptorImpl<BEAN, P> classField) { classField.setJsonInfo(new JsonInfo(false, false)); findAnnotation(classField, JsonType.class) .ifPresent(jsonType -> { classField.setJsonInfo(new JsonInfo(true, jsonType.deepCopy())); }); }
private <P> void setGeneratorInfo(FieldDescriptorImpl<BEAN, P> classField) { classField.setGeneratorInfo(new GeneratorInfoImpl(GeneratorType.NONE, "", false)); final Optional<Generator> generator = findAnnotation(classField, Generator.class); if (generator.isPresent()) { classField.setGeneratorInfo(new GeneratorInfoImpl(generator.get().generatorType(), generator.get().name(), true)); } }
@Override public boolean isIgnored() { return fieldDescriptor.isIgnored(); }
@Override public VersionInfo getVersionInfo() { return fieldDescriptor.getVersionInfo(); }
@Override public String getFieldName() { return fieldDescriptor.getFieldName(); }
@Override public boolean isIdentifier() { return fieldDescriptor.isIdentifier(); }
@Override public Class<P> getProcessedClass() { return fieldDescriptor.getProcessedClass(); }
@Override public PropertyWrapper<Method, ?, P> getSetter() { return fieldDescriptor.getSetter(); }
@Override public JsonInfo getJsonInfo() { return fieldDescriptor.getJsonInfo(); }