Method that detaches all fields contained in the document to the given object

@param self
:- The object containing this handler instance
@throws InvocationTargetException
@throws IllegalAccessException
@throws NoSuchMethodException
425132
public void detach(Object self) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
		for (String fieldName : doc.fieldNames()) {
			Object value = getValue(self, fieldName, false, null);
			if (value instanceof OLazyObjectMultivalueElement)
				((OLazyObjectMultivalueElement) value).detach();
			OObjectEntitySerializer.setFieldValue(getField(fieldName, self.getClass()), self, value);
		}
		OObjectEntitySerializer.setIdField(self.getClass(), self, doc.getIdentity());
		OObjectEntitySerializer.setVersionField(self.getClass(), self, doc.getVersion());
	}
356925
def (self, method):
        
        def _handler(callback, schema=None):
            """
            _handler
            """
            # reentrant default is False [POST, DELETE, PUT]
            reentrant = False
            if method == "get":
                reentrant = True

            self.handlers.append({
                "method": method,
                "callback": callback,
                "schema": schema,
                "reentrant": reentrant
            })
            return self

        return _handler
1065513
static void detach() {
        map.get().kill();
        try {
          map.get().join();
        } catch (InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        map.remove();
    }
1010886
public void detach() throws SIResourceException, SINotPossibleInCurrentConfigurationException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "detach");

    // Make sure we are not ready
    notReady();

    // Remove us from any group we are a member of
    if(keyGroup != null)
      keyGroup.removeMember(this);

    // Remove this consumer from the CD's knowledge
    consumerDispatcher.detachConsumerPoint(this);

    // Cleanly dispose of the getCursor
    if(classifyingMessages)
    {
      // Take the classifications read lock
      consumerSet.takeClassificationReadLock();
      
      int numFilters = consumerKeyFilter.length;
      for(int i=0;i<numFilters;i++)
        consumerKeyFilter[i].detach();
      
      // Free the classifications read lock
      consumerSet.freeClassificationReadLock();
    }
    else
      consumerKeyFilter[0].detach();

    synchronized (this)
    {
      detached = true;
    }
    
    // Remove the consumerPoint to the consumerSet if the latter has been specified
    if(classifyingMessages)
      consumerSet.removeConsumer(consumerPoint); 
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "detach");
  }
796864
@SuppressWarnings("unchecked")
	public static <S extends Serializable> S invokeGetter(Object object, Field field)
	{
		Method m = ReflectionUtils.findMethod(object.getClass(), ReflectUtils.toGetter(field.getName()));
		if (null == m) {
			for (String prefix : PREFIXES) {
				 m = ReflectionUtils.findMethod(object.getClass(), ReflectUtils.toGetter(field.getName(), prefix));
				 if (null != m) {
					 break;
				 }
			}
		}
		return (S) ReflectionUtils.invokeMethod(m, object);
	}
1195405
public static void println(Closure self, Object value) {
        Object owner = getClosureOwner(self);
        InvokerHelper.invokeMethod(owner, "println", new Object[]{value});
    }
18481
public void destroy()
    {
        Iterator iter = _nameMap.values().iterator();
        while (iter.hasNext())
        {
            Object sh=iter.next();
            iter.remove();
            removeComponent(sh);
        }
        
        if (_sessionManager!=null)
            removeComponent(_sessionManager);
        _sessionManager=null;
        _context=null;
        super.destroy();
    }
1117750
def detach(*args)
      listener = args.last
      case listener
      when vm.Listener
        @events.delete(listener)
        listener.detach
      when vm.Filter
        @filters.delete(listener)
        listener.detach
      when Enumerable
        listener.each(&method(:detach))
      else
        raise ArgumentError, "Argument must be Pluggaloid::Listener, Pluggaloid::Filter, Pluggaloid::HandlerTag or Enumerable. But given #{listener.class}."
      end
      self end
