A factory parsing and building documents of the same type.
Each document produced by the same factory has a number of fields, which represent units of information that should be indexed separately. The number of available fields may be recovered calling {@link #numberOfFields()}, their types calling {@link #fieldType(int)}, and their symbolic names using {@link #fieldName(int)}.
Factories contain the parsing and document-level breaking logic. For instance, a factory for HTML documents might extract the text into a title and a body, and expose them as {@link FieldType#TEXT} fields. Additionally, the last modificationdate might be exposed as a {@link FieldType#DATE} field, and so on.Warning: implementations of this class are not required to be thread-safe, but they provide {@link FlyweightPrototype flyweight copies}. The {@link #copy()} method is strengthened so to return a instance of this class.