toDocumentSource

Converts a supported object to its corresponding {@link DocumentSource} instance.

Return

The appropriate {@link DocumentSource} instance for the given object.

Parameters

source

The object to convert.

Throws

If the provided object is not a supported source type.