Search in sources :

Example 11 with PropertyMapping

use of org.simpleflatmapper.map.mapper.PropertyMapping in project SimpleFlatMapper by arnaudroger.

the class ConstantSourceFieldMapperFactoryImplTest method createPropertyMapping.

public static <T, P> PropertyMapping<T, P, SampleFieldKey, FieldMapperColumnDefinition<SampleFieldKey>> createPropertyMapping(Class<T> target, String property) {
    ClassMeta<T> classMeta = REFLECTION_SERVICE.getClassMeta(target);
    PropertyMeta<T, P> propertyMeta = classMeta.newPropertyFinder(ConstantPredicate.<PropertyMeta<?, ?>>truePredicate()).findProperty(DefaultPropertyNameMatcher.of(property), new Object[0]);
    PropertyMapping<T, P, SampleFieldKey, FieldMapperColumnDefinition<SampleFieldKey>> pm = new PropertyMapping<T, P, SampleFieldKey, FieldMapperColumnDefinition<SampleFieldKey>>(propertyMeta, new SampleFieldKey(property, 0), FieldMapperColumnDefinition.<SampleFieldKey>identity());
    return pm;
}
Also used : FieldMapperColumnDefinition(org.simpleflatmapper.map.property.FieldMapperColumnDefinition) PropertyMapping(org.simpleflatmapper.map.mapper.PropertyMapping) PropertyMeta(org.simpleflatmapper.reflect.meta.PropertyMeta) SampleFieldKey(org.simpleflatmapper.test.map.SampleFieldKey)

Aggregations

PropertyMapping (org.simpleflatmapper.map.mapper.PropertyMapping)11 FieldMapperColumnDefinition (org.simpleflatmapper.map.property.FieldMapperColumnDefinition)6 PropertyMeta (org.simpleflatmapper.reflect.meta.PropertyMeta)5 Setter (org.simpleflatmapper.reflect.Setter)4 Test (org.junit.Test)3 HashMap (java.util.HashMap)2 CellSetter (org.simpleflatmapper.csv.mapper.CellSetter)2 DelayedCellSetterFactory (org.simpleflatmapper.csv.mapper.DelayedCellSetterFactory)2 JdbcColumnKey (org.simpleflatmapper.jdbc.JdbcColumnKey)2 SetterFactoryProperty (org.simpleflatmapper.map.property.SetterFactoryProperty)2 Getter (org.simpleflatmapper.reflect.Getter)2 SetterFactory (org.simpleflatmapper.reflect.SetterFactory)2 ConstructorPropertyMeta (org.simpleflatmapper.reflect.meta.ConstructorPropertyMeta)2 ObjectClassMeta (org.simpleflatmapper.reflect.meta.ObjectClassMeta)2 SelfPropertyMeta (org.simpleflatmapper.reflect.meta.SelfPropertyMeta)2 SubPropertyMeta (org.simpleflatmapper.reflect.meta.SubPropertyMeta)2 IntGetter (org.simpleflatmapper.reflect.primitive.IntGetter)2 DbObject (org.simpleflatmapper.test.beans.DbObject)2 Type (java.lang.reflect.Type)1 PreparedStatement (java.sql.PreparedStatement)1