Class ResourceTrimmer

    • Method Detail

      • trimObjectNode

        @NotNull
        public com.fasterxml.jackson.databind.node.ObjectNode trimObjectNode​(@NotNull
                                                                             com.fasterxml.jackson.databind.node.ObjectNode objectNode)
        Trim attributes of the object node to return.
        Parameters:
        objectNode - The object node to return.
        Returns:
        The trimmed object node ready to return to the client.
      • trimArrayNode

        @NotNull
        protected com.fasterxml.jackson.databind.node.ArrayNode trimArrayNode​(@NotNull
                                                                              com.fasterxml.jackson.databind.node.ArrayNode arrayNode,
                                                                              @NotNull
                                                                              Path parentPath)
        Trim attributes of the values in the array node to return.
        Parameters:
        arrayNode - The array node to return.
        parentPath - The parent path of attributes in the array.
        Returns:
        The trimmed object node ready to return to the client.
      • shouldReturn

        public abstract boolean shouldReturn​(@NotNull
                                             Path path)
        Determine if the attribute specified by the path should be returned.
        Parameters:
        path - The path for the attribute.
        Returns:
        true to return the attribute or false to remove the attribute from the returned resource.