Commit 96d22b12 by Michael Koch Committed by Michael Koch

ServiceFactory.java, [...]: New files.

2004-04-21  Michael Koch  <konqueror@gmx.de>

	* gnu/classpath/ServiceFactory.java,
	gnu/classpath/ServiceProviderLoadingAction.java,
	javax/imageio/ImageReader.java,
	javax/imageio/ImageTranscoder.java,
	javax/imageio/ImageWriter.java,
	javax/imageio/package.html,
	javax/imageio/spi/IIOServiceProvider.java,
	javax/imageio/spi/ImageInputStreamSpi.java,
	javax/imageio/spi/ImageOutputStreamSpi.java,
	javax/imageio/spi/ImageReaderWriterSpi.java,
	javax/imageio/spi/ImageTranscoderSpi.java,
	javax/imageio/spi/RegisterableService.java,
	javax/imageio/spi/ServiceRegistry.java,
	javax/imageio/spi/package.html,
	javax/imageio/stream/IIOByteBuffer.java,
	javax/imageio/stream/ImageInputStream.java,
	javax/imageio/stream/ImageOutputStream.java,
	javax/imageio/stream/package.html:
	New files.
	* Makefile.am
	(ordinary_java_source_files): Added
	gnu/classpath/ServiceFactory.java and
	gnu/classpath/ServiceProviderLoadingAction.java.
	(javax_source_files): Added
	javax/imageio/ImageReader.java,
	javax/imageio/ImageTranscoder.java,
	javax/imageio/ImageWriter.java,
	javax/imageio/spi/IIOServiceProvider.java,
	javax/imageio/spi/ImageInputStreamSpi.java,
	javax/imageio/spi/ImageOutputStreamSpi.java,
	javax/imageio/spi/ImageReaderWriterSpi.java,
	javax/imageio/spi/ImageTranscoderSpi.java,
	javax/imageio/spi/RegisterableService.java,
	javax/imageio/spi/ServiceRegistry.java,
	javax/imageio/stream/IIOByteBuffer.java,
	javax/imageio/stream/ImageInputStream.java and
	javax/imageio/stream/ImageOutputStream.java.
	* Makefile.in: Regenerated.

