Search in sources :

Example 1 with MethodSetter

use of org.simpleflatmapper.reflect.setter.MethodSetter in project SimpleFlatMapper by arnaudroger.

the class ObjectSetterFactoryTest method testFailFallBackToMethod.

@Test
public void testFailFallBackToMethod() throws Exception {
    Setter<Foo, String> setter = new ObjectSetterFactory(new AsmFactory(Thread.currentThread().getContextClassLoader()) {

        @Override
        public <T, P> Setter<T, P> createSetter(Method m) throws Exception {
            throw new UnsupportedOperationException();
        }
    }).getSetter(Foo.class, "foo");
    assertTrue(setter instanceof MethodSetter);
    SetterHelperTest.validateFooSetter(setter);
}
Also used : Foo(org.simpleflatmapper.test.beans.Foo) ObjectSetterFactory(org.simpleflatmapper.reflect.ObjectSetterFactory) CharacterMethodSetter(org.simpleflatmapper.reflect.primitive.CharacterMethodSetter) LongMethodSetter(org.simpleflatmapper.reflect.primitive.LongMethodSetter) ShortMethodSetter(org.simpleflatmapper.reflect.primitive.ShortMethodSetter) ByteMethodSetter(org.simpleflatmapper.reflect.primitive.ByteMethodSetter) BooleanMethodSetter(org.simpleflatmapper.reflect.primitive.BooleanMethodSetter) FloatMethodSetter(org.simpleflatmapper.reflect.primitive.FloatMethodSetter) IntMethodSetter(org.simpleflatmapper.reflect.primitive.IntMethodSetter) MethodSetter(org.simpleflatmapper.reflect.setter.MethodSetter) DoubleMethodSetter(org.simpleflatmapper.reflect.primitive.DoubleMethodSetter) AsmFactory(org.simpleflatmapper.reflect.asm.AsmFactory) Method(java.lang.reflect.Method) Test(org.junit.Test)

Aggregations

Method (java.lang.reflect.Method)1 Test (org.junit.Test)1 ObjectSetterFactory (org.simpleflatmapper.reflect.ObjectSetterFactory)1 AsmFactory (org.simpleflatmapper.reflect.asm.AsmFactory)1 BooleanMethodSetter (org.simpleflatmapper.reflect.primitive.BooleanMethodSetter)1 ByteMethodSetter (org.simpleflatmapper.reflect.primitive.ByteMethodSetter)1 CharacterMethodSetter (org.simpleflatmapper.reflect.primitive.CharacterMethodSetter)1 DoubleMethodSetter (org.simpleflatmapper.reflect.primitive.DoubleMethodSetter)1 FloatMethodSetter (org.simpleflatmapper.reflect.primitive.FloatMethodSetter)1 IntMethodSetter (org.simpleflatmapper.reflect.primitive.IntMethodSetter)1 LongMethodSetter (org.simpleflatmapper.reflect.primitive.LongMethodSetter)1 ShortMethodSetter (org.simpleflatmapper.reflect.primitive.ShortMethodSetter)1 MethodSetter (org.simpleflatmapper.reflect.setter.MethodSetter)1 Foo (org.simpleflatmapper.test.beans.Foo)1