/** * Create a new path where the attribute at the specified index is replaced * with the one provided. * * @param index The index of the element to replace. * @param attribute The replacement attribute. * @return The new path. */ public Path replace(final int index, final String attribute) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.set(index, new Element(attribute, this.elements.get(index).getValueFilter())); return new Path(schemaUrn, newElements); }
/** * Create a new path where the attribute at the specified index is replaced * with the one provided. * * @param index The index of the element to replace. * @param attribute The replacement attribute. * @return The new path. */ public Path replace(final int index, final String attribute) { List<Element> newElements = new ArrayList<Element>(this.elements); newElements.set(index, new Element(attribute, this.elements.get(index).getValueFilter())); return new Path(schemaUrn, newElements); }
if(element.getValueFilter() != null)
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)
valueFilter = element.getValueFilter(); valueFilter = element.getValueFilter();
valueFilter = element.getValueFilter(); valueFilter = element.getValueFilter();
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; }