From 54a78fcd72e956424e3e5e1e16f5fc8ffc2cbd80 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Tue, 19 Aug 2008 18:24:42 +0000 Subject: [PATCH] Added JavaDoc for @Router and @Splitter (INT-273). --- .../integration/annotation/Router.java | 21 ++++++++++++++++--- .../integration/annotation/Splitter.java | 13 ++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Router.java b/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Router.java index 0c8b3ef4e7..2f6af0826f 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Router.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Router.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,8 +25,23 @@ import java.lang.annotation.Target; /** * Indicates that a method is capable of resolving to a channel or channel name - * based on a message, message payload, message attribute, or message property. - * + * based on a message, message header(s), or both. + *

+ * A method annotated with @Router may accept a parameter of type + * {@link org.springframework.integration.message.Message} or of the expected + * Message payload's type. Any type conversion supported by + * {@link org.springframework.beans.SimpleTypeConverter} will be applied to + * the Message payload if necessary. Header values can also be passed as + * Message parameters by using the + * {@link org.springframework.integration.handler.annotation.Header @Header} + * parameter annotation. + *

+ * Return values from the annotated method may be either a Collection or Array + * whose elements are either + * {@link org.springframework.integration.channel.MessageChannel channels} or + * Strings. In the latter case, the endpoint hosting this router will attempt + * to resolve each channel name with the Channel Registry. + * * @author Mark Fisher */ @Target(ElementType.METHOD) diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Splitter.java b/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Splitter.java index cbf333ed96..e41e98ed09 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Splitter.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Splitter.java @@ -25,6 +25,19 @@ import java.lang.annotation.Target; /** * Indicates that a method is capable of splitting a single message or message * payload to produce multiple messages or payloads. + *

+ * A method annotated with @Splitter may accept a parameter of type + * {@link org.springframework.integration.message.Message} or of the expected + * Message payload's type. Any type conversion supported by + * {@link org.springframework.beans.SimpleTypeConverter} will be applied to + * the Message payload if necessary. Header values can also be passed as + * Message parameters by using the + * {@link org.springframework.integration.handler.annotation.Header @Header} + * parameter annotation. + *

+ * Return values from the annotated method may be either a Collection or Array + * with elements of any type. If the type is not a Message, each will be used + * as the payload for creating a new Message. * * @author Mark Fisher */