public class SimpleDocumentFormatRegistry extends java.lang.Object implements DocumentFormatRegistry
| Constructor and Description |
|---|
SimpleDocumentFormatRegistry() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFormat(DocumentFormat documentFormat)
Add a new format to the registry.
|
DocumentFormat |
getFormatByExtension(java.lang.String extension)
Gets a document format for the specified extension.
|
DocumentFormat |
getFormatByMediaType(java.lang.String mediaType)
Gets a document format for the specified media type.
|
java.util.Set<DocumentFormat> |
getOutputFormats(DocumentFamily family)
Gets all the
DocumentFormats of a given family. |
public void addFormat(DocumentFormat documentFormat)
documentFormat - The format to add.public DocumentFormat getFormatByExtension(java.lang.String extension)
DocumentFormatRegistrygetFormatByExtension in interface DocumentFormatRegistryextension - The extension whose document format will be returned.null if no document format exists for the
specified extension.public DocumentFormat getFormatByMediaType(java.lang.String mediaType)
DocumentFormatRegistrygetFormatByMediaType in interface DocumentFormatRegistrymediaType - The media type whose document format will be returned.null if no document format exists for the
specified media type.public java.util.Set<DocumentFormat> getOutputFormats(DocumentFamily family)
DocumentFormatRegistryDocumentFormats of a given family.getOutputFormats in interface DocumentFormatRegistryfamily - The family whose document formats will be returned.