org.simpleflatmapper.reflect.impl.JavaLangClassMetaFactoryProducer Maven / Gradle / Ivy
package org.simpleflatmapper.reflect.impl;
import org.simpleflatmapper.reflect.InstantiatorDefinition;
import org.simpleflatmapper.reflect.ReflectionService;
import org.simpleflatmapper.reflect.meta.ClassMeta;
import org.simpleflatmapper.reflect.meta.ConstructorPropertyMeta;
import org.simpleflatmapper.reflect.meta.ObjectClassMeta;
import org.simpleflatmapper.reflect.meta.PropertyMeta;
import org.simpleflatmapper.util.Consumer;
import org.simpleflatmapper.util.UnaryFactory;
import java.util.Collections;
public class JavaLangClassMetaFactoryProducer implements ReflectionService.ClassMetaFactoryProducer {
@Override
public void produce(Consumer>> consumer) {
predefined(String.class, consumer);
predefined(Boolean.class, consumer);
predefined(Byte.class, consumer);
predefined(Character.class, consumer);
predefined(Short.class, consumer);
predefined(Integer.class, consumer);
predefined(Long.class, consumer);
predefined(Float.class, consumer);
predefined(Double.class, consumer);
}
private void predefined(final Class target,
Consumer>> consumer) {
consumer.accept(new UnaryFactory>() {
@Override
public ClassMeta newInstance(ReflectionService reflectionService) {
return new ObjectClassMeta(
target,
Collections.emptyList(),
Collections.>emptyList(),
Collections.emptyMap(),
Collections.>emptyList(),
reflectionService, false);
}
});
}
}