test_class.declarator: testBaseDir = new File("target/repos/ChecklistExporterTest")
test_class.modifier: final
test_class.original_string: final File testBaseDir = new File("target/repos/ChecklistExporterTest");
test_class.type: File
test_class.var_name: testBaseDir
test_class.file: webster/src/test/java/net/adamcin/oakpal/webster/ChecklistExporterTest.java
test_class.identifier: ChecklistExporterTest
test_case.body: @Test
      public void testNodeToRootNodeTypeScoped() throws Exception {
          TestUtil.withInMemoryRepo(session -> {
              TestUtil.installCndFromURL(session, getClass().getResource("/sling_nodetypes.cnd"));
              final NamespaceMapping mapping = new NamespaceMapping(new SessionNamespaceResolver(session));
  
              Node node1 = JcrUtils.getOrCreateByPath("/test/node1", "nt:folder", session);
              node1.addMixin("mix:title");
              node1.addMixin("sling:Resource");
              node1.addMixin("sling:ResourceSuperType");
  
              ChecklistExporter mixExporter = new ChecklistExporter.Builder().withNodeTypeFilters(
                      Rules.fromJsonArray(arr(key("type", "include").key("pattern", "mix:.*"))
                              .get())).build();
  
              ChecklistExporter slingExporter = new ChecklistExporter.Builder().withNodeTypeFilters(
                      Rules.fromJsonArray(arr(key("type", "include").key("pattern", "sling:.*"))
                              .get())).build();
  
              ChecklistExporter rtExporter = new ChecklistExporter.Builder().withNodeTypeFilters(
                      Rules.fromJsonArray(arr(key("type", "include").key("pattern", "sling:Resource"))
                              .get())).build();
  
              ForcedRoot mixRoot = mixExporter.nodeToRoot(node1, mapping).orElse(null);
              assertNotNull("mixRoot should not be null", mixRoot);
              assertTrue("mixRoot should contain mix:title mixin", mixRoot.getMixinTypes().contains("mix:title"));
              assertFalse("mixRoot should not contain sling:Resource mixin", mixRoot.getMixinTypes().contains("sling:Resource"));
              assertFalse("mixRoot should not contain sling:ResourceSuperType mixin", mixRoot.getMixinTypes().contains("sling:ResourceSuperType"));
  
              ForcedRoot slingRoot = slingExporter.nodeToRoot(node1, mapping).orElse(null);
              assertNotNull("slingRoot should not be null", slingRoot);
              assertFalse("slingRoot should not contain mix:title mixin", slingRoot.getMixinTypes().contains("mix:title"));
              assertTrue("slingRoot should contain sling:Resource mixin", slingRoot.getMixinTypes().contains("sling:Resource"));
              assertTrue("slingRoot should contain sling:ResourceSuperType mixin", slingRoot.getMixinTypes().contains("sling:ResourceSuperType"));
  
              ForcedRoot rtRoot = rtExporter.nodeToRoot(node1, mapping).orElse(null);
              assertNotNull("rtRoot should not be null", rtRoot);
              assertNull("rtRoot primaryType should be null", rtRoot.getPrimaryType());
              assertFalse("rtRoot should not contain mix:title mixin", rtRoot.getMixinTypes().contains("mix:title"));
              assertTrue("rtRoot should contain sling:Resource mixin", rtRoot.getMixinTypes().contains("sling:Resource"));
              assertFalse("rtRoot should not contain sling:ResourceSuperType mixin", rtRoot.getMixinTypes().contains("sling:ResourceSuperType"));
          });
      }
