public abstract class NativeObject extends Object implements AutoCloseable
Modifier and Type | Class and Description |
---|---|
protected static class |
NativeObject.Handle
A class for managing the underlying native pointer.
|
static class |
NativeObject.Initializer
A class for propagating low level pointer arguments up the constructor
chain.
|
static interface |
NativeObject.TypeProvider
Register implementations of this interface via the
ServiceLoader
mechanism to provide new native object registrations externally. |
static class |
NativeObject.TypeRegistration<T extends NativeObject>
Registration for creating native object subclasses for specific GTypes.
|
Modifier | Constructor and Description |
---|---|
protected |
NativeObject(NativeObject.Handle handle) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Implements
AutoCloseable.close() by calling dispose() . |
void |
disown()
Disown this object.
|
void |
dispose()
Dispose this object, and potentially clear (free, unref, etc.) the
underlying native object if this object owns the reference.
|
boolean |
equals(Object o) |
protected org.freedesktop.gstreamer.lowlevel.GPointer |
getPointer() |
protected com.sun.jna.Pointer |
getRawPointer() |
int |
hashCode() |
void |
invalidate()
Invalidate this object without clearing (free, unref, etc.) the
underlying native object.
|
String |
toString() |
protected NativeObject(NativeObject.Handle handle)
public void disown()
The underlying reference will remain valid.
public void close()
AutoCloseable.close()
by calling dispose()
.
If writing a NativeObject subclass you almost certainly want to override dispose() to customize behaviour unless you have a very specific reason that try-with-resources should work differently.
close
in interface AutoCloseable
public void dispose()
After calling this method this object should not be used.
protected org.freedesktop.gstreamer.lowlevel.GPointer getPointer()
protected com.sun.jna.Pointer getRawPointer()
public void invalidate()
After calling this method this object should not be used.
Copyright © 2019 gstreamer-java. All rights reserved.