Examples of sourceType()


Examples of info.archinnov.achilles.codec.Codec.sourceType()

        Codec codec = getValueCodecInstance(field);

        validateNotIdentityCodec(fieldName, className, codec);

        final Class<?> sourceType = codec.sourceType();
        final Class<?> targetType = codec.targetType();

        validateTypesNotNull(fieldName, className, sourceType, targetType);

        final Class<?> listValueType = TypeParser.inferValueClassForListOrSet(field.getGenericType(), field.getDeclaringClass());
View Full Code Here

Examples of info.archinnov.achilles.codec.Codec.sourceType()

        Codec codec = getValueCodecInstance(field);

        validateNotIdentityCodec(fieldName, className, codec);

        final Class<?> sourceType = codec.sourceType();
        final Class<?> targetType = codec.targetType();

        validateTypesNotNull(fieldName, className, sourceType, targetType);

        final Class<?> listValueType = TypeParser.inferValueClassForListOrSet(field.getGenericType(), field.getDeclaringClass());
View Full Code Here

Examples of info.archinnov.achilles.codec.Codec.sourceType()

        log.debug("Parse list codec for field {}", field);
        if (filter.hasAnnotation(field, TypeTransformer.class)) {
            return typeTransformerParser.parseAndValidateListCodec(field);
        } else {
            final Codec simpleCodec = createSimpleCodecForCollection(context);
            return new ListCodecImpl(simpleCodec.sourceType(), simpleCodec.targetType(), simpleCodec);
        }
    }

    SetCodec parseSetField(PropertyParsingContext context) {
        final Field field = context.getCurrentField();
View Full Code Here

Examples of info.archinnov.achilles.codec.Codec.sourceType()

        log.debug("Parse set codec for field {}", field);
        if (filter.hasAnnotation(field, TypeTransformer.class)) {
            return typeTransformerParser.parseAndValidateSetCodec(field);
        } else {
            final Codec simpleCodec = createSimpleCodecForCollection(context);
            return new SetCodecImpl(simpleCodec.sourceType(), simpleCodec.targetType(), simpleCodec);
        }
    }

    MapCodec parseMapField(PropertyParsingContext context) {
        final Field field = context.getCurrentField();
View Full Code Here

Examples of info.archinnov.achilles.codec.Codec.sourceType()

            final Codec valueCodec = createSimpleCodec(context, sourceTargetTypes.right, maybeEncodingValue);

            return MapCodecBuilder.fromKeyType(keyCodec.sourceType())
                    .toKeyType(keyCodec.targetType())
                    .withKeyCodec(keyCodec)
                    .fromValueType(valueCodec.sourceType())
                    .toValueType(valueCodec.targetType())
                    .withValueCodec(valueCodec);
        }

    }
View Full Code Here

Examples of info.archinnov.achilles.codec.Codec.sourceType()

        //When
        final Codec codec = factory.parseSimpleField(createContext(field));

        //Then
        assertThat(codec.sourceType()).isSameAs(Long.class);
        assertThat(codec.targetType()).isSameAs(String.class);
    }

    @Test
    public void should_create_enum_name_codec() throws Exception {
View Full Code Here

Examples of info.archinnov.achilles.codec.Codec.sourceType()

        //When
        final Codec actual = parser.parseAndValidateSimpleCodec(Test.class.getDeclaredField("longToString"));

        //Then
        assertThat(actual).isInstanceOf(LongToStringCodec.class);
        assertThat(actual.sourceType()).isSameAs(Long.class);
        assertThat(actual.targetType()).isSameAs(String.class);
    }

    @Test
    public void should_exception_when_codec_class_not_instance_of_codec() throws Exception {
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.codec.ListCodec.sourceType()

        Field field = Test.class.getDeclaredField("counts");
        //When
        final ListCodec codec = factory.parseListField(createContext(field));

        //Then
        assertThat(codec.sourceType()).isSameAs(Long.class);
        assertThat(codec.targetType()).isSameAs(String.class);
    }

    @Test
    public void should_create_set_codec() throws Exception {
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.codec.ListCodec.sourceType()

    @Test
    public void should_determine_cql3_list_type() throws Exception {
        //Given
        ListCodec listCodec = mock(ListCodec.class);
        when(listCodec.sourceType()).thenReturn(Integer.class);
        when(listCodec.targetType()).thenReturn(String.class);

        //When
        final Class<?> actualClass = factory.determineCQL3ValueType(listCodec, false);
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.codec.ListCodec.sourceType()

        //When
        final ListCodec actual = parser.parseAndValidateListCodec(Test.class.getDeclaredField("longToString"));

        //Then
        assertThat(actual.sourceType()).isSameAs(Long.class);
        assertThat(actual.targetType()).isSameAs(String.class);
    }

    @Test
    public void should_exception_when_source_type_not_match_for_list_codec() throws Exception {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.