Helper for _AddMessageMethods().
344386
def _AddSerializePartialToStringMethod(message_descriptor, cls):
  """"""

  def SerializePartialToString(self):
    out = BytesIO()
    self._InternalSerialize(out.write)
    return out.getvalue()
  cls.SerializePartialToString = SerializePartialToString

  def InternalSerialize(self, write_bytes):
    for field_descriptor, field_value in self.ListFields():
      field_descriptor._encoder(write_bytes, field_value)
    for tag_bytes, value_bytes in self._unknown_fields:
      write_bytes(tag_bytes)
      write_bytes(value_bytes)
  cls._InternalSerialize = InternalSerialize
861692
public MethodInfo addMethod(Modifiers modifiers,
                                String methodName,
                                TypeDesc ret,
                                TypeDesc[] params) {
        MethodDesc md = MethodDesc.forArguments(ret, params);
        return addMethod(modifiers, methodName, md);
    }
300908
public void addListeners()
    {
        super.addListeners();
        this.getScreenRecord().getField(MessageInfoScreenRecord.MESSAGE_INFO_ID).setEnabled(true);
        this.getScreenRecord().getField(MessageInfoScreenRecord.MESSAGE_INFO_TYPE_ID).setEnabled(true);
        this.getScreenRecord().getField(MessageInfoScreenRecord.MESSAGE_TYPE_ID).setEnabled(true);
        this.getScreenRecord().getField(MessageInfoScreenRecord.PROCESS_TYPE_ID).setEnabled(true);
        this.getScreenRecord().getField(MessageInfoScreenRecord.CONTACT_TYPE_ID).setEnabled(true);
        this.getScreenRecord().getField(MessageInfoScreenRecord.REQUEST_TYPE_ID).setEnabled(true);
    }
468052
@Nonnull
    public BugInstance addCalledMethod(String className, String methodName, String methodSig, boolean isStatic) {
        return addMethod(MethodAnnotation.fromCalledMethod(className, methodName, methodSig, isStatic)).describe(
                MethodAnnotation.METHOD_CALLED);
    }
580816
public void addWarningMsgs(final Set<String> msgs) {
    if (msgs != null) {
      this._warningMsgs.addAll(msgs);
      if (!msgs.isEmpty() && this._errorMsgs.isEmpty()) {
        this._status = ValidationStatus.WARN;
      }
    }
  }
883786
private void adaptMessage() {
        if (messageTextView != null) {
            messageTextView.setText(message);
            messageTextView.setVisibility(!TextUtils.isEmpty(message) ? View.VISIBLE : View.GONE);
        }

        adaptMessageContainerVisibility();
    }
227492
@Override
    void addMessagingEngine(JsMessagingEngine messagingEngine) throws ResourceException
    {
        final String methodName = "addMessagingEngine";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.entry(this, TRACE, methodName, messagingEngine);
        }
        if ((_destinationStrategy.isNonDurablePubSub()) && (_connections.size() > 0))
        {
            // Ignore for non durable pub sub
            if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
            {
                SibTr.exit(this, TRACE, methodName);
            }
            return;
        }
        else
        {
            clearTimer();
            checkMEs(new JsMessagingEngine[] { messagingEngine });
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.exit(this, TRACE, methodName);
        }
    }
839256
def add_message(request, level, message, extra_tags='', fail_silently=False, *args, **kwargs):
    
    if hasattr(request, '_messages'):
        return request._messages.add(level, message, extra_tags, *args, **kwargs)
    if not fail_silently:
        raise MessageFailure('You cannot add messages without installing '
                             'django.contrib.messages.middleware.MessageMiddleware')
27820
def AddAsMessage(self, rdfvalue_in, source, mutation_pool=None):
    """"""
    self.Add(
        rdf_flows.GrrMessage(payload=rdfvalue_in, source=source),
        mutation_pool=mutation_pool)
1031628
public void addMessageDataDesc(MessageDataParent messageDataDesc)
    {
        if (messageDataDesc instanceof MessageFieldDesc)
        {
            if (m_messageDataDesc == null)
                m_messageDataDesc = new MessageRecordDesc(this, Constant.BLANK);
            m_messageDataDesc.addMessageDataDesc(messageDataDesc);
        }
        else
        {
            m_messageDataDesc = (MessageDataDesc)messageDataDesc;
            if (m_messageDataDesc != null)
                m_messageDataDesc.setMessageDataParent(this);
        }
    }
371497
public void addListeners()
    {
        super.addListeners();
        Map<String,Object> map = Utility.arrayToMap(DESCRIPTIONS);
        ((PropertiesField)this.getField(MessageControl.PROPERTIES)).setMapKeyDescriptions(map);
    }
1229247
void addMessageHandler(SubscriptionMessageHandler messageHandler)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "addMessageHandler", messageHandler);

    final boolean inserted = _subscriptionMessagePool.add(messageHandler);
    // If the message wasn't inserted, then the pool was exceeded
    if (!inserted)
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(
          tc,
         "SubscriptionObjectPool size exceeded");

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "addMessageHandler");
  }
278325
function addMethod(name, method) {
        if (method !== undefined) {
            methods[name] = method;
        }
        return methods[name];
    }
976135
public @Nonnull StaticMessageSource addMessage(@Nonnull Locale locale, @Nonnull String code, @Nonnull String message) {
        ArgumentUtils.requireNonNull("locale", locale);
        if (StringUtils.isNotEmpty(code) && StringUtils.isNotEmpty(message)) {
            messageMap.put(new MessageKey(locale, code), message);
        }
        return this;
    }
335426
def addMethod(self, m):
        
        if m.nargs == -1:
            m.nargs = len([a for a in marshal.genCompleteTypes(m.sigIn)])
            m.nret = len([a for a in marshal.genCompleteTypes(m.sigOut)])
        self.methods[m.name] = m
        self._xml = None
230714
function() {
    var self = this;
    if (_.isEmpty(self._outstandingMethodBlocks))
      return;
    _.each(self._outstandingMethodBlocks[0].methods, function (m) {
      m.sendMessage();
    });
  }
257691
public function addMessageInvalid($message_args)
    {
        $this->saveButtonId = null;
        $this->saveLabel    = null;

        parent::addMessage(func_get_args());
    }