javax.imageio.spi
Class IIOServiceProvider

java.lang.Object
  extended by javax.imageio.spi.IIOServiceProvider
All Implemented Interfaces:
RegisterableService
Direct Known Subclasses:
ImageInputStreamSpi, ImageOutputStreamSpi, ImageReaderWriterSpi, ImageTranscoderSpi

public abstract class IIOServiceProvider
extends Object
implements RegisterableService

An abstract superclass for service providers that perform image I/O.

Since:
1.4

Field Summary
protected  String vendorName
          The vendor of this service provider, or null if the subclass constructor did not set this field.
protected  String version
          The version of this service provider, or null if the subclass constructor did not set this field.
 
Constructor Summary
IIOServiceProvider()
          Constructs a general IIOServiceProvider without specifying a vendor name and a version string.
IIOServiceProvider(String vendorName, String version)
          Constructs a general IIOServiceProvider, given the vendor name and a version string.
 
Method Summary
abstract  String getDescription(Locale locale)
          Returns a short description of this service provider that can be presented to a human user.
 String getVendorName()
          Returns the name of the vendor of this service provider.
 String getVersion()
          Returns an identifier string for the version of this service provider.
 void onDeregistration(ServiceRegistry registry, Class<?> category)
          Informs this service provider that it has been de-registered from a ServiceRegistry.
 void onRegistration(ServiceRegistry registry, Class<?> category)
          Informs this service provider that it has been registered in a ServiceRegistry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vendorName

protected String vendorName
The vendor of this service provider, or null if the subclass constructor did not set this field.

See Also:
getVendorName()

version

protected String version
The version of this service provider, or null if the subclass constructor did not set this field.

See Also:
getVersion()
Constructor Detail

IIOServiceProvider

public IIOServiceProvider(String vendorName,
                          String version)
Constructs a general IIOServiceProvider, given the vendor name and a version string.

Throws:
IllegalArgumentException - if vendorName or version is null.

IIOServiceProvider

public IIOServiceProvider()
Constructs a general IIOServiceProvider without specifying a vendor name and a version string. The subclass constructor should set the vendorName and version to non-null values.

Method Detail

onRegistration

public void onRegistration(ServiceRegistry registry,
                           Class<?> category)
Informs this service provider that it has been registered in a ServiceRegistry. If this provider gets registered as an implementor for several service categories, its onRegistration method will be called multiple times. The default implementation does nothing.

Specified by:
onRegistration in interface RegisterableService
Parameters:
registry - the registry to which this service provider has been added.
category - the service category for which this provider has been registered as an implementor.

onDeregistration

public void onDeregistration(ServiceRegistry registry,
                             Class<?> category)
Informs this service provider that it has been de-registered from a ServiceRegistry. If this provider had been registered as an implementor for several service categories, its onDeregistration method will be called multiple times. The default implementation does nothing.

Specified by:
onDeregistration in interface RegisterableService
Parameters:
registry - the registry from which this service provider has been removed.
category - the service category for which this provider has been registered as an implementor.

getVendorName

public String getVendorName()
Returns the name of the vendor of this service provider.


getVersion

public String getVersion()
Returns an identifier string for the version of this service provider.


getDescription

public abstract String getDescription(Locale locale)
Returns a short description of this service provider that can be presented to a human user.

Parameters:
locale - the locale for which the description string should be localized.