All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.simpleflatmapper.map.annotation.impl.MappingAnnotationToPropertyServiceProducer Maven / Gradle / Ivy

Go to download

Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.

There is a newer version: 9.0.2
Show newest version
package org.simpleflatmapper.map.annotation.impl;

import org.simpleflatmapper.map.annotation.Key;
import org.simpleflatmapper.map.property.KeyProperty;
import org.simpleflatmapper.reflect.meta.AnnotationToPropertyService;
import org.simpleflatmapper.reflect.meta.AnnotationToPropertyServiceProducer;
import org.simpleflatmapper.util.Consumer;

import java.lang.annotation.Annotation;

public class MappingAnnotationToPropertyServiceProducer implements AnnotationToPropertyServiceProducer {
    @Override
    public void produce(Consumer consumer) {
        consumer.accept(new MappingAnnotationToPropertyService());
    }

    private class MappingAnnotationToPropertyService implements AnnotationToPropertyService {
        @Override
        public void generateProperty(Annotation annotation, Consumer consumer) {
            if (Key.class.equals(annotation.annotationType())) {
                consumer.accept(KeyProperty.DEFAULT);
            }
        }
    }
}