private ResourceModel.Builder processTemplateAnnotatedInvocables(ResourceModel resourceModel,
                                                                     final boolean subResourceModel) {
        ResourceModel.Builder modelBuilder = new ResourceModel.Builder(subResourceModel);
        for (Resource resource : resourceModel.getResources()) {
            Resource newResource = processResource(resource);
            modelBuilder.addResource(newResource);
        }
        return modelBuilder;
    }
private ResourceModel . Builder processTemplateAnnotatedInvocables ( ResourceModel resourceModel , final boolean subResourceModel ) { ResourceModel . Builder modelBuilder = new ResourceModel . Builder ( subResourceModel ) ; for ( Resource resource : resourceModel . getResources ( ) ) { Resource newResource = processResource ( resource ) ; modelBuilder . addResource ( newResource ) ; } return modelBuilder ; }
Process all {@link Invocable invocables} and defines
{@link org.glassfish.jersey.server.model.Invocable#getRoutingResponseType() routing response types}
as {@link Viewable} for all methods annotated with {@link Template}.

@param resourceModel    resource model to process.
@param subResourceModel determines whether the resource model represents sub-resource.
@return Modified resource model.