The idea is that implementations implement {@link #build(Document doc)}, which adds to the given Document whatever {@link Field}s it wants to add. A DocumentBuilder is also allowed to inspect or change existing Fields in the Document, if it wishes to.
Implementations should normally have a constructor with parameters which determine what {@link #build(Document)} will add to doc.
To allow reuse of the DocumentBuilder object, implementations are also encouraged to have a setter method, which remembers its parameters just like the constructor. This setter method cannot be described in this interface, because it will take different parameters in each implementation.
The interface defines a builder pattern, which allows applications to invoke several document builders in the following way:
builder1.build(builder2.build(builder3.build(new Document())));@lucene.experimental
|
|
|
|