Package org.webkitgtk.jsc
Class ClassVTable
java.lang.Object
org.javagi.base.ProxyInstance
org.webkitgtk.jsc.ClassVTable
- All Implemented Interfaces:
Proxy
Virtual table for a JSCClass. This can be optionally used when registering a
JSCClass in a JSCContext
to provide a custom implementation for the class. All virtual functions are optional and can be set to
null to fallback to the default implementation.-
Constructor Summary
ConstructorsConstructorDescriptionAllocate a new ClassVTable.ClassVTable(Arena arena) Allocate a new ClassVTable.ClassVTable(MemorySegment address) Create a ClassVTable proxy instance for the provided memory address.ClassVTable(ClassGetPropertyFunction getProperty, ClassSetPropertyFunction setProperty, ClassHasPropertyFunction hasProperty, ClassDeletePropertyFunction deleteProperty, ClassEnumeratePropertiesFunction enumerateProperties) Allocate a new ClassVTable with the fields set to the provided values.ClassVTable(ClassGetPropertyFunction getProperty, ClassSetPropertyFunction setProperty, ClassHasPropertyFunction hasProperty, ClassDeletePropertyFunction deleteProperty, ClassEnumeratePropertiesFunction enumerateProperties, Arena arena) Allocate a new ClassVTable with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayoutThe memory layout of the native struct.@Nullable ClassDeletePropertyFunctionRead the value of the fielddelete_property.@Nullable ClassEnumeratePropertiesFunctionRead the value of the fieldenumerate_properties.@Nullable ClassGetPropertyFunctionRead the value of the fieldget_property.@Nullable ClassHasPropertyFunctionRead the value of the fieldhas_property.@Nullable ClassSetPropertyFunctionRead the value of the fieldset_property.voidwriteDeleteProperty(@Nullable ClassDeletePropertyFunction deleteProperty, Arena _arena) Write a value in the fielddelete_property.voidwriteEnumerateProperties(@Nullable ClassEnumeratePropertiesFunction enumerateProperties, Arena _arena) Write a value in the fieldenumerate_properties.voidwriteGetProperty(@Nullable ClassGetPropertyFunction getProperty, Arena _arena) Write a value in the fieldget_property.voidwriteHasProperty(@Nullable ClassHasPropertyFunction hasProperty, Arena _arena) Write a value in the fieldhas_property.voidwriteSetProperty(@Nullable ClassSetPropertyFunction setProperty, Arena _arena) Write a value in the fieldset_property.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ClassVTable
Create a ClassVTable proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
ClassVTable
Allocate a new ClassVTable.- Parameters:
arena- to control the memory allocation scope
-
ClassVTable
public ClassVTable()Allocate a new ClassVTable. The memory is allocated withArena.ofAuto(). -
ClassVTable
public ClassVTable(ClassGetPropertyFunction getProperty, ClassSetPropertyFunction setProperty, ClassHasPropertyFunction hasProperty, ClassDeletePropertyFunction deleteProperty, ClassEnumeratePropertiesFunction enumerateProperties, Arena arena) Allocate a new ClassVTable with the fields set to the provided values.- Parameters:
getProperty- value for the fieldgetPropertysetProperty- value for the fieldsetPropertyhasProperty- value for the fieldhasPropertydeleteProperty- value for the fielddeletePropertyenumerateProperties- value for the fieldenumeratePropertiesarena- to control the memory allocation scope
-
ClassVTable
public ClassVTable(ClassGetPropertyFunction getProperty, ClassSetPropertyFunction setProperty, ClassHasPropertyFunction hasProperty, ClassDeletePropertyFunction deleteProperty, ClassEnumeratePropertiesFunction enumerateProperties) Allocate a new ClassVTable with the fields set to the provided values. The memory is allocated withArena.ofAuto().- Parameters:
getProperty- value for the fieldgetPropertysetProperty- value for the fieldsetPropertyhasProperty- value for the fieldhasPropertydeleteProperty- value for the fielddeletePropertyenumerateProperties- value for the fieldenumerateProperties
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readGetProperty
Read the value of the fieldget_property.- Returns:
- The value of the field
get_property
-
writeGetProperty
Write a value in the fieldget_property.- Parameters:
getProperty- The new value for the fieldget_property_arena- to control the memory allocation scope
-
readSetProperty
Read the value of the fieldset_property.- Returns:
- The value of the field
set_property
-
writeSetProperty
Write a value in the fieldset_property.- Parameters:
setProperty- The new value for the fieldset_property_arena- to control the memory allocation scope
-
readHasProperty
Read the value of the fieldhas_property.- Returns:
- The value of the field
has_property
-
writeHasProperty
Write a value in the fieldhas_property.- Parameters:
hasProperty- The new value for the fieldhas_property_arena- to control the memory allocation scope
-
readDeleteProperty
Read the value of the fielddelete_property.- Returns:
- The value of the field
delete_property
-
writeDeleteProperty
Write a value in the fielddelete_property.- Parameters:
deleteProperty- The new value for the fielddelete_property_arena- to control the memory allocation scope
-
readEnumerateProperties
Read the value of the fieldenumerate_properties.- Returns:
- The value of the field
enumerate_properties
-
writeEnumerateProperties
public void writeEnumerateProperties(@Nullable ClassEnumeratePropertiesFunction enumerateProperties, Arena _arena) Write a value in the fieldenumerate_properties.- Parameters:
enumerateProperties- The new value for the fieldenumerate_properties_arena- to control the memory allocation scope
-