| |
|
| java.lang.Object javax.media.jai.remote.SerializerFactory
SerializerFactory | final public class SerializerFactory (Code) | | A utility class which provides factory methods for obtaining
Serializer instances.
The Serializer s are maintained in a centralized repository
which is organized based on the classes supported by the
Serializer s and the order in which the Serializer s
were registered. Convenience methods similar to those defined in the
Serializer class are also provided. These enable
functionality equivalent to a single Serializer which
supports all the classes supported by the aggregate of all
Serializer s resident in the repository.
By default Serializer s for the following classes
are registered by JAI:
java.awt.RenderingHints
(entries which are neither Serializable nor supported by
SerializerFactory are omitted; support for specific
RenderingHints.Key subclasses may be added by new
Serializer s);
java.awt.RenderingHints.Key
(limited to RenderingHints.Key s defined in
java.awt.RenderingHints and javax.media.jai.JAI );
java.awt.Shape ;
java.awt.image.DataBufferByte ;
java.awt.image.DataBufferShort ;
java.awt.image.DataBufferUShort ;
java.awt.image.DataBufferInt ;
javax.media.jai.DataBufferFloat ;
javax.media.jai.DataBufferDouble ;
java.awt.image.ComponentSampleModel ;
java.awt.image.BandedSampleModel ;
java.awt.image.PixelInterleavedSampleModel ;
java.awt.image.SinglePixelPackedSampleModel ;
java.awt.image.MultiPixelPackedSampleModel ;
javax.media.jai.ComponentSampleModelJAI ;
java.awt.image.Raster
(limited to Raster s which have a DataBuffer
and SampleModel supported by a Serializer );
java.awt.image.WritableRaster
(limited to WritableRaster s which have a
DataBuffer and SampleModel supported by a
Serializer );
java.awt.image.ComponentColorModel ;
java.awt.image.IndexColorModel ;
java.awt.image.DirectColorModel ;
javax.media.jai.FloatColorModel ;
java.awt.image.renderable.RenderContext ;
(constrained by the aforementioned limitations of
the RenderingHints Serializer );
java.awt.image.RenderedImage
(limited to RenderedImage s which have Raster s
and a ColorModel supported by a Serializer );
java.awt.image.WritableRenderedImage
(limited to WritableRenderedImage s which have
Raster s and a ColorModel supported by a
Serializer );
java.io.Serializable ;
java.util.HashSet
(elements which are neither Serializable nor supported by
SerializerFactory are omitted);
java.util.Hashtable
(entries which are neither Serializable nor supported by
SerializerFactory are omitted);
java.util.Vector
(elements which are neither Serializable nor supported by
SerializerFactory are omitted);
See Also: SerializableState See Also: Serializer See Also: java.io.Serializable since: JAI 1.1 |
Method Summary | |
public static Class | getDeserializedClass(Class c) Determines the Class of which the deserialized form of the
supplied Class will be an instance. | public static synchronized Serializer | getSerializer(Class c) Retrieves a Serializer for a given class c .
If more than one Serializer is available for the class
then the most recently registered Serializer will be
returned. | public static synchronized Serializer[] | getSerializers(Class c) Retrieves an array of all Serializer s currently
resident in the repository which directly support the specified
Class . | public static SerializableState | getState(Object o, RenderingHints h) Converts an object into a state-preserving object which may
be serialized. | final public static SerializableState | getState(Object o) A convenience wrapper around
getState(Object o, RenderingHints h) with
the RenderingHints parameter h set
to null . | public static Class[] | getSupportedClasses() Returns an array listing all classes and interfaces on which the
isSupportedClass() method of this class may be invoked
and return true . | public static boolean | isSupportedClass(Class c) Whether there is currently resident in the repository a
Serializer the getSupportedClass()
method of which returns a value equal to the parameter supplied
to this method according to equals() .
Parameters: c - The class to be tested for compatibility. | public static synchronized void | registerSerializer(Serializer s) Adds a Serializer to the repository. | public static synchronized void | unregisterSerializer(Serializer s) Removes a Serializer from the repository. |
SerializerFactory | protected SerializerFactory()(Code) | | |
getDeserializedClass | public static Class getDeserializedClass(Class c)(Code) | | Determines the Class of which the deserialized form of the
supplied Class will be an instance. Specifically, this
method returns the Class of the Object
returned by invoking getObject() on the
SerializableState returned by getState()
after the state object has been serialized and deserialized. The
returned value will equal the supplied argument unless there is no
Serializer explicitly registered for this class but there
is a Serializer registered for a superclass with a
permitsSubclasses() method that returns
true .
Parameters: The - Class for which the deserialized class type isrequested. The deserialized Class or null . exception: IllegalArgumentException - if c isnull |
getSerializer | public static synchronized Serializer getSerializer(Class c)(Code) | | Retrieves a Serializer for a given class c .
If more than one Serializer is available for the class
then the most recently registered Serializer will be
returned. If no registered Serializer exists which
directly supports the specified class, i.e., one for which the
getSupportedClass() returns a value equal to the
specified class, then a Serializer may be returned
which is actually registered against a superclass but permits
subclass serialization.
Parameters: c - The class for which Serializer s will beretrieved. A Serializer which supports the specified class.or null if none is available. exception: IllegalArgumentException - if c isnull . See Also: java.awt.image.BandedSampleModel See Also: java.awt.image.ComponentSampleModel |
getSerializers | public static synchronized Serializer[] getSerializers(Class c)(Code) | | Retrieves an array of all Serializer s currently
resident in the repository which directly support the specified
Class . Serializer s which support
a superclass of the specified class and permit subclass
serialization will not be included.
Parameters: c - The class for which Serializer s will beretrieved. exception: IllegalArgumentException - if c isnull . |
getState | public static SerializableState getState(Object o, RenderingHints h)(Code) | | Converts an object into a state-preserving object which may
be serialized. If the class of the object parameter is supported
explicitly, i.e., isSupportedClass(o.getClass())
returns true , then the object will be converted into
a form which may be deserialized into an instance of the same class.
If the class is not supported explicitly but implements one or
more supported interfaces, then it will be converted into a
form which may be deserialized into an instance of an unspecified
class which implements all interfaces which are both implemented by
the class of the object and supported by some Serializer
currently resident in the repository. If the object is
null , the returned SerializableState will
return null from its getObject() method
and java.lang.Object.class from its
getObjectClass() method.
Parameters: o - The object to be converted into a serializable form. Parameters: h - Configuration parameters the exact nature of which isSerializer -dependent. If null ,reasonable default settings should be used. A serializable form of the supplied object. exception: IllegalArgumentException - if o isnon-null and eitherisSupportedClass(o.getClass()) returnsfalse , or o is not an instance of a class supported by aSerializer in the repository or whichimplements at least one interface supported by someSerializer s in the repository. |
getState | final public static SerializableState getState(Object o)(Code) | | A convenience wrapper around
getState(Object o, RenderingHints h) with
the RenderingHints parameter h set
to null .
|
getSupportedClasses | public static Class[] getSupportedClasses()(Code) | | Returns an array listing all classes and interfaces on which the
isSupportedClass() method of this class may be invoked
and return true .
An array of all supported classes and interfaces. |
isSupportedClass | public static boolean isSupportedClass(Class c)(Code) | | Whether there is currently resident in the repository a
Serializer the getSupportedClass()
method of which returns a value equal to the parameter supplied
to this method according to equals() .
Parameters: c - The class to be tested for compatibility. Whether the specified class is directly supported. exception: IllegalArgumentException - if c isnull |
registerSerializer | public static synchronized void registerSerializer(Serializer s)(Code) | | Adds a Serializer to the repository.
Parameters: s - The Serializer s to be added to the repository. exception: IllegalArgumentException - if s isnull |
unregisterSerializer | public static synchronized void unregisterSerializer(Serializer s)(Code) | | Removes a Serializer from the repository.
Parameters: s - The Serializer s to be removed from the repository. exception: IllegalArgumentException - if s isnull |
|
|
|