Package com.addthis.codec.annotations

Examples of com.addthis.codec.annotations.FieldConfig


    /**
     * Decide whether it is okay to read/ write a field. If configured via an annotation on the field, use that.
     * Otherwise return true only if the field is both public and non-final.
     */
    private static boolean isCodable(Field field) {
        FieldConfig fieldConfigPolicy = field.getAnnotation(FieldConfig.class);
        if (fieldConfigPolicy != null) {
            return fieldConfigPolicy.codable();
        }
        int modifierBitSet = field.getModifiers();
        return !Modifier.isFinal(modifierBitSet) && Modifier.isPublic(modifierBitSet);
    }
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

        }
        for (Field field : fields.values()) {
            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

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.