Class ObjCPropertyAttribute

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

    public class ObjCPropertyAttribute
    extends Struct
    implements NativeResource
    Defines a property attribute.

    Member documentation

    • name – the name of the attribute
    • value – the value of the attribute (usually empty)

    Layout

    
     struct objc_property_attribute_t {
         char * name;
         char * value;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • NAME, VALUE

        The struct member offsets.
    • Constructor Detail

      • ObjCPropertyAttribute

        public ObjCPropertyAttribute​(java.nio.ByteBuffer container)
        Creates a ObjCPropertyAttribute 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.
      • value

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

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

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

        public ObjCPropertyAttribute value​(java.nio.ByteBuffer value)
        Sets the address of the specified encoded string to the value field.
      • set

        public ObjCPropertyAttribute set​(java.nio.ByteBuffer name,
                                         java.nio.ByteBuffer value)
        Initializes this struct with the specified values.
      • malloc

        public static ObjCPropertyAttribute malloc()
        Returns a new ObjCPropertyAttribute instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static ObjCPropertyAttribute calloc()
        Returns a new ObjCPropertyAttribute instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static ObjCPropertyAttribute create​(long address)
        Returns a new ObjCPropertyAttribute instance for the specified memory address.
      • createSafe

        @Nullable
        public static ObjCPropertyAttribute createSafe​(long address)
        Like create, but returns null if address is NULL.
      • callocStack

        public static ObjCPropertyAttribute callocStack()
        Returns a new ObjCPropertyAttribute instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static ObjCPropertyAttribute mallocStack​(MemoryStack stack)
        Returns a new ObjCPropertyAttribute instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static ObjCPropertyAttribute callocStack​(MemoryStack stack)
        Returns a new ObjCPropertyAttribute instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • nname

        public static java.nio.ByteBuffer nname​(long struct)
        Unsafe version of name().
      • nnameString

        public static java.lang.String nnameString​(long struct)
        Unsafe version of nameString().
      • nvalue

        public static java.nio.ByteBuffer nvalue​(long struct)
        Unsafe version of value().
      • nvalueString

        public static java.lang.String nvalueString​(long struct)
        Unsafe version of valueString().
      • nname

        public static void nname​(long struct,
                                 java.nio.ByteBuffer value)
        Unsafe version of name.
      • nvalue

        public static void nvalue​(long struct,
                                  java.nio.ByteBuffer value)
        Unsafe version of value.
      • 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 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