Package com.impetus.kundera.property.accessor

Examples of com.impetus.kundera.property.accessor.EnumAccessor


                                    + "; Reason - possible corrupt data.", e);
                        }
                    }
                    break;
                case ENUM:
                    EnumAccessor accessor = new EnumAccessor();
                    value = accessor.fromString(javaType, value.toString());
                    PropertyAccessorHelper.set(entityObject, (Field) column.getJavaMember(), value);
                    break;
                case PRIMITIVE:
                    value = MongoDBUtils.populateValue(value, value.getClass());
                    value = MongoDBUtils.getTranslatedObject(value, value.getClass(), javaType);
View Full Code Here


    private static Object setTextValue(Object entity, Field member, Object retVal)
    {
        if (member != null && member.getType().isEnum())
        {
            EnumAccessor accessor = new EnumAccessor();
            if (member != null)
            {
                retVal = accessor.fromString(member.getType(), (String) retVal);
            }
        }
        else if (member != null
                && (member.getType().isAssignableFrom(char.class) || member.getType().isAssignableFrom(Character.class)))
        {
View Full Code Here

    private Object onEnum(Attribute attribute, Object fieldValue)
    {
        if (((Field) attribute.getJavaMember()).getType().isEnum())
        {
            EnumAccessor accessor = new EnumAccessor();
            fieldValue = accessor.fromString(((AbstractAttribute) attribute).getBindableJavaType(),
                    fieldValue.toString());

        }
        return fieldValue;
    }
View Full Code Here

    public static PropertyAccessor getPropertyAccessor(Class<?> clazz)
    {
        PropertyAccessor<?> accessor;
        if (clazz.isEnum())
        {
            accessor = new EnumAccessor();
        }
        else
        {
            accessor = map.get(clazz);
        }
View Full Code Here

                            Object valueObject = valueMap.get(jpaColumnName) == null ? valueMap.get(jpaColumnName
                                    .toUpperCase()) == null ? valueMap.get(jpaColumnName.toLowerCase()) : valueMap
                                    .get(jpaColumnName.toUpperCase()) : valueMap.get(jpaColumnName);
                            if (valueObject != null && AttributeType.getType(javaType).equals(AttributeType.ENUM))
                            {
                                EnumAccessor accessor = new EnumAccessor();
                                valueObject = accessor.fromString(javaType, valueObject.toString());
                                setFieldValue(entity, valueObject, column);
                            }
                            else if(valueObject != null)
                            {
                                setFieldValue(entity, valueObject, column);
View Full Code Here

         * @param clazz
         * @return
         */
        private static byte[] compose(Object value, Class clazz)
        {
            EnumAccessor accessor = new EnumAccessor();
            return accessor.toBytes(value);
        }
View Full Code Here

         * @param clazz
         * @return
         */
        private static Object decompose(Object value, Class clazz)
        {
            EnumAccessor accessor = new EnumAccessor();
            return accessor.fromBytes(clazz, ((byte[]) value));
        }
View Full Code Here

TOP

Related Classes of com.impetus.kundera.property.accessor.EnumAccessor

Copyright © 2018 www.massapicom. 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.