org.springframework.integration.annotation.Transformer.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(79)

本文整理了Java中org.springframework.integration.annotation.Transformer.<init>()方法的一些代码示例,展示了Transformer.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transformer.<init>()方法的具体详情如下:
包路径:org.springframework.integration.annotation.Transformer
类名称:Transformer
方法名:<init>

Transformer.<init>介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-integration-samples

@Transformer
public List<EmailFragment> transformit(javax.mail.Message mailMessage) {
  final List<EmailFragment> emailFragments = new ArrayList<EmailFragment>();
  EmailParserUtils.handleMessage(null, mailMessage, emailFragments);
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info(String.format("Email contains %s fragments.", emailFragments.size()));
  }
  return emailFragments;
}

代码示例来源:origin: spring-projects/spring-integration-samples

@Transformer(inputChannel = "resultToString")
public String convertResult(byte[] bytes) {
  return new String(bytes);
}

代码示例来源:origin: spring-projects/spring-integration-samples

@Transformer(inputChannel = "fromTcp", outputChannel = "toEcho")
public String convert(byte[] bytes) {
  return new String(bytes);
}

代码示例来源:origin: spring-projects/spring-integration-samples

@Transformer
public Message<?> transform(ErrorMessage errorMessage) {
  return ((MessagingException) errorMessage.getPayload()).getFailedMessage();
}

代码示例来源:origin: spring-projects/spring-integration

@Bean
@Transformer(inputChannel = "functionServiceChannel")
public Function<String, String> functionAsService() {
  return String::toUpperCase;
}

代码示例来源:origin: spring-projects/spring-integration

@Transformer
public Properties propertyPayloadTest(Properties properties) {
  properties.setProperty("prop1", "foo");
  properties.setProperty("prop2", "bar");
  return properties;
}

代码示例来源:origin: spring-projects/spring-integration

@Transformer
public Properties propertyEnricherTest(String s) {
  Properties properties = new Properties();
  properties.setProperty("prop1", "foo");
  properties.setProperty("prop2", "bar");
  return properties;
}

代码示例来源:origin: spring-projects/spring-integration

@Bean
@Transformer(inputChannel = "toString")
public ObjectToStringTransformer otst() {
  return new ObjectToStringTransformer();
}

代码示例来源:origin: spring-projects/spring-integration

@Bean
@Transformer(inputChannel = "toString")
public ObjectToStringTransformer otst() {
  return new ObjectToStringTransformer();
}

代码示例来源:origin: spring-projects/spring-integration

@Bean
@Transformer(inputChannel = "stream", outputChannel = "data")
public org.springframework.integration.transformer.Transformer transformer() {
  return new StreamTransformer();
}

代码示例来源:origin: spring-projects/spring-integration

@Bean
@Transformer(inputChannel = "stream", outputChannel = "data")
public org.springframework.integration.transformer.Transformer transformer() {
  return new StreamTransformer();
}

代码示例来源:origin: spring-projects/spring-integration

@Bean
@Transformer(inputChannel = "toString")
public ObjectToStringTransformer otst() {
  return new ObjectToStringTransformer();
}

代码示例来源:origin: spring-projects/spring-integration

@Bean
@Transformer(inputChannel = "oddChannel", outputChannel = "filterChannel")
public ExpressionEvaluatingTransformer oddTransformer() {
  return new ExpressionEvaluatingTransformer(PARSER.parseExpression("payload / 2"));
}

代码示例来源:origin: spring-projects/spring-integration

@Bean
@Transformer(inputChannel = "greetingChannel")
public ExpressionEvaluatingTransformer greetingTransformer() {
  return new ExpressionEvaluatingTransformer(expressionParser.parseExpression("'Hello ' + payload"));
}

代码示例来源:origin: spring-projects/spring-integration

@Bean
@Transformer(inputChannel = "toString")
public ObjectToStringTransformer otst() {
  return new ObjectToStringTransformer();
}

代码示例来源:origin: spring-projects/spring-integration

@Transformer(inputChannel = "gatewayChannel")
public String transform(Message<String> message) {
  assertTrue(message.getHeaders().containsKey("foo"));
  assertEquals("FOO", message.getHeaders().get("foo"));
  assertTrue(message.getHeaders().containsKey("calledMethod"));
  assertEquals("echo", message.getHeaders().get("calledMethod"));
  return this.handle(message.getPayload()) + Arrays.asList(new Throwable().getStackTrace()).toString();
}

代码示例来源:origin: spring-projects/spring-integration

@Bean
@Transformer(inputChannel = "routingSlipHeaderChannel", outputChannel = "processChannel")
public HeaderEnricher headerEnricher() {
  return new HeaderEnricher(Collections.singletonMap(IntegrationMessageHeaderAccessor.ROUTING_SLIP,
      new RoutingSlipHeaderValueMessageProcessor(routeStrategy())));
}

代码示例来源:origin: spring-projects/spring-integration

@Bean
@ServiceActivator(inputChannel = "skippedChannel")
@Splitter(inputChannel = "skippedChannel2")
@Router(inputChannel = "skippedChannel3")
@Transformer(inputChannel = "skippedChannel4")
@Filter(inputChannel = "skippedChannel5")
@Profile("foo")
public MessageHandler skippedMessageHandler() {
  return m -> {
  };
}

代码示例来源:origin: spring-projects/spring-integration

@Transformer(inputChannel = "gatewayChannel2")
@UseSpelInvoker(compilerMode = "${xxxxxxxx:IMMEDIATE}")
public String transform2(Message<String> message) {
  assertTrue(message.getHeaders().containsKey("foo"));
  assertEquals("FOO", message.getHeaders().get("foo"));
  assertTrue(message.getHeaders().containsKey("calledMethod"));
  assertEquals("echo2", message.getHeaders().get("calledMethod"));
  return this.handle(message.getPayload()) + "2" + Arrays.asList(new Throwable().getStackTrace()).toString();
}

代码示例来源:origin: spring-projects/spring-integration

@Transformer
  public Object transform(@Headers MessageHeaders headers,
      @Header("history") MessageHistory history, @Payload Object payload) {
    return payload;
  }
}

相关文章

Transformer类方法