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
DocumentFormat s of a given family. |
public void addFormat(DocumentFormat documentFormat)
documentFormat
- The format to add.public DocumentFormat getFormatByExtension(java.lang.String extension)
DocumentFormatRegistry
getFormatByExtension
in interface DocumentFormatRegistry
extension
- 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)
DocumentFormatRegistry
getFormatByMediaType
in interface DocumentFormatRegistry
mediaType
- 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)
DocumentFormatRegistry
DocumentFormat
s of a given family.getOutputFormats
in interface DocumentFormatRegistry
family
- The family whose document formats will be returned.