org.springframework.batch.item.jms.builder

## Class JmsItemReaderBuilder<T>

- java.lang.Object
- - org.springframework.batch.item.jms.builder.JmsItemReaderBuilder<T>

-     public class JmsItemReaderBuilder<T>
      extends java.lang.Object

  Creates a fully qualified JmsItemReader.
  Since:
    4.0
  Author:
    Glenn Renfro

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.Class<? extends T>` | `itemType`
    `protected org.springframework.jms.core.JmsOperations` | `jmsTemplate`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JmsItemReaderBuilder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `JmsItemReader<T>` | `build()` Returns a fully constructed `JmsItemReader`.
    `JmsItemReaderBuilder<T>` | `itemType(java.lang.Class<? extends T> itemType)` Set the expected type of incoming message payloads.
    `JmsItemReaderBuilder<T>` | `jmsTemplate(org.springframework.jms.core.JmsOperations jmsTemplate)` Establish the JMS template that will be used by the JmsItemReader.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### itemType

          protected java.lang.Class<? extends T> itemType

    - #### jmsTemplate

          protected org.springframework.jms.core.JmsOperations jmsTemplate

  - ### Constructor Detail

    - #### JmsItemReaderBuilder

          public JmsItemReaderBuilder()

  - ### Method Detail

    - #### jmsTemplate

          public JmsItemReaderBuilder<T> jmsTemplate(org.springframework.jms.core.JmsOperations jmsTemplate)

      Establish the JMS template that will be used by the JmsItemReader.
      Parameters:
        `jmsTemplate` - a `JmsOperations` instance
      Returns:
        this instance for method chaining.
      See Also:
        `JmsItemReader.setJmsTemplate(JmsOperations)`

    - #### itemType

          public JmsItemReaderBuilder<T> itemType(java.lang.Class<? extends T> itemType)

      Set the expected type of incoming message payloads. Set this to `Message` to receive the raw underlying message.
      Parameters:
        `itemType` - the java class of the items to be delivered. Typically the same as the class parameter
      Returns:
        this instance for method chaining.
      Throws:
        `java.lang.IllegalStateException` - if the message payload is of the wrong type.
      See Also:
        `JmsItemReader.setItemType(Class)`

    - #### build

          public JmsItemReader<T> build()

      Returns a fully constructed `JmsItemReader`.
      Returns:
        a new `JmsItemReader`