Package 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 Object
Creates a fully qualified JmsItemReader.

Since:
  4.0
Author:
  Glenn Renfro, Mahmoud Ben Hassine

- ## Field Summary

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JmsItemReaderBuilder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `JmsItemReader<T>`
  `build()`
  Returns a fully constructed `JmsItemReader`.
  `JmsItemReaderBuilder<T>`
  `itemType(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 Details

  - ### itemType

    protected Class<? extends T> itemType

  - ### jmsTemplate

    protected org.springframework.jms.core.JmsOperations jmsTemplate

- ## Constructor Details

  - ### JmsItemReaderBuilder

    public JmsItemReaderBuilder()

- ## Method Details

  - ### 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(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:
      `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`