public class ERXKeyValueCodingUtilities extends Object
ERXKeyValueCodingUtilities.registerClass(SomeClass.class);
NSKeyValueCodingAdditions statics = ERXKeyValueCodingUtilities.Statics;
myValue = statics.valueForKeyPath("SomeClass.SOME_FIELD");
Also has utilities for getting and private fields and methods on an object.Modifier and Type | Field and Description |
---|---|
static com.webobjects.foundation.NSKeyValueCodingAdditions |
Statics |
Constructor and Description |
---|
ERXKeyValueCodingUtilities() |
Modifier and Type | Method and Description |
---|---|
static Object |
classValueForKey(Class clazz,
String key)
Extends key-value coding to a class.
|
static Field |
fieldForKey(Object target,
String key) |
static Method |
methodForKey(Object target,
String key) |
static Object |
privateValueForKey(Object target,
String key) |
static void |
registerClass(Class clazz)
Registers the class in the KVC resolving system, so you can use
valueForKeyPath("MyClass.SOME_KEY") . |
static NSArray<ERXKeyValuePair> |
staticStringsForClass(Class c)
Returns final strings constants from an interface or class.
|
static void |
takeChangedValuesFromDictionary(Object object,
NSDictionary<String,?> dictionary)
* Works like takeValuesFromDictionary, except that it only calls takeValueForKey if the current value
* is different than the new value.
|
static void |
takePrivateValueForKey(Object target,
Object value,
String key) |
public static final com.webobjects.foundation.NSKeyValueCodingAdditions Statics
public static void registerClass(Class clazz)
valueForKeyPath("MyClass.SOME_KEY")
. Inner classes
are registered with a "$", i.e. MyClass$InnerClass
clazz
- public static Object classValueForKey(Class clazz, String key)
clazz
- key
- public static NSArray<ERXKeyValuePair> staticStringsForClass(Class c)
c
- public static void takePrivateValueForKey(Object target, Object value, String key)
public static void takeChangedValuesFromDictionary(Object object, NSDictionary<String,?> dictionary)
object
- the object on which to operatedictionary
- the key-value pairs to set
Copyright © 2002 – 2020 Project Wonder.