public NodePathValueHolder<T> put(final NodePath nodePath, final T value) { put(nodePath.getElementSelectors(), value); return this; }
public static NodePath with(final String propertyName, final String... additionalPropertyNames) { return startBuilding().propertyName(propertyName, additionalPropertyNames).build(); }
public static NodePath withRoot() { return startBuilding().build(); }
private static NodePath getNodePath(final DiffNode parentNode, final Instances instances) { if (parentNode == null) { return NodePath.withRoot(); } else { final NodePath parentPath = parentNode.getPath(); final ElementSelector elementSelector = instances.getSourceAccessor().getElementSelector(); return NodePath.startBuildingFrom(parentPath).element(elementSelector).build(); } }
public List<T> accumulatedValuesForNodePath(final NodePath nodePath) { final List<T> accumulator = new LinkedList<T>(); visit(accumulator, nodePath.getElementSelectors().iterator()); return accumulator; }
public static AppendableBuilder startBuildingFrom(final NodePath nodePath) { Assert.notNull(nodePath, "propertyPath"); return new AppendableBuilderImpl(new ArrayList<ElementSelector>(nodePath.getElementSelectors())); }
public ComparisonConfigurer toUse(final ComparisonStrategy comparisonStrategy) { nodePathComparisonStrategies.put(nodePath, comparisonStrategy); return ComparisonService.this; } }
public boolean isParentOf(final NodePath nodePath) { final List<ElementSelector> otherElementSelectors = nodePath.getElementSelectors(); if (elementSelectors.size() < otherElementSelectors.size()) { return otherElementSelectors.subList(0, elementSelectors.size()).equals(elementSelectors); } return false; }
@Override public String toString() { return nodePath.toString() + "{" + instance.toString() + "}"; } }
public void collect(final Collector<T> collector) { collect(null, collector); }
public boolean matches(final NodePath nodePath) { return nodePath.equals(this); }
public static <T> NodePathValueHolder<T> of(final Class<T> type) { Assert.notNull(type, "type"); return new NodePathValueHolder<T>(); }
public boolean matches(final NodePath path) { return path.matches(getPath()); }
public T valueForNodePath(final NodePath nodePath) { return visit(new LinkedList<T>(), nodePath.getElementSelectors().iterator()); }
public CategoryConfigurer toBe(final String... categories) { nodePathCategories.put(nodePath, categories); return CategoryService.this; } };
public boolean isChildOf(final NodePath nodePath) { final List<ElementSelector> otherElementSelectors = nodePath.getElementSelectors(); if (elementSelectors.size() > otherElementSelectors.size()) { return elementSelectors.subList(0, otherElementSelectors.size()).equals(otherElementSelectors); } return false; }
public void it(final NodePath path, final T value) { stringBuilder.append(path.toString()).append(" => ").append(value).append('\n'); } });
public IntrospectionConfigurer toBeDisabled() { nodePathIntrospectionModeHolder.put(path, IntrospectionMode.DISABLED); return IntrospectionService.this; } };
public IntrospectionConfigurer toUse(final Introspector introspector) { nodePathIntrospectorHolder.put(path, introspector); return IntrospectionService.this; }
public IntrospectionConfigurer toBeEnabled() { nodePathIntrospectionModeHolder.put(path, IntrospectionMode.ENABLED); return IntrospectionService.this; }