From-SVN: r80951
parent ca17d211
2004-04-21 Michael Koch <konqueror@gmx.de>
* gnu/classpath/ServiceFactory.java,
gnu/classpath/ServiceProviderLoadingAction.java,
javax/imageio/ImageReader.java,
javax/imageio/ImageTranscoder.java,
javax/imageio/ImageWriter.java,
javax/imageio/package.html,
javax/imageio/spi/IIOServiceProvider.java,
javax/imageio/spi/ImageInputStreamSpi.java,
javax/imageio/spi/ImageOutputStreamSpi.java,
javax/imageio/spi/ImageReaderWriterSpi.java,
javax/imageio/spi/ImageTranscoderSpi.java,
javax/imageio/spi/RegisterableService.java,
javax/imageio/spi/ServiceRegistry.java,
javax/imageio/spi/package.html,
javax/imageio/stream/IIOByteBuffer.java,
javax/imageio/stream/ImageInputStream.java,
javax/imageio/stream/ImageOutputStream.java,
javax/imageio/stream/package.html:
New files.
* Makefile.am
(ordinary_java_source_files): Added
gnu/classpath/ServiceFactory.java and
gnu/classpath/ServiceProviderLoadingAction.java.
(javax_source_files): Added
javax/imageio/ImageReader.java,
javax/imageio/ImageTranscoder.java,
javax/imageio/ImageWriter.java,
javax/imageio/spi/IIOServiceProvider.java,
javax/imageio/spi/ImageInputStreamSpi.java,
javax/imageio/spi/ImageOutputStreamSpi.java,
javax/imageio/spi/ImageReaderWriterSpi.java,
javax/imageio/spi/ImageTranscoderSpi.java,
javax/imageio/spi/RegisterableService.java,
javax/imageio/spi/ServiceRegistry.java,
javax/imageio/stream/IIOByteBuffer.java,
javax/imageio/stream/ImageInputStream.java and
javax/imageio/stream/ImageOutputStream.java.
* Makefile.in: Regenerated.
2004-04-21 Michael Koch <konqueror@gmx.de>
* java/util/Properties.java
(load): Fix wrongly merged fix.
......
......@@ -1748,6 +1748,19 @@ javax/accessibility/AccessibleTable.java \
javax/accessibility/AccessibleTableModelChange.java \
javax/accessibility/AccessibleText.java \
javax/accessibility/AccessibleValue.java \
javax/imageio/ImageReader.java \
javax/imageio/ImageTranscoder.java \
javax/imageio/ImageWriter.java \
javax/imageio/spi/IIOServiceProvider.java \
javax/imageio/spi/ImageInputStreamSpi.java \
javax/imageio/spi/ImageOutputStreamSpi.java \
javax/imageio/spi/ImageReaderWriterSpi.java \
javax/imageio/spi/ImageTranscoderSpi.java \
javax/imageio/spi/RegisterableService.java \
javax/imageio/spi/ServiceRegistry.java \
javax/imageio/stream/IIOByteBuffer.java \
javax/imageio/stream/ImageInputStream.java \
javax/imageio/stream/ImageOutputStream.java \
javax/naming/directory/Attribute.java \
javax/naming/directory/AttributeInUseException.java \
javax/naming/directory/AttributeModificationException.java \
......@@ -2187,6 +2200,8 @@ java/util/regex/PatternSyntaxException.java
## awt_java_source_files. If the .java file has a hand-maintained
## header, please list it in special_java_source_files.
ordinary_java_source_files = $(core_java_source_files) \
gnu/classpath/ServiceFactory.java \
gnu/classpath/ServiceProviderLoadingAction.java \
gnu/gcj/Core.java \
gnu/gcj/RawData.java \
gnu/gcj/io/DefaultMimeTypes.java \
......
......@@ -1432,6 +1432,19 @@ javax/accessibility/AccessibleTable.java \
javax/accessibility/AccessibleTableModelChange.java \
javax/accessibility/AccessibleText.java \
javax/accessibility/AccessibleValue.java \
javax/imageio/ImageReader.java \
javax/imageio/ImageTranscoder.java \
javax/imageio/ImageWriter.java \
javax/imageio/spi/IIOServiceProvider.java \
javax/imageio/spi/ImageInputStreamSpi.java \
javax/imageio/spi/ImageOutputStreamSpi.java \
javax/imageio/spi/ImageReaderWriterSpi.java \
javax/imageio/spi/ImageTranscoderSpi.java \
javax/imageio/spi/RegisterableService.java \
javax/imageio/spi/ServiceRegistry.java \
javax/imageio/stream/IIOByteBuffer.java \
javax/imageio/stream/ImageInputStream.java \
javax/imageio/stream/ImageOutputStream.java \
javax/naming/directory/Attribute.java \
javax/naming/directory/AttributeInUseException.java \
javax/naming/directory/AttributeModificationException.java \
......@@ -1862,6 +1875,8 @@ java/util/regex/PatternSyntaxException.java
ordinary_java_source_files = $(core_java_source_files) \
gnu/classpath/ServiceFactory.java \
gnu/classpath/ServiceProviderLoadingAction.java \
gnu/gcj/Core.java \
gnu/gcj/RawData.java \
gnu/gcj/io/DefaultMimeTypes.java \
......@@ -3010,9 +3025,10 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/awt/xlib/XGraphicsConfiguration.P \
.deps/gnu/awt/xlib/XOffScreenImage.P .deps/gnu/awt/xlib/XPanelPeer.P \
.deps/gnu/awt/xlib/XToolkit.P .deps/gnu/classpath/Configuration.P \
.deps/gnu/gcj/Core.P .deps/gnu/gcj/RawData.P \
.deps/gnu/gcj/convert/BytesToUnicode.P .deps/gnu/gcj/convert/Convert.P \
.deps/gnu/gcj/convert/IOConverter.P \
.deps/gnu/classpath/ServiceFactory.P \
.deps/gnu/classpath/ServiceProviderLoadingAction.P .deps/gnu/gcj/Core.P \
.deps/gnu/gcj/RawData.P .deps/gnu/gcj/convert/BytesToUnicode.P \
.deps/gnu/gcj/convert/Convert.P .deps/gnu/gcj/convert/IOConverter.P \
.deps/gnu/gcj/convert/Input_8859_1.P \
.deps/gnu/gcj/convert/Input_ASCII.P \
.deps/gnu/gcj/convert/Input_EUCJIS.P \
......@@ -4233,6 +4249,18 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/javax/accessibility/AccessibleTableModelChange.P \
.deps/javax/accessibility/AccessibleText.P \
.deps/javax/accessibility/AccessibleValue.P \
.deps/javax/imageio/ImageReader.P .deps/javax/imageio/ImageTranscoder.P \
.deps/javax/imageio/ImageWriter.P \
.deps/javax/imageio/spi/IIOServiceProvider.P \
.deps/javax/imageio/spi/ImageInputStreamSpi.P \
.deps/javax/imageio/spi/ImageOutputStreamSpi.P \
.deps/javax/imageio/spi/ImageReaderWriterSpi.P \
.deps/javax/imageio/spi/ImageTranscoderSpi.P \
.deps/javax/imageio/spi/RegisterableService.P \
.deps/javax/imageio/spi/ServiceRegistry.P \
.deps/javax/imageio/stream/IIOByteBuffer.P \
.deps/javax/imageio/stream/ImageInputStream.P \
.deps/javax/imageio/stream/ImageOutputStream.P \
.deps/javax/naming/AuthenticationException.P \
.deps/javax/naming/AuthenticationNotSupportedException.P \
.deps/javax/naming/BinaryRefAddr.P .deps/javax/naming/Binding.P \
......
/* ServiceProviderLoadingAction.java -- Action for loading plug-in services.
Copyright (C) 2004 Free Software Foundation
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.classpath;
import java.security.PrivilegedExceptionAction;
/**
* A privileged action for creating a new instance of a service
* provider.
*
* <p>Class loading and instantiation is encapsulated in a
* <code>PriviledgedAction</code> in order to restrict the loaded
* service providers to the {@link java.security.AccessControlContext}
* that was active when {@link
* gnu.classpath.ServiceFactory#lookupProviders} was called, even
* though the actual loading is delayed to the time when the provider
* is actually needed.
*
* @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
*/
final class ServiceProviderLoadingAction
implements PrivilegedExceptionAction
{
/**
* The interface to which the loaded service provider implementation
* must conform. Usually, this is a Java interface type, but it
* might also be an abstract class or even a concrete class.
*/
private final Class spi;
/**
* The fully qualified name of the class that gets loaded when
* this action is executed.
*/
private final String providerName;
/**
* The ClassLoader that gets used for loading the service provider
* class.
*/
private final ClassLoader loader;
/**
* Constructs a privileged action for loading a service provider.
*
* @param spi the interface to which the loaded service provider
* implementation must conform. Usually, this is a Java interface
* type, but it might also be an abstract class or even a concrete
* superclass.
*
* @param providerName the fully qualified name of the class that
* gets loaded when this action is executed.
*
* @param loader the ClassLoader that gets used for loading the
* service provider class.
*
* @throws IllegalArgumentException if <code>spi</code>,
* <code>providerName</code> or <code>loader</code> is
* <code>null</code>.
*/
ServiceProviderLoadingAction(Class spi, String providerName,
ClassLoader loader)
{
if (spi == null || providerName == null || loader == null)
throw new IllegalArgumentException();
this.spi = spi;
this.providerName = providerName;
this.loader = loader;
}
/**
* Loads an implementation class for a service provider, and creates
* a new instance of the loaded class by invoking its public
* no-argument constructor.
*
* @return a new instance of the class whose name was passed as
* <code>providerName</code> to the constructor.
*
* @throws ClassCastException if the service provider does not
* implement the <code>spi</code> interface that was passed to the
* constructor.
*
* @throws IllegalAccessException if the service provider class or
* its no-argument constructor are not <code>public</code>.
*
* @throws InstantiationException if the service provider class is
* <code>abstract</code>, an interface, a primitive type, an array
* class, or void; or if service provider class does not have a
* no-argument constructor; or if there some other problem with
* creating a new instance of the service provider.
*/
public Object run()
throws Exception
{
Class loadedClass;
Object serviceProvider;
loadedClass = loader.loadClass(providerName);
serviceProvider = loadedClass.newInstance();
// Ensure that the loaded provider is actually implementing
// the service provider interface.
if (!spi.isInstance(serviceProvider))
throw new ClassCastException(spi.getName());
return serviceProvider;
}
}
/* ImageReader.java -- Decodes raster images.
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.imageio;
public abstract class ImageReader
{
// FIXME: Incomplete. This class is merely present in order to allow
// compilation of the javax.imageio.spi package, for which GNU
// Classpath does provide an implementation.
}
/* ImageTranscoder.java -- Image metadata transcoder.
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.imageio;
public interface ImageTranscoder
{
// FIXME: Incomplete. This interface is merely present in order to
// allow compilation of the javax.imageio.spi package, for which GNU
// Classpath does provide an implementation.
}
/* ImageWriter.java -- Encodes raster images.
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.imageio;
public abstract class ImageWriter
implements ImageTranscoder
{
// FIXME: Incomplete. This class is merely present in order to allow
// compilation of the javax.imageio.spi package, for which GNU
// Classpath does provide an implementation.
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!-- package.html - describes classes in javax.imageio package.
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. -->
<html>
<head><title>GNU Classpath - javax.imageio</title></head>
<body>
<p></p>
</body>
</html>
/* IIOServiceProvider.java -- General service provider for image I/O.
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.imageio.spi;
import java.util.Locale;
/**
* An abstract superclass for service providers that perform image I/O.
*
* @since 1.4
*
* @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
*/
public abstract class IIOServiceProvider
implements RegisterableService
{
/**
* The vendor of this service provider, or <code>null</code> if the
* subclass constructor did not set this field.
*
* @see #getVendorName()
*/
protected String vendorName;
/**
* The version of this service provider, or <code>null</code> if the
* subclass constructor did not set this field.
*
* @see #getVersion()
*/
protected String version;
/**
* Constructs a general <code>IIOServiceProvider</code>, given the
* vendor name and a version string.
*
* @throws IllegalArgumentException if <code>vendorName</code>
* or <code>version</code> is <code>null</code>.
*/
public IIOServiceProvider(String vendorName, String version)
{
if (vendorName == null || version == null)
throw new IllegalArgumentException();
this.vendorName = vendorName;
this.version = version;
}
/**
* Constructs a general <code>IIOServiceProvider</code> without
* specifying a vendor name and a version string. The subclass
* constructor should set the {@link #vendorName} and {@link
* #version} to non-null values.
*/
public IIOServiceProvider()
{
}
/**
* Informs this service provider that it has been registered in a
* {@link ServiceRegistry}. If this provider gets registered as an
* implementor for several service categories, its
* <code>onRegistration</code> method will be called multiple times.
* The default implementation does nothing.
*
* @param registry the registry to which this service provider has
* been added.
*
* @param category the service category for which this provider has
* been registered as an implementor.
*/
public void onRegistration(ServiceRegistry registry, Class category)
{
}
/**
* Informs this service provider that it has been de-registered from
* a {@link ServiceRegistry}. If this provider had been registered
* as an implementor for several service categories, its
* <code>onDeregistration</code> method will be called multiple
* times. The default implementation does nothing.
*
* @param registry the registry from which this service provider has
* been removed.
*
* @param category the service category for which this provider has
* been registered as an implementor.
*/
public void onDeregistration(ServiceRegistry registry, Class category)
{
}
/**
* Returns the name of the vendor of this service provider.
*/
public String getVendorName()
{
return vendorName;
}
/**
* Returns an identifier string for the version of this service
* provider.
*/
public String getVersion()
{
return version;
}
/**
* Returns a short description of this service provider that can be
* presented to a human user.
*
* @param locale the locale for which the description string should
* be localized.
*/
public abstract String getDescription(Locale locale);
}
/* ImageInputStreamSpi.java -- Service provider for image input streams.
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.imageio.spi;
import java.io.File;
import java.io.IOException;
import javax.imageio.stream.ImageInputStream;
/**
* An abstract superclass for service providers that create
* {@linkplain javax.imageio.stream.ImageInputStream image input
* streams} for a file, URL, byte array or any other source.
*
* @since 1.4
*
* @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
*/
public abstract class ImageInputStreamSpi
extends IIOServiceProvider
{
/**
* Indicates which kind of input is processable by the streams
* created by {@link #createInputStreamInstance(Object)}.
*/
protected Class inputClass;
/**
* Constructs a service provider for image input streams, given no
* parameters. It is up to the sub-class to set {@link #vendorName},
* {@link #version} and {@link #inputClass} to non-null values.
*/
protected ImageInputStreamSpi()
{
}
/**
* Constructs a service provider for image input streams, given the
* vendor name and a version string.
*
* @throws IllegalArgumentException if <code>vendorName</code>
* or <code>version</code> is <code>null</code>.
*/
public ImageInputStreamSpi(String vendorName, String version,
Class inputClass)
{
super(vendorName, version);
this.inputClass = inputClass;
}
/**
* Determines which kind of input is processable by the streams
* created by {@link #createInputStreamInstance(Object)}.
*/
public Class getInputClass()
{
return inputClass;
}
/**
* Determines whether <code>ImageInputStreams</code> created
* by this service provider benefit from using a cache file.
*
* <p>The default behavior is to return <code>false</code>.
*
* @return <code>true</code> if the created streams are faster or
* need less memory when a cache file is being used;
* <code>false</code> if no positive effect results from the cache
* file.
*/
public boolean canUseCacheFile()
{
return false;
}
/**
* Determines whether <code>ImageInputStreams</code> created
* by this service provider require the use of a cache file.
*
* <p>The default behavior is to return <code>false</code>.
*
* @return <code>true</code> if the created streams can only work
* when a cache file is being used; <code>false</code> if no cache
* file is needed.
*/
public boolean needsCacheFile()
{
return false;
}
public abstract ImageInputStream createInputStreamInstance(Object input,
boolean useCache,
File cacheDir)
throws IOException;
public ImageInputStream createInputStreamInstance(Object input)
throws IOException
{
return createInputStreamInstance(input, canUseCacheFile(), null);
}
}
/* ImageOutputStreamSpi.java -- Service provider for image output streams.
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.imageio.spi;
import java.io.File;
import java.io.IOException;
import javax.imageio.stream.ImageOutputStream;
/**
* An abstract superclass for service providers that create
* {@linkplain javax.imageio.stream.ImageOutputStream image output
* streams} for a file, URL, byte array or any other target.
*
* @since 1.4
*
* @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
*/
public abstract class ImageOutputStreamSpi
extends IIOServiceProvider
{
/**
* Indicates which kind of output is produced by the streams
* created by {@link #createOutputStreamInstance(Object)}.
*/
protected Class outputClass;
/**
* Constructs a service provider for image output streams, given no
* parameters. It is up to the sub-class to set {@link #vendorName},
* {@link #version} and {@link #outputClass} to non-null values.
*/
protected ImageOutputStreamSpi()
{
}
/**
* Constructs a service provider for image output streams, given the
* vendor name, a version string and the kind of producable output.
*
* @throws IllegalArgumentException if <code>vendorName</code>
* or <code>version</code> is <code>null</code>.
*/
public ImageOutputStreamSpi(String vendorName, String version,
Class outputClass)
{
super(vendorName, version);
this.outputClass = outputClass;
}
/**
* Determines which kind of output is produced by the streams
* created by {@link #createOutputStreamInstance(Object)}.
*/
public Class getOutputClass()
{
return outputClass;
}
/**
* Determines whether <code>ImageOutputStreams</code> created
* by this service provider benefit from using a cache file.
*
* <p>The default behavior is to return <code>false</code>.
*
* @return <code>true</code> if the created streams are faster or
* need less memory when a cache file is being used;
* <code>false</code> if no positive effect results from the cache
* file.
*/
public boolean canUseCacheFile()
{
return false;
}
/**
* Determines whether <code>ImageOutputStreams</code> created
* by this service provider require the use of a cache file.
*
* <p>The default behavior is to return <code>false</code>.
*
* @return <code>true</code> if the created streams can only work
* when a cache file is being used; <code>false</code> if no cache
* file is needed.
*/
public boolean needsCacheFile()
{
return false;
}
public abstract ImageOutputStream createOutputStreamInstance(
Object output, boolean useCache, File cacheDir)
throws IOException;
public ImageOutputStream createOutputStreamInstance(Object output)
throws IOException
{
return createOutputStreamInstance(output, canUseCacheFile(), null);
}
}
/* ImageTranscoderSpi.java -- Factory for image metadata transcoders.
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.imageio.spi;
import javax.imageio.ImageTranscoder;
/**
* An abstract superclass for service providers that create
* {@linkplain javax.imageio.ImageTranscoder image metadata
* transcoders}.
*
* @since 1.4
*
* @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
*/
public abstract class ImageTranscoderSpi
extends IIOServiceProvider
{
/**
* Constructs a service provider for image metadata transcoders,
* given no parameters. It is up to the sub-class to set {@link
* #vendorName} and {@link #version} to non-null values.
*/
protected ImageTranscoderSpi()
{
}
/**
* Constructs a service provider for image metadata transcoders,
* given the vendor name and a version string.
*
* @throws IllegalArgumentException if <code>vendorName</code>
* or <code>version</code> is <code>null</code>.
*/
public ImageTranscoderSpi(String vendorName, String version)
{
super(vendorName, version);
}
public abstract String getReaderServiceProviderName();
public abstract String getWriterServiceProviderName();
public abstract ImageTranscoder createTranscoderInstance();
}
/* RegisterableService.java -- An interface for service providers.
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.imageio.spi;
/**
* An interface which service providers may optionally implement in
* order to get notified when they are added or removed from a {@link
* ServiceRegistry}.
*
* @since 1.4
*
* @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
*/
public interface RegisterableService
{
/**
* Informs this service provider that it has been registered in a
* {@link ServiceRegistry}. If this provider gets registered as an
* implementor for several service categories, its
* <code>onRegistration</code> method will be called multiple times.
*
* @param registry the registry to which this service provider has
* been added.
*
* @param category the service category for which this provider has
* been registered as an implementor.
*/
void onRegistration(ServiceRegistry registry, Class category);
/**
* Informs this service provider that it has been de-registered from
* a {@link ServiceRegistry}. If this provider had been registered
* as an implementor for several service categories, its
* <code>onDeregistration</code> method will be called multiple
* times.
*
* @param registry the registry from which this service provider has
* been removed.
*
* @param category the service category for which this provider has
* been registered as an implementor.
*/
void onDeregistration(ServiceRegistry registry, Class category);
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!-- package.html - describes classes in javax.imageio.spi package.
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. -->
<html>
<head><title>GNU Classpath - javax.imageio.spi</title></head>
<body>
<p></p>
</body>
</html>
/* IIOByteBuffer.java
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.imageio.stream;
/**
* A data structure for holding a reference to a byte array, an index
* into that array, and a number of bytes, that can be passed to one
* specific variant of the {@link
* javax.imageio.stream.ImageInputStream#readBytes(IIOByteBuffer, int)
* readBytes} method.
*
* @since 1.4
*
* @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
*/
public class IIOByteBuffer
{
private byte[] data;
private int offset;
private int length;
public IIOByteBuffer(byte[] data, int offset, int length)
{
this.data = data;
this.offset = offset;
this.length = length;
}
public byte[] getData()
{
return data;
}
public void setData(byte[] data)
{
this.data = data;
}
public int getOffset()
{
return offset;
}
public void setOffset(int offset)
{
this.offset = offset;
}
public int getLength()
{
return length;
}
public void setLength(int length)
{
this.length = length;
}
}
/* ImageOutputStream.java
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package javax.imageio.stream;
import java.io.DataOutput;
/**
* An output stream for use by {@link javax.imageio.ImageWriter
* ImageWriters}.
*
* @since 1.4
*
* @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
*/
public interface ImageOutputStream
extends ImageInputStream, DataOutput
{
// FIXME: Incomplete. This interface is merely present in order to
// allow compilation of the javax.imageio.spi package, for which GNU
// Classpath does provide an implementation.
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!-- package.html - describes classes in javax.imageio.stream package.
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. -->
<html>
<head><title>GNU Classpath - javax.imageio.stream</title></head>
<body>
<p></p>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment