class WebsterChecklistTarget implements WebsterTarget {

    static WebsterChecklistTarget fromJson(final File target, final JsonObject config) {
        LOGGER.debug("[fromJson] fromJson: {}", config.toString());
        ChecklistExporter.Builder exporter = new ChecklistExporter.Builder();
        WebsterChecklistTarget.selectorsFromConfigCompactForm(config)
                .forEach(selector -> selector.selectOnExporter(exporter));
        if (config.containsKey(KEY_SELECTORS)) {
            JsonArray ops = config.getJsonArray(KEY_SELECTORS);
            List<Selector> selectors = JavaxJson.mapArrayOfObjects(ops, WebsterChecklistTarget::selectorFromJson);
            selectors.forEach(selector -> selector.selectOnExporter(exporter));
        }
        if (config.containsKey(KEY_SCOPE_PATHS)) {
            List<Rule> scopePaths = Rules.fromJsonArray(config.getJsonArray(KEY_SCOPE_PATHS));
            exporter.withScopePaths(scopePaths);
        }
        if (config.containsKey(KEY_NODE_TYPE_FILTERS)) {
            List<Rule> nodeTypeFilters = Rules.fromJsonArray(config.getJsonArray(KEY_NODE_TYPE_FILTERS));
            exporter.withNodeTypeFilters(nodeTypeFilters);
        }
        if (config.containsKey(KEY_JCR_NAMESPACES)) {
            List<JcrNs> jcrNsList = JavaxJson.mapArrayOfObjects(config.getJsonArray(KEY_JCR_NAMESPACES),
                    JcrNs::fromJson);
            exporter.withJcrNamespaces(jcrNsList);
        }
        if (config.containsKey(KEY_EXPORT_NODETYPES)) {
            List<String> ntList = JavaxJson.mapArrayOfStrings(config.getJsonArray(KEY_EXPORT_NODETYPES));
            exporter.withExportNodeTypes(ntList);
        }
        ChecklistExporter.ForcedRootUpdatePolicy updatePolicy = null;
        if (config.containsKey(KEY_UPDATE_POLICY)) {
            updatePolicy = ChecklistExporter.ForcedRootUpdatePolicy.byName(config.getString(KEY_UPDATE_POLICY));
        }
        return new WebsterChecklistTarget(target, exporter.build(), updatePolicy);
    }

    private  WebsterChecklistTarget(final File checklist,
                                   final ChecklistExporter exporter,
                                   final ChecklistExporter.ForcedRootUpdatePolicy updatePolicy);

}