@Override public boolean processVariableElement(VariableElement field, DeclaredTypeName fieldType) { boolean isViewProperty = TypeConstants.isBasicPropertyType(fieldType); ViewQuery isViewQuery = field.getAnnotation(ViewQuery.class); Set<Modifier> modifiers = field.getModifiers(); if (modifiers.containsAll(TypeConstants.PUBLIC_STATIC_FINAL)) { if (isViewQuery != null) { if (!TypeConstants.QUERY.equals(fieldType)) { utils .getMessager() .printMessage( Diagnostic.Kind.ERROR, "ViewQuery must be an instance of " + TypeConstants.QUERY.toString()); } else if (modelSpec.hasMetadata(ViewModelSpecWrapper.METADATA_KEY_QUERY_ELEMENT)) { utils .getMessager() .printMessage(Diagnostic.Kind.ERROR, "Only one ViewQuery can be declared per spec"); } else { modelSpec.putMetadata(ViewModelSpecWrapper.METADATA_KEY_VIEW_QUERY, isViewQuery); modelSpec.putMetadata(ViewModelSpecWrapper.METADATA_KEY_QUERY_ELEMENT, field); } return true; } else { return super.processVariableElement(field, fieldType); } } else if (isViewProperty) { utils .getMessager() .printMessage( Diagnostic.Kind.ERROR, "View properties must be public static final", field); } return false; }