/** * Adds a metadata category to retrieve with each document. The metadata * will be available via {@link DocumentRecord#getMetadata * DocumentRecord.getMetadata} in each DocumentRecord sent to the * OutputListener registered with onGenerateOutput. To specify the format * for the metdata, call {@link #withNonDocumentFormat * withNonDocumentFormat}. * * @param category the metadata category to retrieve * @return this instance (for method chaining) */ @Override public ExportToWriterListener withMetadataCategory(DocumentManager.Metadata category) { super.withMetadataCategory(category); return this; }
/** * Prepares each ExportListener created by a subclass before it's used to process a QueryBatch. Subclasses are * expected to call this with their own instance of ExportListener or a subclass of it. * * @param listener */ protected void prepareExportListener(ExportListener listener) { if (consistentSnapshot) { listener.withConsistentSnapshot(); } if (categories != null) { for (DocumentManager.Metadata category : categories) { listener.withMetadataCategory(category); } } if (nonDocumentFormat != null) { listener.withNonDocumentFormat(nonDocumentFormat); } if (transform != null) { listener.withTransform(transform); } }