Package ns.foundation

Examples of ns.foundation._KeyBindingCreation$_KeyBindingFactory$_BindingStorage


    Utility.takeValueForKey(obj, FORTY_TWO, "anyKey");
    assertEquals(FORTY_TWO, obj.value());
  }
   
  public void testUtility$takeValueForKey$implementsKeyBindingCreation() {
    _KeyBindingCreation obj = new _KeyBindingCreation() {
      private Object _value;
     
      @Override
      public _KeyBinding _keySetBindingForKey(String s) {
        return new _KeyBinding(Object.class, "knownKey") {
View Full Code Here


    Utility.takeValueForKey(obj, FORTY_TWO, "knownKey");
    assertEquals(FORTY_TWO, Utility.valueForKey(obj, "knownKey"));
  }
 
  public void testUtility$takeValueForKey$implementsCallBack() {
    Callback obj = new Callback() {
      private Object _value;
     
      public Object field;
      public Object method() { return null; }
      public void setMethod(Object obj) { }
View Full Code Here

    boolean canAccessFieldsDirectlyTestPerformed = false;
    boolean canAccessFieldsDirectly = false;

    // we use a KeyBinding as key for the _BindingStorage object map table since it gives us exactly what we need: a class and a key - but we have to create a new lookup key binding to avoid synchronizing the read lookup (and we need a new instance for the write access)
    NSKeyValueCoding._KeyBinding lookupBinding = new NSKeyValueCoding._KeyBinding(objectClass, key);
    _BindingStorage bindingStorage = _bindingStorageMapTable.get(lookupBinding);
    if (bindingStorage == null) {
      bindingStorage = new _KeyBindingFactory._BindingStorage();
      _bindingStorageMapTable.put(lookupBinding, bindingStorage);
    }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public T invoke(Object target, Object... parameters) throws IllegalArgumentException, NoSuchMethodException, InvocationTargetException,
      IllegalAccessException {
    _NSMethod method = methodOnObject(target);
    return (T) method.invoke(target, parameters != null ? parameters : new Object[0]);
  }
View Full Code Here

      _classToMethodMapTable.takeValueForKey(value, className);

    }

    _NSMethod method = null;
    if (value != NSKeyValueCoding.NullValue) {
      method = (_NSMethod) value;
    }

    _cachedClass = targetClass;
View Full Code Here

  private _NSMethod methodOnObject(Object targetObject) throws NoSuchMethodException {
    if (targetObject == null)
      throw new IllegalArgumentException("Target object cannot be null");

    _NSMethod method = _methodOnObject(targetObject);
    Class<?> targetClass = targetObject.getClass();
    if (method == null)
      throw new NoSuchMethodException("Class " + targetClass.getName() + " does not implement method " + _NSReflectionUtilities._methodSignature(_name, _types));

    return method;
View Full Code Here

      if (method == null)
        return null;
     
      final java.lang.reflect.Method _method = method;
      return new _NSMethod() {

        @Override
        public Object invoke(Object obj, Object[] args) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
          return _method.invoke(obj, args);
        }
View Full Code Here

TOP

Related Classes of ns.foundation._KeyBindingCreation$_KeyBindingFactory$_BindingStorage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.