er.extensions
Class ERXKeyValueCodingUtilities
java.lang.Object
er.extensions.ERXKeyValueCodingUtilities
- public class ERXKeyValueCodingUtilities
- extends Object
Utilities for use with key value coding. You could instantiate one of these in your app-startup:
public NSKeyValueCodingUtilities statics = ERXKeyValueCodingUtilities.Statics;
ERXKeyValueCodingUtilities.registerClass(SomeClass.class);
myValue = valueForKeyPath("statics.SomeClass.SOME_FIELD");
- Author:
- ak
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Statics
public static final NSKeyValueCodingAdditions Statics
ERXKeyValueCodingUtilities
public ERXKeyValueCodingUtilities()
registerClass
public static void registerClass(Class clazz)
- Registers the class in the KVC resolving system, so you can use
valueForKeyPath("MyClass.SOME_KEY")
. Inner classes
are registered with a "$", i.e. MyClass$InnerClass
- Parameters:
clazz
-
classValueForKey
public static Object classValueForKey(Class clazz,
String key)
- Extends key-value coding to a class. You can currently only
get the static fields of the class, not method results.
Java arrays and collections are morphed into NSArrays. The implementation is pretty slow,
but I didn't exactly want to re-implement all of NSKeyValueCoding here.
- Parameters:
clazz
- key
-
- Returns:
Copyright © 2002 – 2004 Project Wonder.