Class ResourcePatch<M>


  • @Component
    public class ResourcePatch<M>
    extends Object
    The base class for resource PATCH operations.
    • Constructor Detail

      • ResourcePatch

        public ResourcePatch()
    • Method Detail

      • patch

        public void patch​(org.dspace.core.Context context,
                          M dso,
                          List<Operation> operations)
                   throws SQLException
        Handles the patch operations. Patch implementations are provided by subclasses. The default methods throw an UnprocessableEntityException.
        Parameters:
        context - Context of patch operation
        dso - the dso resource to patch
        operations - list of patch operations
        Throws:
        UnprocessableEntityException
        DSpaceBadRequestException
        SQLException
      • performPatchOperation

        protected void performPatchOperation​(org.dspace.core.Context context,
                                             M object,
                                             Operation operation)
                                      throws DSpaceBadRequestException,
                                             SQLException
        Checks with all possible patch operations whether they support this operation (based on instanceof dso and operation.path)
        Parameters:
        context - Context of patch operation
        object - the resource to patch
        operation - the patch operation
        Throws:
        DSpaceBadRequestException
        SQLException