Package com.addthis.codec.annotations

Examples of com.addthis.codec.annotations.FieldConfig


        SortedMap<String, CodableFieldInfo> buildClassData = new TreeMap<>();
        for (Field field : fields) {
            int mod = field.getModifiers();
            boolean store = ((mod & Modifier.FINAL) == 0) && ((mod & Modifier.PUBLIC) != 0);
            // extract annotations
            FieldConfig fieldConfigPolicy = field.getAnnotation(FieldConfig.class);
            if (fieldConfigPolicy != null) {
                field.setAccessible(true);
                store |= fieldConfigPolicy.codable();
            }
            // field must be public and non-final or annotated with a store policy
            if (!store) {
                continue;
            }
View Full Code Here


        return result;
    }

    @Override
    public boolean hasIgnoreMarker(AnnotatedMember m) {
        FieldConfig fieldConfig = m.getAnnotation(FieldConfig.class);
        if (fieldConfig != null) {
            return !fieldConfig.codable();
        }
        return false;
    }
View Full Code Here

        return false;
    }

    @Override
    public Boolean hasRequiredMarker(AnnotatedMember m) {
        FieldConfig fieldConfig = m.getAnnotation(FieldConfig.class);
        if (fieldConfig != null) {
            return fieldConfig.required();
        }
        return null;
    }
View Full Code Here

    // also, note that these methods are what cause FieldConfig to trigger inclusion, so if/when
    // we just drop readonly/writeonly, we can (should) add meta annotations to FieldConfig et al.

    @Override
    public PropertyName findNameForDeserialization(Annotated a) {
        FieldConfig fieldConfig = a.getAnnotation(FieldConfig.class);
        if ((fieldConfig != null) && !fieldConfig.writeonly() && fieldConfig.codable()) {
            return PropertyName.USE_DEFAULT;
        }
        return null;
    }
View Full Code Here

        return null;
    }

    @Override
    public PropertyName findNameForSerialization(Annotated a) {
        FieldConfig fieldConfig = a.getAnnotation(FieldConfig.class);
        if ((fieldConfig != null) && !fieldConfig.readonly() && fieldConfig.codable()) {
            return PropertyName.USE_DEFAULT;
        }
        return null;
    }
View Full Code Here

        SortedMap<String, CodableFieldInfo> buildClassData = new TreeMap<>();
        for (Field field : fields) {
            int mod = field.getModifiers();
            boolean store = ((mod & Modifier.FINAL) == 0) && ((mod & Modifier.PUBLIC) != 0);
            // extract annotations
            FieldConfig fieldConfigPolicy = field.getAnnotation(FieldConfig.class);
            if (fieldConfigPolicy != null) {
                field.setAccessible(true);
                store |= fieldConfigPolicy.codable();
            }
            // field must be public and non-final or annotated with a store policy
            if (!store) {
                continue;
            }
View Full Code Here

        return null;
    }

    @Override
    public boolean hasIgnoreMarker(AnnotatedMember m) {
        FieldConfig fieldConfig = m.getAnnotation(FieldConfig.class);
        if (fieldConfig != null) {
            return !fieldConfig.codable();
        }
        return false;
    }
View Full Code Here

        return false;
    }

    @Override
    public Boolean hasRequiredMarker(AnnotatedMember m) {
        FieldConfig fieldConfig = m.getAnnotation(FieldConfig.class);
        if (fieldConfig != null) {
            return fieldConfig.required();
        }
        return null;
    }
View Full Code Here

    // also, note that these methods are what cause FieldConfig to trigger inclusion, so if/when
    // we just drop readonly/writeonly, we can (should) add meta annotations to FieldConfig et al.

    @Override
    public PropertyName findNameForDeserialization(Annotated a) {
        FieldConfig fieldConfig = a.getAnnotation(FieldConfig.class);
        if ((fieldConfig != null) && !fieldConfig.writeonly() && fieldConfig.codable()) {
            return PropertyName.USE_DEFAULT;
        }
        return null;
    }
View Full Code Here

        return null;
    }

    @Override
    public PropertyName findNameForSerialization(Annotated a) {
        FieldConfig fieldConfig = a.getAnnotation(FieldConfig.class);
        if ((fieldConfig != null) && !fieldConfig.readonly() && fieldConfig.codable()) {
            return PropertyName.USE_DEFAULT;
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of com.addthis.codec.annotations.FieldConfig

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.