/** * Create a new path to the sub-attribute path of the attribute referenced by * this path. * * @param path The path of the sub-attribute. * * @return A new path to a sub-attribute of the attribute referenced by this * path. */ public Path attribute(final Path path) { List<Element> newElements = new ArrayList<Element>( this.elements.size() + path.size()); newElements.addAll(this.elements); newElements.addAll(path.elements); return new Path(schemaUrn, newElements); }
/** * Create a new path to the sub-attribute path of the attribute referenced by * this path. * * @param path The path of the sub-attribute. * * @return A new path to a sub-attribute of the attribute referenced by this * path. */ public Path attribute(final Path path) { List<Element> newElements = new ArrayList<Element>( this.elements.size() + path.size()); newElements.addAll(this.elements); newElements.addAll(path.elements); return new Path(schemaUrn, newElements); }
if(path.size() > 1 || path.getSchemaUrn() == 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; }
"Path should always point to an attribute"); Path parentPath = path.subPath(path.size() - 1); Path valuePath = parentPath.attribute( path.getElement(path.size() - 1).getAttribute() + "[" + i + "]"); checkAttributeValue(prefix, value, valuePath, attribute, results, currentObjectNode, isPartialReplace, isPartialAdd);
final List<String> messages) if(path.size() > 1)
if(parentPath.size() == 0)
path.size() == 1)
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)
Filter valueFilter = path == null ? null : path.getElement(path.size() - 1).getValueFilter(); AttributeDefinition attribute = path == null ? null : resourceType.getAttributeDefinition(path);