/** * Create a new path from this path with any value filters removed. * * @return A new path from this path with any value filters removed. */ public Path withoutFilters() { ArrayList<Element> newElements = new ArrayList<Element>(elements.size()); for(Element element : elements) { newElements.add(new Element(element.getAttribute(), null)); } return new Path(schemaUrn, newElements); }
/** * Create a new path where the filter at the specified index is replaced with * the one provided. * * @param index The index of the element to replace. * @param valueFilter The replacement value filter. * @return The new path. */ public Path replace(final int index, final Filter valueFilter) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.set(index, new Element(this.elements.get(index).getAttribute(), valueFilter)); return new Path(schemaUrn, newElements); }
/** * Create a new path from this path with any value filters removed. * * @return A new path from this path with any value filters removed. */ public Path withoutFilters() { ArrayList<Element> newElements = new ArrayList<Element>(elements.size()); for(Element element : elements) { newElements.add(new Element(element.getAttribute(), null)); } return new Path(schemaUrn, newElements); }
field = element.getAttribute(); valueFilter = element.getValueFilter(); field = element.getAttribute(); valueFilter = element.getValueFilter();
path.getElement(path.size() - 1).getAttribute() + "[" + i + "]"); checkAttributeValue(prefix, value, valuePath, attribute, results, currentObjectNode, isPartialReplace, isPartialAdd);
field = element.getAttribute(); valueFilter = element.getValueFilter(); field = element.getAttribute(); valueFilter = element.getValueFilter();
if (path.getElement(0).getAttribute().equalsIgnoreCase("value"))
/** * Create a new patch operation. * * @param path The path targeted by this patch operation. * @throws ScimException If an value is not valid. */ PatchOperation(final Path path) throws ScimException { if(path != null) { if(path.size() > 2) { throw BadRequestException.invalidPath( "Path can not target sub-attributes more than one level deep"); } if(path.size() == 2) { Filter valueFilter = path.getElement(1).getValueFilter(); // Allow use of the special case "value" path to reference the value itself. // Any other value filter is for a sub-attribute, which is not permitted. if (valueFilter != null && !valueFilter.getAttributePath().getElement(0).getAttribute().equals("value")) { throw BadRequestException.invalidPath( "Path can not include a value filter on sub-attributes"); } } } this.path = path; }
/** * Create a new patch operation. * * @param path The path targeted by this patch operation. * @throws ScimException If an value is not valid. */ PatchOperation(final Path path) throws ScimException { if(path != null) { if(path.size() > 2) { throw BadRequestException.invalidPath( "Path can not target sub-attributes more than one level deep"); } if(path.size() == 2) { Filter valueFilter = path.getElement(1).getValueFilter(); // Allow use of the special case "value" path to reference the value itself. // Any other value filter is for a sub-attribute, which is not permitted. if (valueFilter != null && !valueFilter.getAttributePath().getElement(0).getAttribute().equals("value")) { throw BadRequestException.invalidPath( "Path can not include a value filter on sub-attributes"); } } } this.path = path; }
/** * Create a new path where the filter at the specified index is replaced with * the one provided. * * @param index The index of the element to replace. * @param valueFilter The replacement value filter. * @return The new path. */ public Path replace(final int index, final Filter valueFilter) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.set(index, new Element(this.elements.get(index).getAttribute(), valueFilter)); return new Path(schemaUrn, newElements); }