Class AddOperation

  • All Implemented Interfaces:
    com.fasterxml.jackson.databind.JsonSerializable, com.github.fge.jsonpatch.operation.JsonPatchOperation, CidsBeanPatchOperation

    public class AddOperation
    extends com.github.fge.jsonpatch.operation.AddOperation
    implements CidsBeanPatchOperation
    DOCUMENT ME!
    Version:
    $Revision$, $Date$
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.fasterxml.jackson.databind.JsonSerializable

        com.fasterxml.jackson.databind.JsonSerializable.Base
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected com.github.fge.jsonpatch.operation.ReplaceOperation jsonPatchReplaceOperation  
      protected static org.apache.log4j.Logger LOGGER  
      protected boolean overwrite  
      protected static ResourceBundle RESOURCE_BUNDLE  
      protected static CidsBeanPatchUtils UTILS  
      • Fields inherited from class com.github.fge.jsonpatch.operation.AddOperation

        LAST_ARRAY_ELEMENT, OPERATION_NAME
      • Fields inherited from class com.github.fge.jsonpatch.operation.PathValueOperation

        BUNDLE, op, path, value
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        AddOperation​(com.github.fge.jackson.jsonpointer.JsonPointer path, com.fasterxml.jackson.databind.JsonNode value)
      Creates a new AddOperation valueObject.
      protected AddOperation​(com.github.fge.jackson.jsonpointer.JsonPointer path, com.fasterxml.jackson.databind.JsonNode value, boolean overwrite)
      Creates a new AddOperation valueObject.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addToArray​(List parentList)
      DOCUMENT ME!
      protected void addToObject​(de.cismet.cids.dynamics.CidsBean parentBean)
      DOCUMENT ME!
      com.fasterxml.jackson.databind.JsonNode apply​(com.fasterxml.jackson.databind.JsonNode node)  
      de.cismet.cids.dynamics.CidsBean apply​(de.cismet.cids.dynamics.CidsBean cidsBean)
      Apply this operation to a JSON value.
      static <T> T getLast​(Iterable<T> iterable)
      DOCUMENT ME!
      • Methods inherited from class com.github.fge.jsonpatch.operation.AddOperation

        addToArray, addToObject
      • Methods inherited from class com.github.fge.jsonpatch.operation.PathValueOperation

        serialize, serializeWithType, toString
      • Methods inherited from interface com.github.fge.jsonpatch.operation.JsonPatchOperation

        toString
      • Methods inherited from interface com.fasterxml.jackson.databind.JsonSerializable

        serialize, serializeWithType
    • Field Detail

      • LOGGER

        protected static final org.apache.log4j.Logger LOGGER
      • RESOURCE_BUNDLE

        protected static final ResourceBundle RESOURCE_BUNDLE
      • jsonPatchReplaceOperation

        protected final com.github.fge.jsonpatch.operation.ReplaceOperation jsonPatchReplaceOperation
      • overwrite

        protected final boolean overwrite
    • Constructor Detail

      • AddOperation

        public AddOperation​(com.github.fge.jackson.jsonpointer.JsonPointer path,
                            com.fasterxml.jackson.databind.JsonNode value)
        Creates a new AddOperation valueObject.
        Parameters:
        path - DOCUMENT ME!
        value - DOCUMENT ME!
      • AddOperation

        protected AddOperation​(com.github.fge.jackson.jsonpointer.JsonPointer path,
                               com.fasterxml.jackson.databind.JsonNode value,
                               boolean overwrite)
        Creates a new AddOperation valueObject.
        Parameters:
        path - DOCUMENT ME!
        value - DOCUMENT ME!
        overwrite - DOCUMENT ME!
    • Method Detail

      • apply

        public com.fasterxml.jackson.databind.JsonNode apply​(com.fasterxml.jackson.databind.JsonNode node)
                                                      throws com.github.fge.jsonpatch.JsonPatchException
        Specified by:
        apply in interface com.github.fge.jsonpatch.operation.JsonPatchOperation
        Overrides:
        apply in class com.github.fge.jsonpatch.operation.AddOperation
        Throws:
        com.github.fge.jsonpatch.JsonPatchException
      • apply

        public de.cismet.cids.dynamics.CidsBean apply​(de.cismet.cids.dynamics.CidsBean cidsBean)
                                               throws com.github.fge.jsonpatch.JsonPatchException
        Description copied from interface: CidsBeanPatchOperation
        Apply this operation to a JSON value.
        Specified by:
        apply in interface CidsBeanPatchOperation
        Parameters:
        cidsBean - the value to patch
        Returns:
        the patched value
        Throws:
        com.github.fge.jsonpatch.JsonPatchException - com.github.fge.jsonpatch.JsonPatchException operation failed to apply to this value
      • addToArray

        protected void addToArray​(List parentList)
                           throws com.github.fge.jsonpatch.JsonPatchException
        DOCUMENT ME!
        Parameters:
        parentList - DOCUMENT ME!
        Throws:
        com.github.fge.jsonpatch.JsonPatchException - DOCUMENT ME!
      • getLast

        public static <T> T getLast​(Iterable<T> iterable)
        DOCUMENT ME!
        Type Parameters:
        T - DOCUMENT ME!
        Parameters:
        iterable - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
        Throws:
        NoSuchElementException - DOCUMENT ME!
      • addToObject

        protected void addToObject​(de.cismet.cids.dynamics.CidsBean parentBean)
                            throws com.github.fge.jsonpatch.JsonPatchException
        DOCUMENT ME!
        Parameters:
        parentBean - DOCUMENT ME!
        Throws:
        com.github.fge.jsonpatch.JsonPatchException - DOCUMENT ME!