Examples of withBody()


Examples of akka.camel.CamelMessage.withBody()

  public void onReceive(Object message) {
    if (message instanceof CamelMessage) {
      CamelMessage camelMessage = (CamelMessage) message;
      // Forward a string representation of the message body to transformer
      String body = camelMessage.getBodyAs(String.class, getCamelContext());
      transformer.forward(camelMessage.withBody(body), getContext());
    } else
      unhandled(message);
  }
}
View Full Code Here

Examples of com.google.appengine.api.xmpp.MessageBuilder.withBody()

        // sets the body of the message
        if (msgAttr.containsKey(XML_BODY_ATTR)) {
            msgBuilder.asXml(true);
            Object xml = new StreamingMarkupBuilder().bind(msgAttr.get(XML_BODY_ATTR));
            msgBuilder.withBody(String.valueOf(xml));
        } else if (msgAttr.containsKey(TEXT_BODY_ATTR)) {
            msgBuilder.withBody(String.valueOf(msgAttr.get(TEXT_BODY_ATTR)));
        }

        // sets the recepients of the message
View Full Code Here

Examples of com.google.appengine.api.xmpp.MessageBuilder.withBody()

        if (msgAttr.containsKey(XML_BODY_ATTR)) {
            msgBuilder.asXml(true);
            Object xml = new StreamingMarkupBuilder().bind(msgAttr.get(XML_BODY_ATTR));
            msgBuilder.withBody(String.valueOf(xml));
        } else if (msgAttr.containsKey(TEXT_BODY_ATTR)) {
            msgBuilder.withBody(String.valueOf(msgAttr.get(TEXT_BODY_ATTR)));
        }

        // sets the recepients of the message
        if (msgAttr.containsKey(TO_ATTR)) {
            Object to = msgAttr.get(TO_ATTR);
View Full Code Here

Examples of com.google.appengine.api.xmpp.MessageBuilder.withBody()

        MessageBuilder builder = new MessageBuilder();
        builder.withMessageType(MessageType.valueOf("CHAT"));
        builder.withFromJid(fromJID);
        builder.withRecipientJids(toJID);
        String testBody = TEST_BODY + System.currentTimeMillis();
        builder.withBody(testBody);
        builder.asXml(false);
        Message msg = builder.build();

        SendResponse response = xmppService.sendMessage(msg);
        assertNotNull("expected a response", response);
View Full Code Here

Examples of de.plushnikov.intellij.plugin.psi.LombokLightMethodBuilder.withBody()

        .withNavigationElement(psiAnnotation)
        .withModifier(PsiModifier.PUBLIC);

    final String paramString = createParamString(psiClass, psiAnnotation);
    final String blockText = String.format("return \"%s(%s)\";", psiClass.getQualifiedName(), paramString);
    method.withBody(PsiMethodUtil.createCodeBlockFromText(blockText, psiClass));

    Collection<PsiField> toStringFields = PsiFieldUtil.filterFieldsByModifiers(psiClass.getFields(), PsiModifier.STATIC);
    UserMapKeys.addReadUsageFor(toStringFields);

    return Collections.<PsiMethod>singletonList(method);
View Full Code Here

Examples of de.plushnikov.intellij.plugin.psi.LombokLightMethodBuilder.withBody()

    }

    final String paramsText = joinParameters(method.getParameterList());
    final String psiClassName = buildClassNameWithGenericTypeParameters(psiClass);
    final String blockText = String.format("return new %s(%s);", psiClassName, paramsText);
    method.withBody(PsiMethodUtil.createCodeBlockFromText(blockText, psiClass));

    return method;
  }

  private String buildClassNameWithGenericTypeParameters(@NotNull final PsiClass psiClass) {
View Full Code Here

Examples of de.plushnikov.intellij.plugin.psi.LombokLightMethodBuilder.withBody()

    boolean isStatic = psiField.hasModifierProperty(PsiModifier.STATIC);
    if (isStatic) {
      method.withModifier(PsiModifier.STATIC);
    }

    method.withBody(PsiMethodUtil.createCodeBlockFromText(String.format("return %s.%s;", isStatic ? psiClass.getName() : "this", psiField.getName()), psiClass));

    copyAnnotations(psiField, method.getModifierList(),
        LombokUtils.NON_NULL_PATTERN, LombokUtils.NULLABLE_PATTERN, LombokUtils.DEPRECATED_PATTERN);
    return method;
  }
View Full Code Here

Examples of de.plushnikov.intellij.plugin.psi.LombokLightMethodBuilder.withBody()

    if (paramString.length() > 0) {
      paramString.deleteCharAt(paramString.length() - 1);
    }
    final boolean isMethodCall = psiElement instanceof PsiMethod;
    methodBuilder.withBody(PsiMethodUtil.createCodeBlockFromText(
        String.format("%sthis.%s%s.%s(%s);",
            PsiType.VOID.equals(returnType) ? "" : "return ",
            psiElement.getName(),
            isMethodCall ? "()" : "",
            psiMethod.getName(),
View Full Code Here

Examples of de.plushnikov.intellij.plugin.psi.LombokLightMethodBuilder.withBody()

    String blockText = String.format("%s.%s = %s;", thisOrClass, psiField.getName(), methodParameter.getName());
    if (!isStatic && !PsiType.VOID.equals(returnType)) {
      blockText += "return this;";
    }

    method.withBody(PsiMethodUtil.createCodeBlockFromText(blockText, psiClass));

    copyAnnotations(psiField, method.getModifierList(), LombokUtils.DEPRECATED_PATTERN);

    return method;
  }
View Full Code Here

Examples of de.plushnikov.intellij.plugin.psi.LombokLightMethodBuilder.withBody()

      copyAnnotations(psiField, methodParameter.getModifierList(), LombokUtils.NON_NULL_PATTERN, LombokUtils.NULLABLE_PATTERN, LombokUtils.DEPRECATED_PATTERN);
      result.withParameter(methodParameter);

      final String paramString = getConstructorCall(psiField, psiFieldContainingClass);
      final String blockText = String.format("return this.%s == %s ? this : new %s(%s);", psiFieldName, psiFieldName, returnType.getCanonicalText(), paramString);
      result.withBody(PsiMethodUtil.createCodeBlockFromText(blockText, psiFieldContainingClass));
    }
    return result;
  }

  private boolean isBooleanField(PsiField psiField) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.