er.extensions.foundation
Class ERXKeyValueCodingUtilities
java.lang.Object
er.extensions.foundation.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. 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 -
staticStringsForClass
public static NSArray<ERXKeyValuePair> staticStringsForClass(Class c)
- Returns final strings constants from an interface or class. Useful in particular when you want to create
selection lists from your interfaces automatically.
- Parameters:
c -
privateValueForKey
public static Object privateValueForKey(Object target,
String key)
takePrivateValueForKey
public static void takePrivateValueForKey(Object target,
Object value,
String key)
fieldForKey
public static Field fieldForKey(Object target,
String key)
Copyright © 2002 – 2007 Project Wonder.