Package org.apache.lucene.analysis.core

# Class WhitespaceAnalyzer

java.lang.Object
org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.core.WhitespaceAnalyzer

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

public final class WhitespaceAnalyzer extends Analyzer
An Analyzer that uses `WhitespaceTokenizer`.

Since:
  3.1

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer

  `Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents`

- ## Field Summary

  ### Fields inherited from class org.apache.lucene.analysis.Analyzer

  `GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WhitespaceAnalyzer()`
  Creates a new `WhitespaceAnalyzer` with a maximum token length of 255 chars
  `WhitespaceAnalyzer(int maxTokenLength)`
  Creates a new `WhitespaceAnalyzer` with a custom maximum token length

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Analyzer.TokenStreamComponents`
  `createComponents(String fieldName)`

  ### Methods inherited from class org.apache.lucene.analysis.Analyzer

  `attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, initReader, initReaderForNormalization, normalize, normalize, tokenStream, tokenStream`

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

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

- ## Constructor Details

  - ### WhitespaceAnalyzer

    public WhitespaceAnalyzer()
    Creates a new `WhitespaceAnalyzer` with a maximum token length of 255 chars

  - ### WhitespaceAnalyzer

    public WhitespaceAnalyzer(int maxTokenLength)
    Creates a new `WhitespaceAnalyzer` with a custom maximum token length
    Parameters:
      `maxTokenLength` - the maximum token length the analyzer will emit

- ## Method Details

  - ### createComponents

    protected Analyzer.TokenStreamComponents createComponents(String fieldName)
    Specified by:
      `createComponents` in class `Analyzer`