Class JNINativeMethod

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer


    public class JNINativeMethod
    extends Struct
    implements NativeResource

    Layout

     struct JNINativeMethod {
         char * name;
         char * signature;
         void * fnPtr;
     }
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
    • Constructor Detail

      • JNINativeMethod

        public JNINativeMethod(java.nio.ByteBuffer container)
        Creates a JNINativeMethod instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • name

        public java.nio.ByteBuffer name()
        Returns a ByteBuffer view of the null-terminated string pointed to by the name field.
      • nameString

        public java.lang.String nameString()
        Decodes the null-terminated string pointed to by the name field.
      • signature

        public java.nio.ByteBuffer signature()
        Returns a ByteBuffer view of the null-terminated string pointed to by the signature field.
      • signatureString

        public java.lang.String signatureString()
        Decodes the null-terminated string pointed to by the signature field.
      • fnPtr

        public long fnPtr()
        Returns the value of the fnPtr field.
      • name

        public JNINativeMethod name(java.nio.ByteBuffer value)
        Sets the address of the specified encoded string to the name field.
      • signature

        public JNINativeMethod signature(java.nio.ByteBuffer value)
        Sets the address of the specified encoded string to the signature field.
      • fnPtr

        public JNINativeMethod fnPtr(long value)
        Sets the specified value to the fnPtr field.
      • set

        public JNINativeMethod set(java.nio.ByteBuffer name,
                                   java.nio.ByteBuffer signature,
                                   long fnPtr)
        Initializes this struct with the specified values.
      • set

        public JNINativeMethod set(JNINativeMethod src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • create

        public static JNINativeMethod create(long address)
        Returns a new JNINativeMethod instance for the specified memory address or null if the address is NULL.
      • create

        public static JNINativeMethod.Buffer create(long address,
                                                    int capacity)
        Create a JNINativeMethod.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • validate

        public static void validate(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate
      • validate

        public static void validate(long array,
                                    int count)
        Calls JNINativeMethod.validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array