/** * 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); }
if(element.getValueFilter() != null)
/** * Append the string representation of the attribute path to the provided * buffer. * * @param builder The buffer to which the string representation of the * attribute path is to be appended. */ public void toString(final StringBuilder builder) { if(schemaUrn != null) { builder.append(schemaUrn); builder.append(":"); } Iterator<Element> i = elements.iterator(); while(i.hasNext()) { i.next().toString(builder); if(i.hasNext()) { builder.append("."); } } } }
Filter valueFilter = path == null ? null : path.getElement(path.size() - 1).getValueFilter(); AttributeDefinition attribute = path == null ? null : resourceType.getAttributeDefinition(path);
path.getElement(path.size()-1).getValueFilter() == null)
path.getElement(path.size()-1).getValueFilter() == null)
Filter valueFilter = path.getElement(path.size() - 1).getValueFilter(); if(attribute.equals(SchemaUtils.SCHEMAS_ATTRIBUTE_DEFINITION) && valueFilter != null)
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();
field = element.getAttribute(); valueFilter = element.getValueFilter(); field = element.getAttribute(); valueFilter = element.getValueFilter();
if (path.getElement(0).getAttribute().equalsIgnoreCase("value"))
if(element.getValueFilter() != null)
/** * 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; }
/** * Append the string representation of the attribute path to the provided * buffer. * * @param builder The buffer to which the string representation of the * attribute path is to be appended. */ public void toString(final StringBuilder builder) { if(schemaUrn != null) { builder.append(schemaUrn); builder.append(":"); } Iterator<Element> i = elements.iterator(); while(i.hasNext()) { i.next().toString(builder); if(i.hasNext()) { builder.append("."); } } } }
/** * Create a new path where the attribute and filter at the specified index * is replaced with those provided. * * @param index The index of the element to replace. * @param attribute The replacement attribute. * @param valueFilter The replacement value filter. * @return The new path. */ public Path replace(final int index, final String attribute, final Filter valueFilter) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.set(index, new Element(attribute, valueFilter)); return new Path(schemaUrn, newElements); }
/** * Create a new path to a sub-set of values of a sub-attribute of the * attribute referenced by this path. * * @param attribute The name of the sub-attribute. * @param valueFilter The value filter. * * @return A new path to a sub-attribute of the attribute referenced by this * path. */ public Path attribute(final String attribute, final Filter valueFilter) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.add(new Element(attribute, valueFilter)); return new Path(schemaUrn, newElements); }
/** * Create a new path where the attribute and filter at the specified index * is replaced with those provided. * * @param index The index of the element to replace. * @param attribute The replacement attribute. * @param valueFilter The replacement value filter. * @return The new path. */ public Path replace(final int index, final String attribute, final Filter valueFilter) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.set(index, new Element(attribute, valueFilter)); return new Path(schemaUrn, newElements); }
/** * Create a new path to a sub-attribute of the attribute referenced by this * path. * * @param attribute The name of the sub-attribute. * * @return A new path to a sub-attribute of the attribute referenced by this * path. */ public Path attribute(final String attribute) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.add(new Element(attribute, null)); return new Path(schemaUrn, newElements); }
/** * Create a new path to a sub-set of values of a sub-attribute of the * attribute referenced by this path. * * @param attribute The name of the sub-attribute. * @param valueFilter The value filter. * * @return A new path to a sub-attribute of the attribute referenced by this * path. */ public Path attribute(final String attribute, final Filter valueFilter) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.add(new Element(attribute, valueFilter)); return new Path(schemaUrn, newElements); }