public void add(CFType value) { add(value.as(VoidPtr.class)); } public void add(NSObject value) {
@Override protected final void finalize() throws Throwable { dispose(true); }
public static /*<name>*/SecAttrKeyType/*</name>*/ valueOf(/*<type>*/CFType/*</type>*/ value) { for (/*<name>*/SecAttrKeyType/*</name>*/ v : values) { if (v.value().equals(value)) { return v; } } throw new IllegalArgumentException("No constant with value " + value + " found in " + /*<name>*/SecAttrKeyType/*</name>*/.class.getName()); }
@Override public String toString() { try (CFString s = getDescription()) { return s.toString(); } }
@AfterBridgeCall public static void afterJavaToNative(String before, long after, long flags) { if (after != 0) { // after is the handle of the CFString returned by toNative(). // We've already disposed the Java peer so we have to release the // ObjC CFString now. release(after); } } }
static CFType toObject(Class<? extends CFType> cls, long handle, long flags, boolean retain) { if (handle == 0) { return null; } long typeId = getTypeID(handle); Class<? extends CFType> cfTypeClass = allCFTypeClasses.get(typeId); if (cfTypeClass != null && cfTypeClass != cls) { if (cls.isAssignableFrom(cfTypeClass)) { /* * Only use cfTypeClass if it's a subclass of the expected * type (cls). */ cls = cfTypeClass; } } CFType o = (CFType) NativeObject.Marshaler.toObject(cls, handle, flags); if (retain) { retain(handle); } return o; } @MarshalsPointer
public static /*<name>*/SecMatchLimit/*</name>*/ valueOf(/*<type>*/CFType/*</type>*/ value) { for (/*<name>*/SecMatchLimit/*</name>*/ v : values) { if (v.value().equals(value)) { return v; } } throw new IllegalArgumentException("No constant with value " + value + " found in " + /*<name>*/SecMatchLimit/*</name>*/.class.getName()); }
@Override public String toString() { try (CFString s = getDescription()) { return s.toString(); } }
@AfterBridgeCall public static void afterJavaToNative(String before, long after, long flags) { if (after != 0) { // after is the handle of the CFString returned by toNative(). // We've already disposed the Java peer so we have to release the // ObjC CFString now. release(after); } } }
static CFType toObject(Class<? extends CFType> cls, long handle, long flags, boolean retain) { if (handle == 0) { return null; } long typeId = getTypeID(handle); Class<? extends CFType> cfTypeClass = allCFTypeClasses.get(typeId); if (cfTypeClass != null && cfTypeClass != cls) { if (cls.isAssignableFrom(cfTypeClass)) { /* * Only use cfTypeClass if it's a subclass of the expected * type (cls). */ cls = cfTypeClass; } } CFType o = (CFType) NativeObject.Marshaler.toObject(cls, handle, flags); if (retain) { retain(handle); } return o; } @MarshalsPointer
public static /*<name>*/SecClass/*</name>*/ valueOf(/*<type>*/CFType/*</type>*/ value) { for (/*<name>*/SecClass/*</name>*/ v : values) { if (v.value().equals(value)) { return v; } } throw new IllegalArgumentException("No constant with value " + value + " found in " + /*<name>*/SecClass/*</name>*/.class.getName()); }
public <T extends NativeObject> T getValue(ABProperty property, Class<T> type) { CFType val = getValue(property); if (val != null) return val.as(type); return null; } /*<methods>*/