public static /*<name>*/NSAttributedStringAttribute/*</name>*/ valueOf(/*<type>*/NSString/*</type>*/ value) { for (/*<name>*/NSAttributedStringAttribute/*</name>*/ v : values) { if (v.value().equals(value)) { return v; } } throw new IllegalArgumentException("No constant with value " + value + " found in " + /*<name>*/NSAttributedStringAttribute/*</name>*/.class.getName()); }
@MarshalsPointer public static NSAttributedStringAttribute toObject(Class<NSAttributedStringAttribute> cls, long handle, long flags) { NSString o = (NSString) NSObject.Marshaler.toObject(NSString.class, handle, flags); if (o == null) { return null; } return NSAttributedStringAttribute.valueOf(o); } @MarshalsPointer
public boolean has(NSAttributedStringAttribute key) { return data.containsKey(key.value()); } public NSObject get(NSAttributedStringAttribute key) {
@SuppressWarnings("unchecked") @MarshalsPointer public static List<NSAttributedStringAttribute> toObject(Class<? extends NSObject> cls, long handle, long flags) { NSArray<NSString> o = (NSArray<NSString>) NSObject.Marshaler.toObject(NSArray.class, handle, flags); if (o == null) { return null; } List<NSAttributedStringAttribute> list = new ArrayList<>(); for (int i = 0; i < o.size(); i++) { list.add(NSAttributedStringAttribute.valueOf(o.get(i))); } return list; } @MarshalsPointer
public NSAttributedStringAttributes set(NSAttributedStringAttribute key, NSObject value) { data.put(key.value(), value); return this; }
@MarshalsPointer public static NSAttributedStringAttribute toObject(Class<NSAttributedStringAttribute> cls, long handle, long flags) { NSString o = (NSString) NSObject.Marshaler.toObject(NSString.class, handle, flags); if (o == null) { return null; } return NSAttributedStringAttribute.valueOf(o); } @MarshalsPointer
public void addAttribute(NSAttributedStringAttribute attribute, NSObject value, @ByVal NSRange range) { if (attribute == null) { throw new NullPointerException("attribute"); } addAttribute(attribute.value(), value, range); } public void addAttribute(CMTextMarkupAttribute attribute, NSObject value, @ByVal NSRange range) {
@MarshalsPointer public static NSAttributedStringAttribute toObject(Class<NSAttributedStringAttribute> cls, long handle, long flags) { NSString o = (NSString) NSObject.Marshaler.toObject(NSString.class, handle, flags); if (o == null) { return null; } return NSAttributedStringAttribute.valueOf(o); } @MarshalsPointer
public void removeAttribute(NSAttributedStringAttribute attribute, @ByVal NSRange range) { if (attribute == null) { throw new NullPointerException("attribute"); } removeAttribute(attribute.value(), range); } public void removeAttribute(CMTextMarkupAttribute attribute, @ByVal NSRange range) {
@SuppressWarnings("unchecked") @MarshalsPointer public static List<NSAttributedStringAttribute> toObject(Class<? extends NSObject> cls, long handle, long flags) { NSArray<NSString> o = (NSArray<NSString>) NSObject.Marshaler.toObject(NSArray.class, handle, flags); if (o == null) { return null; } List<NSAttributedStringAttribute> list = new ArrayList<>(); for (int i = 0; i < o.size(); i++) { list.add(NSAttributedStringAttribute.valueOf(o.get(i))); } return list; } @MarshalsPointer
public NSObject get(NSAttributedStringAttribute key) { if (has(key)) { return data.get(key.value()); } return null; } public NSAttributedStringAttributes set(NSAttributedStringAttribute key, NSObject value) {
@SuppressWarnings("unchecked") @MarshalsPointer public static List<NSAttributedStringAttribute> toObject(Class<? extends NSObject> cls, long handle, long flags) { NSArray<NSString> o = (NSArray<NSString>) NSObject.Marshaler.toObject(NSArray.class, handle, flags); if (o == null) { return null; } List<NSAttributedStringAttribute> list = new ArrayList<>(); for (int i = 0; i < o.size(); i++) { list.add(NSAttributedStringAttribute.valueOf(o.get(i))); } return list; } @MarshalsPointer
@MarshalsPointer public static long toNative(NSAttributedStringAttribute o, long flags) { if (o == null) { return 0L; } return NSObject.Marshaler.toNative(o.value(), flags); } }
@WeaklyLinked public CFType getAttribute(long loc, NSAttributedStringAttribute attrName, CFRange effectiveRange) { if (attrName == null) { throw new NullPointerException("attrName"); } return getAttribute(loc, attrName.value().as(CFString.class), effectiveRange); } @WeaklyLinked
@WeaklyLinked public NSObject getAttribute(NSAttributedStringAttribute attribute, @MachineSizedUInt long location, NSRange range) { if (attribute == null) { throw new NullPointerException("attribute"); } return getAttribute(attribute.value(), location, range); } @WeaklyLinked
/** * @since Available in iOS 4.0 and later. */ @WeaklyLinked public void enumerateAttribute(NSAttributedStringAttribute attribute, @ByVal NSRange enumerationRange, NSAttributedStringEnumerationOptions opts, final VoidBlock3<NSObject, NSRange, BooleanPtr> block) { if (attribute == null) { throw new NullPointerException("attribute"); } enumerateAttribute(attribute.value(), enumerationRange, opts, block); } /**
@WeaklyLinked public void setAttribute(@ByVal CFRange range, NSAttributedStringAttribute attribute, CFType value) { if (attribute == null) { throw new NullPointerException("attribute"); } setAttribute(range, attribute.value().as(CFString.class), value); } @WeaklyLinked
@WeaklyLinked public NSObject getAttribute(NSAttributedStringAttribute attribute, @MachineSizedUInt long location, NSRange range, @ByVal NSRange rangeLimit) { if (attribute == null) { throw new NullPointerException("attribute"); } return getAttribute(attribute.value(), location, range, rangeLimit); } @WeaklyLinked
@WeaklyLinked public void removeAttribute(@ByVal CFRange range, NSAttributedStringAttribute attribute) { if (attribute == null) { throw new NullPointerException("attribute"); } removeAttribute(range, attribute.value().as(CFString.class)); } @WeaklyLinked
@MarshalsPointer public static long toNative(List<NSAttributedStringAttribute> l, long flags) { if (l == null) { return 0L; } NSArray<NSString> array = new NSMutableArray<>(); for (NSAttributedStringAttribute o : l) { array.add(o.value()); } return NSObject.Marshaler.toNative(array, flags); } }