public class PatchTargetHandler extends AbstractPatch
The result of the add operation depends upon what the target location
indicated by "path" references:
o If the target location does not exist, the attribute and value are
added.
o If the target location specifies a complex attribute, a set of
sub-attributes SHALL be specified in the "value" parameter.
o If the target location specifies a multi-valued attribute, a new
value is added to the attribute.
o If the target location specifies a single-valued attribute, the
existing value is replaced.
o If the target location specifies an attribute that does not exist
(has no value), the attribute is added with the new value.
o If the target location exists, the value is replaced.
o If the target location already contains the value specified, no
changes SHOULD be made to the resource, and a success response
SHOULD be returned. Unless other operations change the resource,
this operation SHALL NOT change the modify timestamp of the
resource.
resourceType| Constructor and Description |
|---|
PatchTargetHandler(ResourceType resourceType,
PatchOp patchOp,
String path) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addOperationValues(ResourceNode resource,
List<String> values)
will add the specified values into the specified path
|
protected boolean |
handleSimpleNode(SchemaAttribute schemaAttribute,
com.fasterxml.jackson.databind.node.ObjectNode objectNode,
List<String> values)
adds or replaces a simple node in the given object node
|
protected void |
validateRequest(List<String> values)
will check that the expressions are correctly written for the defined patch operation
|
getAttributeFromObject, getSchemaAttributepublic PatchTargetHandler(ResourceType resourceType, PatchOp patchOp, String path)
public boolean addOperationValues(ResourceNode resource, List<String> values)
resource - the resource to which the values should be addedvalues - the values that should be added into the resourceprotected boolean handleSimpleNode(SchemaAttribute schemaAttribute, com.fasterxml.jackson.databind.node.ObjectNode objectNode, List<String> values)
schemaAttribute - the attribute schema definitionobjectNode - the object node into which the new node should be added or replacedvalues - the values that should be added to the node. This list must not contain more than a single
entryCopyright © 2019. All rights reserved.