Class DocumentMetadata
java.lang.Object
org.apache.camel.component.docling.DocumentMetadata
Represents metadata extracted from a document.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCustomMetadata(String key, Object value) Adds a custom metadata field.voidaddRawMetadata(String key, Object value) Adds a raw metadata field.Gets the document author.Gets the document creation date.Gets the creator (application that created the document).Gets custom metadata fields.Gets the document type/format.Gets the file name.Gets the file path.Gets the file size in bytes.Gets the MIME type or format identifier.Gets the document keywords.Gets the document language.Gets the document modification date.Gets the number of pages in the document.Gets the producer (application that produced the PDF, if applicable).Gets the raw metadata as returned by the parser.Gets the document subject.getTitle()Gets the document title.booleanChecks if the metadata has an author.booleanChecks if the metadata has a page count.booleanhasTitle()Checks if the metadata has a title.voidvoidsetCreationDate(Instant creationDate) voidsetCreator(String creator) voidsetCustomMetadata(Map<String, Object> customMetadata) voidsetDocumentType(String documentType) voidsetFileName(String fileName) voidsetFilePath(String filePath) voidsetFileSizeBytes(Long fileSizeBytes) voidvoidsetKeywords(String keywords) voidsetLanguage(String language) voidsetModificationDate(Instant modificationDate) voidsetPageCount(Integer pageCount) voidsetProducer(String producer) voidsetRawMetadata(Map<String, Object> rawMetadata) voidsetSubject(String subject) voidtoString()
-
Constructor Details
-
DocumentMetadata
public DocumentMetadata()
-
-
Method Details
-
getTitle
Gets the document title.- Returns:
- document title
-
setTitle
-
getAuthor
Gets the document author.- Returns:
- author name
-
setAuthor
-
getCreator
Gets the creator (application that created the document).- Returns:
- creator application name
-
setCreator
-
getProducer
Gets the producer (application that produced the PDF, if applicable).- Returns:
- producer application name
-
setProducer
-
getSubject
Gets the document subject.- Returns:
- document subject
-
setSubject
-
getKeywords
Gets the document keywords.- Returns:
- keywords as a comma-separated string
-
setKeywords
-
getCreationDate
Gets the document creation date.- Returns:
- creation date
-
setCreationDate
-
getModificationDate
Gets the document modification date.- Returns:
- modification date
-
setModificationDate
-
getPageCount
Gets the number of pages in the document.- Returns:
- page count
-
setPageCount
-
getLanguage
Gets the document language.- Returns:
- language code (e.g., "en", "fr", "de")
-
setLanguage
-
getDocumentType
Gets the document type/format.- Returns:
- document type (e.g., "PDF", "DOCX", "PPTX")
-
setDocumentType
-
getFormat
Gets the MIME type or format identifier.- Returns:
- format (e.g., "application/pdf")
-
setFormat
-
getFileSizeBytes
Gets the file size in bytes.- Returns:
- file size
-
setFileSizeBytes
-
getFileName
Gets the file name.- Returns:
- file name
-
setFileName
-
getFilePath
Gets the file path.- Returns:
- file path
-
setFilePath
-
getCustomMetadata
Gets custom metadata fields.- Returns:
- map of custom metadata fields
-
setCustomMetadata
-
addCustomMetadata
Adds a custom metadata field.- Parameters:
key- the field namevalue- the field value
-
getRawMetadata
Gets the raw metadata as returned by the parser.- Returns:
- map of raw metadata
-
setRawMetadata
-
addRawMetadata
Adds a raw metadata field.- Parameters:
key- the field namevalue- the field value
-
hasTitle
public boolean hasTitle()Checks if the metadata has a title.- Returns:
- true if title is present
-
hasAuthor
public boolean hasAuthor()Checks if the metadata has an author.- Returns:
- true if author is present
-
hasPageCount
public boolean hasPageCount()Checks if the metadata has a page count.- Returns:
- true if page count is present
-
toString
-