org.springframework.integration.annotation.Transformer类的使用及代码示例

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

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

Transformer介绍

暂无

代码示例

代码示例来源: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: org.springframework.integration/org.springframework.integration

@Override
protected MessageHandler createHandler(Object bean, Method method, Transformer annotation) {
  MethodInvokingTransformer transformer = new MethodInvokingTransformer(bean, method);
  MessageTransformingHandler handler = new MessageTransformingHandler(transformer);
  String outputChannelName = annotation.outputChannel();
  if (StringUtils.hasText(outputChannelName)) {
    handler.setOutputChannel(this.channelResolver.resolveChannelName(outputChannelName));
  }
  return handler;
}

代码示例来源: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(inputChannel = "inputChannel", outputChannel = "outputChannel")
public String transformBefore(String input) {
  return input.toUpperCase();
}

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

@Bean
@org.springframework.integration.annotation.Transformer(inputChannel = "input",
    outputChannel = "output",
    adviceChain = { "fooAdvice",
        "idempotentReceiverInterceptor",
        "transactionInterceptor" })
public Transformer transformer() {
  return message -> message;
}

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

@Transformer
public String transform(String payload) {
  return payload.toLowerCase();
}

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

@Transformer
public String exclaim(String s) {
  return s.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();
}

相关文章

Transformer类方法