test_case.class_method_signature: ChecklistExporterTest.testNodeToRootNodeTypeScoped()
test_case.full_signature: @Test public void testNodeToRootNodeTypeScoped()
test_case.identifier: testNodeToRootNodeTypeScoped
test_case.invocations: withInMemoryRepo installCndFromURL getResource getClass getOrCreateByPath addMixin addMixin addMixin build withNodeTypeFilters fromJsonArray get arr key key build withNodeTypeFilters fromJsonArray get arr key key build withNodeTypeFilters fromJsonArray get arr key key orElse nodeToRoot assertNotNull assertTrue contains getMixinTypes assertFalse contains getMixinTypes assertFalse contains getMixinTypes orElse nodeToRoot assertNotNull assertFalse contains getMixinTypes assertTrue contains getMixinTypes assertTrue contains getMixinTypes orElse nodeToRoot assertNotNull assertNull getPrimaryType assertFalse contains getMixinTypes assertTrue contains getMixinTypes assertFalse contains getMixinTypes
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNodeToRootNodeTypeScoped()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(ChecklistExporter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(ChecklistExporter.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: operations
focal_class.modifier: private final
focal_class.original_string: private final List<Op> operations;
focal_class.type: List<Op>
focal_class.var_name: operations
focal_class.declarator: exportTypeDefs
focal_class.modifier: private final
focal_class.original_string: private final List<String> exportTypeDefs;
focal_class.type: List<String>
focal_class.var_name: exportTypeDefs
focal_class.declarator: pathScopes
focal_class.modifier: private final
focal_class.original_string: private final List<Rule> pathScopes;
focal_class.type: List<Rule>
focal_class.var_name: pathScopes
focal_class.declarator: nodeTypeFilters
focal_class.modifier: private final
focal_class.original_string: private final List<Rule> nodeTypeFilters;
focal_class.type: List<Rule>
focal_class.var_name: nodeTypeFilters
focal_class.declarator: jcrNamespaces
focal_class.modifier: private final
focal_class.original_string: private final List<JcrNs> jcrNamespaces;
focal_class.type: List<JcrNs>
focal_class.var_name: jcrNamespaces
focal_class.declarator: DEFAULT_UPDATE_POLICY = ForcedRootUpdatePolicy.REPLACE
focal_class.modifier: public static final
focal_class.original_string: public static final ForcedRootUpdatePolicy DEFAULT_UPDATE_POLICY = ForcedRootUpdatePolicy.REPLACE;
focal_class.type: ForcedRootUpdatePolicy
focal_class.var_name: DEFAULT_UPDATE_POLICY
focal_class.declarator: COVARIANT_PREFIX = "+"
focal_class.modifier: public static final
focal_class.original_string: public static final String COVARIANT_PREFIX = "+";
focal_class.type: String
focal_class.var_name: COVARIANT_PREFIX
focal_class.declarator: COVARIANT_FILTER = name -> name.startsWith(COVARIANT_PREFIX)
focal_class.modifier: static final
focal_class.original_string: static final Predicate<String> COVARIANT_FILTER = name -> name.startsWith(COVARIANT_PREFIX);
focal_class.type: Predicate<String>
focal_class.var_name: COVARIANT_FILTER
focal_class.declarator: COVARIANT_FORMAT = name -> name.substring(COVARIANT_PREFIX.length())
focal_class.modifier: static final
focal_class.original_string: static final Function<String, String> COVARIANT_FORMAT = name -> name.substring(COVARIANT_PREFIX.length());
focal_class.type: Function<String, String>
focal_class.var_name: COVARIANT_FORMAT
focal_class.file: webster/src/main/java/net/adamcin/oakpal/webster/ChecklistExporter.java
focal_class.identifier: ChecklistExporter
focal_class.class_method_signature: ChecklistExporter.ChecklistExporter(final List<Op> operations,
                                final List<String> exportTypeDefs,
                                final List<Rule> pathScopes,
                                final List<Rule> nodeTypeFilters,
                                final List<JcrNs> jcrNamespaces)
focal_class.full_signature: private  ChecklistExporter(final List<Op> operations,
                                final List<String> exportTypeDefs,
                                final List<Rule> pathScopes,
                                final List<Rule> nodeTypeFilters,
                                final List<JcrNs> jcrNamespaces)
focal_class.identifier: ChecklistExporter
focal_class.modifiers: private
focal_class.parameters: (final List<Op> operations,
                                final List<String> exportTypeDefs,
                                final List<Rule> pathScopes,
                                final List<Rule> nodeTypeFilters,
                                final List<JcrNs> jcrNamespaces)
focal_class.signature:  ChecklistExporter(final List<Op> operations,
                                final List<String> exportTypeDefs,
                                final List<Rule> pathScopes,
                                final List<Rule> nodeTypeFilters,
                                final List<JcrNs> jcrNamespaces)
focal_class.class_method_signature: ChecklistExporter.ensureNamespaces(final @NotNull Session session,
                                   final @NotNull NamespaceMapping namespaces)
focal_class.full_signature: static void ensureNamespaces(final @NotNull Session session,
                                   final @NotNull NamespaceMapping namespaces)
focal_class.identifier: ensureNamespaces
focal_class.modifiers: static
focal_class.parameters: (final @NotNull Session session,
                                   final @NotNull NamespaceMapping namespaces)
focal_class.return: void
focal_class.signature: void ensureNamespaces(final @NotNull Session session,
                                   final @NotNull NamespaceMapping namespaces)
focal_class.class_method_signature: ChecklistExporter.findJcrPrefixesInForcedRoot(final @NotNull Set<String> acc, final @NotNull ForcedRoot forcedRoot)
focal_class.full_signature: static Set<String> findJcrPrefixesInForcedRoot(final @NotNull Set<String> acc, final @NotNull ForcedRoot forcedRoot)
focal_class.identifier: findJcrPrefixesInForcedRoot
focal_class.modifiers: static
focal_class.parameters: (final @NotNull Set<String> acc, final @NotNull ForcedRoot forcedRoot)
focal_class.return: Set<String>
focal_class.signature: Set<String> findJcrPrefixesInForcedRoot(final @NotNull Set<String> acc, final @NotNull ForcedRoot forcedRoot)
focal_class.class_method_signature: ChecklistExporter.findNodeTypesInForcedRoot(final Set<String> acc, final ForcedRoot forcedRoot)
focal_class.full_signature: static Set<String> findNodeTypesInForcedRoot(final Set<String> acc, final ForcedRoot forcedRoot)
focal_class.identifier: findNodeTypesInForcedRoot
focal_class.modifiers: static
focal_class.parameters: (final Set<String> acc, final ForcedRoot forcedRoot)
focal_class.return: Set<String>
focal_class.signature: Set<String> findNodeTypesInForcedRoot(final Set<String> acc, final ForcedRoot forcedRoot)
focal_class.class_method_signature: ChecklistExporter.preferDifferent(final @NotNull U value)
focal_class.full_signature: static BinaryOperator<U> preferDifferent(final @NotNull U value)
focal_class.identifier: preferDifferent
focal_class.modifiers: static
focal_class.parameters: (final @NotNull U value)
focal_class.return: BinaryOperator<U>
focal_class.signature: BinaryOperator<U> preferDifferent(final @NotNull U value)
focal_class.class_method_signature: ChecklistExporter.nsRemapName(final NamespaceMapping fromMapping, final NamespaceMapping toMapping)
focal_class.full_signature: static Function<String, String> nsRemapName(final NamespaceMapping fromMapping, final NamespaceMapping toMapping)
focal_class.identifier: nsRemapName
focal_class.modifiers: static
focal_class.parameters: (final NamespaceMapping fromMapping, final NamespaceMapping toMapping)
focal_class.return: Function<String, String>
focal_class.signature: Function<String, String> nsRemapName(final NamespaceMapping fromMapping, final NamespaceMapping toMapping)
focal_class.class_method_signature: ChecklistExporter.nsRemapForcedRoot(final NamespaceMapping fromMapping, final NamespaceMapping toMapping)
focal_class.full_signature: static Function<ForcedRoot, ForcedRoot> nsRemapForcedRoot(final NamespaceMapping fromMapping, final NamespaceMapping toMapping)
focal_class.identifier: nsRemapForcedRoot
focal_class.modifiers: static
focal_class.parameters: (final NamespaceMapping fromMapping, final NamespaceMapping toMapping)
focal_class.return: Function<ForcedRoot, ForcedRoot>
focal_class.signature: Function<ForcedRoot, ForcedRoot> nsRemapForcedRoot(final NamespaceMapping fromMapping, final NamespaceMapping toMapping)
focal_class.class_method_signature: ChecklistExporter.getRetainFilter(final ForcedRootUpdatePolicy updatePolicy)
focal_class.full_signature:  Predicate<ForcedRoot> getRetainFilter(final ForcedRootUpdatePolicy updatePolicy)
focal_class.identifier: getRetainFilter
focal_class.parameters: (final ForcedRootUpdatePolicy updatePolicy)
focal_class.return: Predicate<ForcedRoot>
focal_class.signature: Predicate<ForcedRoot> getRetainFilter(final ForcedRootUpdatePolicy updatePolicy)
focal_class.class_method_signature: ChecklistExporter.exportTypeDefSelector()
focal_class.full_signature:  BiPredicate<NamePathResolver, NodeType> exportTypeDefSelector()
focal_class.identifier: exportTypeDefSelector
focal_class.parameters: ()
focal_class.return: BiPredicate<NamePathResolver, NodeType>
focal_class.signature: BiPredicate<NamePathResolver, NodeType> exportTypeDefSelector()
focal_class.class_method_signature: ChecklistExporter.updateChecklist(final WriterOpener writerOpener,
                                  final Session session,
                                  final Checklist checklist,
                                  final ForcedRootUpdatePolicy updatePolicy)
focal_class.full_signature: public void updateChecklist(final WriterOpener writerOpener,
                                  final Session session,
                                  final Checklist checklist,
                                  final ForcedRootUpdatePolicy updatePolicy)
focal_class.identifier: updateChecklist
focal_class.modifiers: public
focal_class.parameters: (final WriterOpener writerOpener,
                                  final Session session,
                                  final Checklist checklist,
                                  final ForcedRootUpdatePolicy updatePolicy)
focal_class.return: void
focal_class.signature: void updateChecklist(final WriterOpener writerOpener,
                                  final Session session,
                                  final Checklist checklist,
                                  final ForcedRootUpdatePolicy updatePolicy)
focal_class.class_method_signature: ChecklistExporter.addToLeft()
focal_class.full_signature: static BinaryOperator<U> addToLeft()
focal_class.identifier: addToLeft
focal_class.modifiers: static
focal_class.parameters: ()
focal_class.return: BinaryOperator<U>
focal_class.signature: BinaryOperator<U> addToLeft()
focal_class.class_method_signature: ChecklistExporter.findRoots(final Session session)
focal_class.full_signature: public List<ForcedRoot> findRoots(final Session session)
focal_class.identifier: findRoots
focal_class.modifiers: public
focal_class.parameters: (final Session session)
focal_class.return: List<ForcedRoot>
focal_class.signature: List<ForcedRoot> findRoots(final Session session)
focal_class.class_method_signature: ChecklistExporter.ntStatement(final Session session, final List<String> nodeTypeNames)
focal_class.full_signature:  String ntStatement(final Session session, final List<String> nodeTypeNames)
focal_class.identifier: ntStatement
focal_class.parameters: (final Session session, final List<String> nodeTypeNames)
focal_class.return: String
focal_class.signature: String ntStatement(final Session session, final List<String> nodeTypeNames)
focal_class.class_method_signature: ChecklistExporter.query(final Session session, final String statement)
focal_class.full_signature:  List<ForcedRoot> query(final Session session, final String statement)
focal_class.identifier: query
focal_class.parameters: (final Session session, final String statement)
focal_class.return: List<ForcedRoot>
focal_class.signature: List<ForcedRoot> query(final Session session, final String statement)
focal_class.class_method_signature: ChecklistExporter.traverse(final Session session, final List<String> paths)
focal_class.full_signature:  List<ForcedRoot> traverse(final Session session, final List<String> paths)
focal_class.identifier: traverse
focal_class.parameters: (final Session session, final List<String> paths)
focal_class.return: List<ForcedRoot>
focal_class.signature: List<ForcedRoot> traverse(final Session session, final List<String> paths)
focal_class.class_method_signature: ChecklistExporter.nodeToRoot(final Node node, final NamespaceMapping mapping)
focal_class.full_signature:  Optional<ForcedRoot> nodeToRoot(final Node node, final NamespaceMapping mapping)
focal_class.identifier: nodeToRoot
focal_class.parameters: (final Node node, final NamespaceMapping mapping)
focal_class.return: Optional<ForcedRoot>
focal_class.signature: Optional<ForcedRoot> nodeToRoot(final Node node, final NamespaceMapping mapping)
focal_method.body: Optional<ForcedRoot> nodeToRoot(final Node node, final NamespaceMapping mapping) throws RepositoryException {
          if (Rules.lastMatch(pathScopes, node.getPath()).isExclude()) {
              return Optional.empty();
          }
  
          ForcedRoot forcedRoot = new ForcedRoot();
          forcedRoot.setPath(node.getPath());
          final String primaryType = node.getPrimaryNodeType().getName();
          if (Rules.lastMatch(nodeTypeFilters, QName.parseQName(mapping, QName.Type.NODETYPE, primaryType).toString()).isInclude()) {
              forcedRoot.setPrimaryType(primaryType);
          }
          final List<String> mixinTypes = Stream.of(node.getMixinNodeTypes())
                  .map(compose1(NodeType::getName,
                          qName -> QName.parseQName(mapping, QName.Type.NODETYPE, qName).toString()))
                  .filter(name -> Rules.lastMatch(nodeTypeFilters, name).isInclude())
                  .collect(Collectors.toList());
          forcedRoot.setMixinTypes(mixinTypes);
          return Optional.of(forcedRoot);
      }
focal_method.class_method_signature: ChecklistExporter.nodeToRoot(final Node node, final NamespaceMapping mapping)
focal_method.full_signature:  Optional<ForcedRoot> nodeToRoot(final Node node, final NamespaceMapping mapping)
focal_method.identifier: nodeToRoot
focal_method.invocations: isExclude lastMatch getPath empty setPath getPath getName getPrimaryNodeType isInclude lastMatch toString parseQName setPrimaryType collect filter map of getMixinNodeTypes compose1 toString parseQName isInclude lastMatch toList setMixinTypes of
focal_method.parameters: (final Node node, final NamespaceMapping mapping)
focal_method.return: Optional<ForcedRoot>
focal_method.signature: Optional<ForcedRoot> nodeToRoot(final Node node, final NamespaceMapping mapping)