- java.lang.Object
-
- javax.imageio.spi.IIOServiceProvider
-
- All Implemented Interfaces:
- RegisterableService
- Direct Known Subclasses:
- ImageInputStreamSpi, ImageOutputStreamSpi, ImageReaderWriterSpi, ImageTranscoderSpi
public abstract class IIOServiceProvider extends Object implements RegisterableService
A superinterface for functionality common to all Image I/O service provider interfaces (SPIs). For more information on service provider classes, see the class comment for theIIORegistry
class.
-
-
Field Summary
Fields Modifier and Type Field and Description protected String
vendorName
AString
to be returned fromgetVendorName
, initiallynull
.protected String
version
AString
to be returned fromgetVersion
, initially null.
-
Constructor Summary
Constructors Constructor and Description IIOServiceProvider()
Constructs a blankIIOServiceProvider
.IIOServiceProvider(String vendorName, String version)
Constructs anIIOServiceProvider
with a given vendor name and version identifier.
-
Method Summary
Methods Modifier and Type Method and Description abstract String
getDescription(Locale locale)
Returns a brief, human-readable description of this service provider and its associated implementation.String
getVendorName()
Returns the name of the vendor responsible for creating this service provider and its associated implementation.String
getVersion()
Returns a string describing the version number of this service provider and its associated implementation.void
onDeregistration(ServiceRegistry registry, Class<?> category)
A callback that will be whenever the Spi class has been deregistered from aServiceRegistry
.void
onRegistration(ServiceRegistry registry, Class<?> category)
A callback that will be called exactly once after the Spi class has been instantiated and registered in aServiceRegistry
.
-
-
-
Field Detail
-
vendorName
protected String vendorName
AString
to be returned fromgetVendorName
, initiallynull
. Constructors should set this to a non-null
value.
-
version
protected String version
AString
to be returned fromgetVersion
, initially null. Constructors should set this to a non-null
value.
-
-
Constructor Detail
-
IIOServiceProvider
public IIOServiceProvider(String vendorName, String version)
Constructs anIIOServiceProvider
with a given vendor name and version identifier.- Parameters:
vendorName
- the vendor name.version
- a version identifier.- Throws:
IllegalArgumentException
- ifvendorName
isnull
.IllegalArgumentException
- ifversion
isnull
.
-
IIOServiceProvider
public IIOServiceProvider()
Constructs a blankIIOServiceProvider
. It is up to the subclass to initialize instance variables and/or override method implementations in order to ensure that thegetVendorName
andgetVersion
methods will return non-null
values.
-
-
Method Detail
-
onRegistration
public void onRegistration(ServiceRegistry registry, Class<?> category)
A callback that will be called exactly once after the Spi class has been instantiated and registered in aServiceRegistry
. This may be used to verify that the environment is suitable for this service, for example that native libraries can be loaded. If the service cannot function in the environment where it finds itself, it should deregister itself from the registry.Only the registry should call this method.
The default implementation does nothing.
- Specified by:
onRegistration
in interfaceRegisterableService
- Parameters:
registry
- aServiceRegistry
where this object has been registered.category
- aClass
object indicating the registry category under which this object has been registered.- See Also:
ServiceRegistry.registerServiceProvider(Object provider)
-
onDeregistration
public void onDeregistration(ServiceRegistry registry, Class<?> category)
A callback that will be whenever the Spi class has been deregistered from aServiceRegistry
.Only the registry should call this method.
The default implementation does nothing.
- Specified by:
onDeregistration
in interfaceRegisterableService
- Parameters:
registry
- aServiceRegistry
from which this object is being (wholly or partially) deregistered.category
- aClass
object indicating the registry category from which this object is being deregistered.- See Also:
ServiceRegistry.deregisterServiceProvider(Object provider)
-
getVendorName
public String getVendorName()
Returns the name of the vendor responsible for creating this service provider and its associated implementation. Because the vendor name may be used to select a service provider, it is not localized.The default implementation returns the value of the
vendorName
instance variable.- Returns:
- a non-
null
String
containing the name of the vendor.
-
getVersion
public String getVersion()
Returns a string describing the version number of this service provider and its associated implementation. Because the version may be used by transcoders to identify the service providers they understand, this method is not localized.The default implementation returns the value of the
version
instance variable.- Returns:
- a non-
null
String
containing the version of this service provider.
-
getDescription
public abstract String getDescription(Locale locale)
Returns a brief, human-readable description of this service provider and its associated implementation. The resulting string should be localized for the suppliedLocale
, if possible.- Parameters:
locale
- aLocale
for which the return value should be localized.- Returns:
- a
String
containing a description of this service provider.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
22/12/2024 14:28:54 Cette version de la page est en cache (à la date du 22/12/2024 14:28:54) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/imageio/spi/iioserviceprovider.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.