public class ResourceFormatParserService extends PluggableProviderRegistryService<ResourceFormatParser> implements DescribableService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SERVICE_NAME |
framework, instanceregistry, registry
Constructor and Description |
---|
ResourceFormatParserService(Framework framework) |
Modifier and Type | Method and Description |
---|---|
<X extends ResourceFormatParser> |
createProviderInstance(java.lang.Class<X> clazz,
java.lang.String name) |
ResourceFormatParser |
createScriptProviderInstance(ScriptPluginProvider provider) |
java.util.List<java.lang.String> |
getBundledProviderNames() |
static java.lang.String |
getFileExtension(java.lang.String name) |
static ResourceFormatParserService |
getInstanceForFramework(Framework framework) |
java.lang.String |
getName() |
ResourceFormatParser |
getParserForFileExtension(java.io.File file)
Return a parser for a file, based on the file extension.
|
ResourceFormatParser |
getParserForFileExtension(java.lang.String extension)
Return a parser for a file, based on the bare file extension.
|
ResourceFormatParser |
getParserForFormat(java.lang.String format)
Return a parser for the exact format name
|
ResourceFormatParser |
getParserForMIMEType(java.lang.String mimeType)
Return a parser for a mime type.
|
boolean |
isScriptPluggable() |
boolean |
isValidProviderClass(java.lang.Class clazz) |
java.util.List<ProviderIdent> |
listDescribableProviders() |
java.util.List<Description> |
listDescriptions() |
java.util.List<java.lang.String> |
listFormats() |
java.util.List<java.lang.String> |
listSupportedFileExtensions() |
listProviders, providerOfType
createProviderInstanceFromType, hasValidProviderSignature, registerClass, registerInstance
public static final java.lang.String SERVICE_NAME
public ResourceFormatParserService(Framework framework)
public java.util.List<java.lang.String> getBundledProviderNames()
public java.lang.String getName()
getName
in interface FrameworkSupportService
public java.util.List<java.lang.String> listFormats()
public java.util.List<java.lang.String> listSupportedFileExtensions()
public ResourceFormatParser getParserForFileExtension(java.io.File file) throws UnsupportedFormatException
file
- the fileUnsupportedFormatException
- if the file extension does not match an available parser, or if the file has
no extensionpublic static java.lang.String getFileExtension(java.lang.String name)
name
- file namepublic ResourceFormatParser getParserForFileExtension(java.lang.String extension) throws UnsupportedFormatException
extension
- the file extension stringUnsupportedFormatException
- if the file extension does not match an available parser, or if the file has
no extensionpublic ResourceFormatParser getParserForFormat(java.lang.String format) throws UnsupportedFormatException
format
- the format nameUnsupportedFormatException
- if format is not supportedpublic ResourceFormatParser getParserForMIMEType(java.lang.String mimeType) throws UnsupportedFormatException
mimeType
- the MIME type stringUnsupportedFormatException
- if no parser are available for the MIME typepublic boolean isValidProviderClass(java.lang.Class clazz)
isValidProviderClass
in interface PluggableService<ResourceFormatParser>
clazz
- the classpublic <X extends ResourceFormatParser> ResourceFormatParser createProviderInstance(java.lang.Class<X> clazz, java.lang.String name) throws PluginException, ProviderCreationException
createProviderInstance
in interface PluggableService<ResourceFormatParser>
X
- subtype of Tclazz
- the classname
- the provider namePluginException
- if the plugin has an errorProviderCreationException
- if creating the instance has an errorpublic boolean isScriptPluggable()
isScriptPluggable
in interface PluggableService<ResourceFormatParser>
public ResourceFormatParser createScriptProviderInstance(ScriptPluginProvider provider) throws PluginException
createScriptProviderInstance
in interface PluggableService<ResourceFormatParser>
provider
- the script plugin providerPluginException
- if the plugin has an errorpublic java.util.List<ProviderIdent> listDescribableProviders()
listDescribableProviders
in interface DescribableService
public java.util.List<Description> listDescriptions()
listDescriptions
in interface DescribableService
public static ResourceFormatParserService getInstanceForFramework(Framework framework)