1346620
private void detach() {
        // Do not call setVisible(false) here: that would make it invisible by default (detach() is called in attach())

        if (decoratedComponent != null) {
            decoratedComponent.removeComponentListener(decoratedComponentTracker);
            decoratedComponent.removeAncestorListener(decoratedComponentTracker);
            decoratedComponent.removeHierarchyBoundsListener(decoratedComponentTracker);
            decoratedComponent.removeHierarchyListener(decoratedComponentTracker);
            decoratedComponent.removePropertyChangeListener("enabled", decoratedComponentTracker);
            decoratedComponent.removePropertyChangeListener("ancestor", decoratedComponentTracker);
            decoratedComponent = null;

            detachFromLayeredPane();
        }
    }
1148738
@Override
    public void detach() {
        super.detach();
        modules.getFilesModule().unbindFile(location.getFileId(), callback, false);
    }
1049673
@Programmatic
    public <T> T paperclipAttaches(final Document document, Class<T> typeAttachedTo) {
        final List<Paperclip> paperclips = findByDocument(document);
        for (Paperclip paperclip : paperclips) {
            final Object attachedTo = paperclip.getAttachedTo();
            if(typeAttachedTo.isAssignableFrom(attachedTo.getClass())) {
                return (T) attachedTo;
            }
        }
        return null;
    }
1112638
@Override
  public void removeHandler(Handler handler)
  {
    synchronized (this) {
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      
      if (loader == null) {
        loader = _systemClassLoader;
      }

      for (int i = _loaders.size() - 1; i >= 0; i--) {
        WeakReference<ClassLoader> ref = _loaders.get(i);
        ClassLoader refLoader = ref.get();

        if (refLoader == null) {
          _loaders.remove(i);
        }

        if (isParentLoader(loader, refLoader)) {
          removeHandler(handler, refLoader);
        }
      }

      HandlerEntry ownHandlers = _ownHandlers.get();
      if (ownHandlers != null)
        ownHandlers.removeHandler(handler);
    }
  }
1021401
def destroy(self, request, *args, **kwargs):
        
        obj = self.get_object()
        user = request.user

        if strtobool(request.query_params.get('delete_content', 'false')):
            for data in obj.data.all():
                if user.has_perm('edit_data', data):
                    data.delete()

            # If all data objects in an entity are removed, the entity may
            # have already been removed, so there is no need to call destroy.
            if not Entity.objects.filter(pk=obj.pk).exists():
                return Response(status=status.HTTP_204_NO_CONTENT)

        # NOTE: Collection's ``destroy`` method should be skiped, so we
        # intentionaly call it's parent.
        return super(CollectionViewSet, self).destroy(  # pylint: disable=no-member,bad-super-call
            request, *args, **kwargs
        )
1011757
public function delete()
    {
        if (!$this->isLoaded()) {
            //Nothing to do, do we need an exception here?
            return;
        }

        $this->dispatch('delete', new DocumentEvent($this));

        //Performing deletion
        $this->odm->collection(static::class)->deleteOne(['_id' => $this->primaryKey()]);
        $this->setField('_id', null, false);
        //Done with deletion

        $this->dispatch('deleted', new DocumentEvent($this));
    }
505311
public void onDetach() {
		this.getOverlayManager().onDetach(this);
		mTileProvider.detach();
		mOldZoomController.setVisible(false);
		if (mZoomController != null) {
			mZoomController.onDetach();
		}

		//https://github.com/osmdroid/osmdroid/issues/390
		if (mTileRequestCompleteHandler instanceof SimpleInvalidationHandler) {
			((SimpleInvalidationHandler) mTileRequestCompleteHandler).destroy();
		}
		mTileRequestCompleteHandler=null;
		if (mProjection!=null)
			mProjection.detach();
		mProjection=null;
		mRepository.onDetach();
		mListners.clear();
	}
706489
function detach() {
                if (!this._placeholder) {
                    this._placeholder = document.createElement(this.el.tagName);
                }
                if (!this._parent) {
                    this._parent = this.el.parentNode;
                }

                if (this.el && this._parent) {
                    this._parent.replaceChild(this._placeholder, this.el);
                }
            }
800692
function() {
      if (this.__attachedCallbackInvoked) {
        this.trigger('before-detached-callback');
        this._detached();
        this.__attachedCallbackInvoked = false;
      }
      _.each(this.getTrackedViews(), function(view) {
        // If the tracked view is currently attached to the parent, then invoke detatched on it.
        if (view.isAttachedToParent()) {
          view.__invokeDetached();
        }
      });
    }