@NotNull @Override public Iterable<String> getStrings(@NotNull String name) { return delegate.getStrings(name); }
@NotNull @Override public Iterable<String> getStrings(@NotNull String name) { return delegate.getStrings(name); }
NameValidator(NodeState namespaces, boolean initPhase) { this.namespaces = namespaces; this.prefixes = newHashSet(namespaces.getChildNode(REP_NSDATA).getStrings(REP_PREFIXES)); this.initPhase = initPhase; }
NameValidator(NodeState namespaces, boolean initPhase) { this.namespaces = namespaces; this.prefixes = newHashSet(namespaces.getChildNode(REP_NSDATA).getStrings(REP_PREFIXES)); this.initPhase = initPhase; }
private static boolean containsValue(NodeState namespaces, String value) { return Iterables.contains(namespaces.getChildNode(REP_NSDATA).getStrings(REP_URIS), value); }
private static boolean containsValue(NodeState namespaces, String value) { return Iterables.contains(namespaces.getChildNode(REP_NSDATA).getStrings(REP_URIS), value); }
public static DocumentBundlor from(NodeState nodeState){ checkArgument(nodeState.hasProperty(PROP_PATTERN), "NodeState [%s] does not have required " + "property [%s]", nodeState, PROP_PATTERN); return DocumentBundlor.from(nodeState.getStrings(PROP_PATTERN)); }
public static DocumentBundlor from(NodeState nodeState){ checkArgument(nodeState.hasProperty(PROP_PATTERN), "NodeState [%s] does not have required " + "property [%s]", nodeState, PROP_PATTERN); return DocumentBundlor.from(nodeState.getStrings(PROP_PATTERN)); }
public void compute(String basePath, Set<String> indexPaths) { NodeState root = nodeStore.getRoot(); for (String indexPath : indexPaths) { NodeState idxState = NodeStateUtils.getNode(root, indexPath); //No include exclude specified so include all if (!idxState.hasProperty(PROP_INCLUDED_PATHS) && !idxState.hasProperty(PROP_EXCLUDED_PATHS)) { includeAll = true; return; } Iterables.addAll(includes, idxState.getStrings(PROP_INCLUDED_PATHS)); Iterables.addAll(excludes, idxState.getStrings(PROP_EXCLUDED_PATHS)); } if (includes.isEmpty()) { includes.add(basePath); } PathUtils.unifyInExcludes(includes, excludes); }
public void compute(String basePath, Set<String> indexPaths) { NodeState root = nodeStore.getRoot(); for (String indexPath : indexPaths) { NodeState idxState = NodeStateUtils.getNode(root, indexPath); //No include exclude specified so include all if (!idxState.hasProperty(PROP_INCLUDED_PATHS) && !idxState.hasProperty(PROP_EXCLUDED_PATHS)) { includeAll = true; return; } Iterables.addAll(includes, idxState.getStrings(PROP_INCLUDED_PATHS)); Iterables.addAll(excludes, idxState.getStrings(PROP_EXCLUDED_PATHS)); } if (includes.isEmpty()) { includes.add(basePath); } PathUtils.unifyInExcludes(includes, excludes); }
public void compute(String basePath, Set<String> indexPaths) { NodeState root = nodeStore.getRoot(); for (String indexPath : indexPaths) { NodeState idxState = NodeStateUtils.getNode(root, indexPath); //No include exclude specified so include all if (!idxState.hasProperty(PROP_INCLUDED_PATHS) && !idxState.hasProperty(PROP_EXCLUDED_PATHS)) { includeAll = true; return; } Iterables.addAll(includes, idxState.getStrings(PROP_INCLUDED_PATHS)); Iterables.addAll(excludes, idxState.getStrings(PROP_EXCLUDED_PATHS)); } if (includes.isEmpty()) { includes.add(basePath); } PathUtils.unifyInExcludes(includes, excludes); }
public static Iterable<String> getStrings(NodeState node, String propertyName) { if (!node.hasProperty(propertyName)) { return null; } PropertyState s = node.getProperty(propertyName); if (s.isArray()) { return node.getStrings(propertyName); } return Collections.singleton(node.getString(propertyName)); }
public static Iterable<String> getStrings(NodeState node, String propertyName) { if (!node.hasProperty(propertyName)) { return null; } PropertyState s = node.getProperty(propertyName); if (s.isArray()) { return node.getStrings(propertyName); } return Collections.singleton(node.getString(propertyName)); }
public static Iterable<String> getStrings(NodeState node, String propertyName) { if (!node.hasProperty(propertyName)) { return null; } PropertyState s = node.getProperty(propertyName); if (s.isArray()) { return node.getStrings(propertyName); } return Collections.singleton(node.getString(propertyName)); }
@Override public Validator getRootValidator( NodeState before, NodeState after, CommitInfo info) { return new NameValidator(newHashSet(after .getChildNode(JCR_SYSTEM) .getChildNode(REP_NAMESPACES) .getChildNode(REP_NSDATA) .getStrings(REP_PREFIXES))); }
for (String nestedCug : before.getStrings(HIDDEN_NESTED_CUGS)) { if (!deletedCUGs.contains(nestedCug)) { String relPath = PathUtils.relativize(path, nestedCug);
for (String nestedCug : before.getStrings(HIDDEN_NESTED_CUGS)) { if (!deletedCUGs.contains(nestedCug)) { String relPath = PathUtils.relativize(path, nestedCug);
assertEquals(firstCp, asyncNode.getString("async-slow")); assertEquals(secondCp, asyncNode.getString("async")); assertFalse(newHashSet(asyncNode.getStrings("async-temp")).contains( firstCp));
@Test public void getPropertyReportsProperty() { final NodeBuilder builder = EmptyNodeState.EMPTY_NODE.builder(); final String name = "meaningOfLife"; builder.setProperty(name, "42"); final AssertingPeriodicReporter reporter = new AssertingPeriodicReporter(1, 1); final NodeState nodeState = ReportingNodeState.wrap(builder.getNodeState(), reporter); reporter.reset(); // 7 accesses via 7 methods nodeState.getProperty(name); nodeState.getBoolean(name); nodeState.getLong(name); nodeState.getString(name); nodeState.getStrings(name); nodeState.getName(name); nodeState.getNames(name); assertThat(reporter, not(hasReportedProperty(0, "/meaningOfLife"))); assertThat(reporter, hasReportedProperty(1, "/meaningOfLife")); assertThat(reporter, hasReportedProperty(2, "/meaningOfLife")); assertThat(reporter, hasReportedProperty(3, "/meaningOfLife")); assertThat(reporter, hasReportedProperty(4, "/meaningOfLife")); assertThat(reporter, hasReportedProperty(5, "/meaningOfLife")); assertThat(reporter, hasReportedProperty(6, "/meaningOfLife")); assertThat(reporter, hasReportedProperty(7, "/meaningOfLife")); assertThat(reporter, not(hasReportedProperty(8, "/meaningOfLife"))); }
NodeState indexedState = getNode(indexed, "/oak:index/foo/" + getNodeForMount(defMount) + "/abc"); assertTrue(indexedState.exists()); Iterable<String> values = indexedState.getStrings("entry"); assertEquals(1, Iterables.size(values)); assertEquals("/content", Iterables.getFirst(values, null));