public abstract class Document extends Object
Represents the base class for documents added to an index from file system, stream, or structure. Contains static methods for creating documents from different types of sources.
Learn more
Modifier and Type | Method and Description |
---|---|
static Document |
createFromFile(String filePath)
Creates a document from a file.
|
static Document |
createFromStream(String documentKey,
Date modificationDate,
String extension,
InputStream stream)
Creates a document from a stream.
|
static Document |
createFromStructure(String documentKey,
Date modificationDate,
DocumentField[] fields)
Creates a document from a structure that is an array of text fields.
|
static Document |
createLazy(int documentSourceKind,
String documentKey,
IDocumentLoader documentLoader)
Creates a lazy-loaded document.
|
DocumentField[] |
getAdditionalFields()
Gets the additional fields for the document.
|
String[] |
getAttributes()
Gets the attributes of the document.
|
abstract String |
getDocumentKey()
Gets the document key that is used to identify the document within an index.
|
abstract int |
getDocumentSourceKind()
Gets the document source kind.
|
abstract String |
getExtension()
Gets the extension used for this document type.
|
abstract Date |
getModificationDate()
Gets the last modification date of the document.
|
abstract boolean |
isLazy()
Gets a value indicating whether the document is loaded as needed or not.
|
void |
setAdditionalFields(DocumentField[] value)
Sets the additional fields for the document.
|
void |
setAttributes(String[] value)
Sets the attributes of the document.
|
String |
toString()
Returns a
java.lang.String that represents the current Document . |
public abstract int getDocumentSourceKind()
Gets the document source kind.
public abstract String getDocumentKey()
Gets the document key that is used to identify the document within an index.
public abstract boolean isLazy()
Gets a value indicating whether the document is loaded as needed or not.
public abstract Date getModificationDate()
Gets the last modification date of the document.
public abstract String getExtension()
Gets the extension used for this document type.
public final DocumentField[] getAdditionalFields()
Gets the additional fields for the document.
public final void setAdditionalFields(DocumentField[] value)
Sets the additional fields for the document.
value
- The additional fields for the document.public final String[] getAttributes()
Gets the attributes of the document.
public final void setAttributes(String[] value)
Sets the attributes of the document.
value
- The attributes of the document.public static Document createFromFile(String filePath)
Creates a document from a file.
filePath
- The document file path.public static Document createFromStream(String documentKey, Date modificationDate, String extension, InputStream stream)
Creates a document from a stream.
documentKey
- The document key.modificationDate
- The document modification date.extension
- The document extension.stream
- The document stream.public static Document createFromStructure(String documentKey, Date modificationDate, DocumentField[] fields)
Creates a document from a structure that is an array of text fields.
documentKey
- The document key.modificationDate
- The document modification date.fields
- The document fields.public static Document createLazy(int documentSourceKind, String documentKey, IDocumentLoader documentLoader)
Creates a lazy-loaded document.
documentSourceKind
- The document source kind. This value must match the kind of the loaded document.documentKey
- The document key. This value must match the key of the loaded document.documentLoader
- The document loader.Copyright © 2020. All rights reserved.