Class ContentDeserializer
- All Implemented Interfaces:
Proxy
,AsyncResult
GdkContentDeserializer
is used to deserialize content received via
inter-application data transfers.
The GdkContentDeserializer
transforms serialized content that is
identified by a mime type into an object identified by a GType.
GTK provides serializers and deserializers for common data types
such as text, colors, images or file lists. To register your own
deserialization functions, use Gdk.contentRegisterDeserializer(java.lang.String, org.gnome.glib.Type, org.gnome.gdk.ContentDeserializeFunc)
.
Also see ContentSerializer
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Inner class implementing a builder pattern to construct a GObject with properties.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gio.AsyncResult
AsyncResult.AsyncResultIface, AsyncResult.AsyncResultImpl
-
Constructor Summary
ConstructorDescriptionContentDeserializer
(MemorySegment address) Create a ContentDeserializer proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ContentDeserializer
asParent()
Returns this instance as if it were its parent type.static ContentDeserializer.Builder
<? extends ContentDeserializer.Builder> builder()
AContentDeserializer.Builder
object constructs aContentDeserializer
with the specified properties.Gets the cancellable for the current operation.getGtype()
Gets theGType
to create an instance of.Gets the input stream for the current operation.Gets the mime type to deserialize from.int
Gets the I/O priority for the current operation.Gets the data that was associated with the current operation.static Type
getType()
Get the GType of the ContentDeserializer classGets the user data that was passed when the deserializer was registered.getValue()
Gets theGValue
to store the deserialized object in.void
returnError
(GError error) Indicate that the deserialization has ended with an error.void
Indicate that the deserialization has been successfully completed.void
setTaskData
(@Nullable MemorySegment data) Associate data with the current deserialization operation.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gio.AsyncResult
getSourceObject, isTagged, legacyPropagateError
-
Constructor Details
-
ContentDeserializer
Create a ContentDeserializer proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
getCancellable
Gets the cancellable for the current operation.This is the
GCancellable
that was passed toGdk.contentDeserializeAsync(org.gnome.gio.InputStream, java.lang.String, org.gnome.glib.Type, int, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
.- Returns:
- the cancellable for the current operation
-
getGtype
Gets theGType
to create an instance of.- Returns:
- the
GType
for the current operation
-
getInputStream
Gets the input stream for the current operation.This is the stream that was passed to
Gdk.contentDeserializeAsync(org.gnome.gio.InputStream, java.lang.String, org.gnome.glib.Type, int, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
.- Returns:
- the input stream for the current operation
-
getMimeType
Gets the mime type to deserialize from.- Returns:
- the mime type for the current operation
-
getPriority
public int getPriority()Gets the I/O priority for the current operation.This is the priority that was passed to
Gdk.contentDeserializeAsync(org.gnome.gio.InputStream, java.lang.String, org.gnome.glib.Type, int, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
.- Returns:
- the I/O priority for the current operation
-
getTaskData
Gets the data that was associated with the current operation.- Returns:
- the task data for this ContentDeserializer
-
getUserData
Gets the user data that was passed when the deserializer was registered.- Specified by:
getUserData
in interfaceAsyncResult
- Returns:
- the user data for this deserializer
-
getValue
Gets theGValue
to store the deserialized object in.- Returns:
- the
GValue
for the current operation
-
returnError
Indicate that the deserialization has ended with an error.This function consumes
error
.- Parameters:
error
- aGError
-
returnSuccess
public void returnSuccess()Indicate that the deserialization has been successfully completed. -
setTaskData
Associate data with the current deserialization operation.- Parameters:
data
- data to associate with this operation
-
builder
AContentDeserializer.Builder
object constructs aContentDeserializer
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withContentDeserializer.Builder.build()
.
-