|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DocumentBuilder
An interface which standardizes the process of building an indexable
Document
.
The idea is that implementations implement build(Document doc)
,
which adds to the given Document whatever 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 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())));
Nested Class Summary | |
---|---|
static class |
DocumentBuilder.DocumentBuilderException
An exception thrown from DocumentBuilder 's build(). |
Method Summary | |
---|---|
org.apache.lucene.document.Document |
build(org.apache.lucene.document.Document doc)
Adds to the given document whatever Field s the implementation needs
to add. |
Method Detail |
---|
org.apache.lucene.document.Document build(org.apache.lucene.document.Document doc) throws DocumentBuilder.DocumentBuilderException
Field
s the implementation needs
to add. Return the docunment instance to allow for chaining calls.
DocumentBuilder.DocumentBuilderException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |