private void writePostCreateChildMethodCalls( VariableElement field, TypeMirror itemType, Collection<ExecutableElement> postCreateChildMethods, JavaWriter writer) throws IOException { if (!postCreateChildMethods.isEmpty() && metaTypes.isSubtype(itemType, Names.PARCELABLE)) { writer.beginControlFlow("for (Object child : object.%s)", field.getSimpleName()); for (ExecutableElement method : postCreateChildMethods) { writer.emitStatement("object.%s(child)", method.getSimpleName()); } writer.endControlFlow(); } }
@Override public boolean isApplicable(VariableElement field) { return metaTypes.isSubtypeErasure(field.asType(), Collection.class); }