Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSKeyValueCoding


        Class valueClass = _NSUtilities.classObjectForClass(field.getType());
        if (_NSUtilities._isClassANumber(valueClass)) {
          return new _NumberFieldBinding(objectClass, key, field, valueClass, valueAccessor);
        }
        if (_NSUtilities._isClassABoolean(valueClass)) {
          return new _BooleanFieldBinding(objectClass, key, field, valueAccessor);
        }
        return new _FieldBinding(objectClass, key, field, valueAccessor);
      }
      return null;
    }
View Full Code Here


        Class valueClass = _NSUtilities.classObjectForClass(method.getReturnType());
        if (_NSUtilities._isClassANumber(valueClass)) {
          return new _NumberMethodBinding(objectClass, key, method, valueClass, valueAccessor);
        }
        if (_NSUtilities._isClassABoolean(valueClass)) {
          return new _BooleanMethodBinding(objectClass, key, method, valueAccessor);
        }
        return new _MethodBinding(objectClass, key, method, valueAccessor);
      }
      return null;
    }
View Full Code Here

        Class valueClass = _NSUtilities.classObjectForClass(method.getParameterTypes()[0]);
        if (_NSUtilities._isClassANumber(valueClass)) {
          return new _NumberMethodBinding(objectClass, key, method, valueClass, valueAccessor);
        }
        if (_NSUtilities._isClassABoolean(valueClass)) {
          return new _BooleanMethodBinding(objectClass, key, method, valueAccessor);
        }
        return new _MethodBinding(objectClass, key, method, valueAccessor);
      }
      return null;
    }
View Full Code Here

          return new _NumberFieldBinding(objectClass, key, field, valueClass, valueAccessor);
        }
        if (_NSUtilities._isClassABoolean(valueClass)) {
          return new _BooleanFieldBinding(objectClass, key, field, valueAccessor);
        }
        return new _FieldBinding(objectClass, key, field, valueAccessor);
      }
      return null;
    }
View Full Code Here

      if (key == null || key.length() == 0) {
        return null;
      }
      boolean canAccessFieldsDirectlyTestPerformed = false;
      boolean canAccessFieldsDirectly = false;
      _KeyBinding lookupBinding = new _KeyBinding(objectClass, key);
      _BindingStorage bindingStorage = (_BindingStorage) _bindingStorageMapTable.objectForKey(lookupBinding);
      if (bindingStorage == null) {
        bindingStorage = new _BindingStorage();
        _bindingStorageMapTable.setObjectForKey(bindingStorage, lookupBinding);
      }
      // MS: We just can't support callbacks without the original object
      // ... I think this is PROBABLY OK for our purposes.
      Callback keyBindingCreationCallbackObject = null;
      // (object instanceof Callback) ? (Callback) object : null;
      _KeyBinding keyBindings[] = trueForSetAndFalseForGet ? bindingStorage._keySetBindings : bindingStorage._keyGetBindings;
      for (int i = 0; i < lookupOrder.length; i++) {
        int lookup = lookupOrder[i];
        _KeyBinding keyBinding = lookup < 0 || lookup > 3 ? null : keyBindings[lookup];
        if (keyBinding == null) {
          switch (lookup) {
          case 0:

            StringBuilder methodNameBuffer = new StringBuilder(key.length() + 3);
View Full Code Here

      _keyGetBindings.removeAllObjects();
      _keySetBindings.removeAllObjects();
    }

    public static _KeyBinding _keyGetBindingForKey(Class objectClass, String key) {
      _KeyBinding keyBinding = (_KeyBinding) _keyGetBindings.member(new _KeyBinding(objectClass, key));
      if (keyBinding == null) {
        //keyBinding = (object instanceof _KeyBindingCreation) ? ((_KeyBindingCreation) object)._createKeyGetBindingForKey(key) : _createKeyGetBindingForKey(objectClass, key);
        keyBinding = _createKeyGetBindingForKey(objectClass, key);
        if (keyBinding == null) {
          keyBinding = new _KeyBinding(objectClass, key);
        }
        _keyGetBindings.addObject(keyBinding);
      }
      return keyBinding;
    }
View Full Code Here

      }
      return keyBinding;
    }

    public static _KeyBinding _keySetBindingForKey(Class objectClass, String key) {
      _KeyBinding keyBinding = (_KeyBinding) _keySetBindings.member(new _KeyBinding(objectClass, key));
      if (keyBinding == null) {
        //keyBinding = (object instanceof _KeyBindingCreation) ? ((_KeyBindingCreation) object)._createKeySetBindingForKey(key) : _createKeySetBindingForKey(objectClass, key);
        keyBinding = _createKeySetBindingForKey(objectClass, key);
        if (keyBinding == null) {
          keyBinding = new _KeyBinding(objectClass, key);
        }
        _keySetBindings.addObject(keyBinding);
      }
      return keyBinding;
    }
View Full Code Here

      }
      return keyBinding;
    }

    public static _KeyBinding _createKeyGetBindingForKey(Class objectClass, String key) {
      _KeyBinding keyBinding = _ReflectionKeyBindingCreation._createKeyGetBindingForKey(objectClass, key, _ReflectionKeyBindingCreation._ValueForKeyLookupOrder);
      return keyBinding;
    }
View Full Code Here

      int index = keyPath.indexOf('.');
      if (index < 0) {
        return WOHelperFunctionClassKeyValueCoding.DefaultImplementation._keyGetBindingForKey(objectClass, keyPath);
      }
      String key = keyPath.substring(0, index);
      _KeyBinding keyBinding = WOHelperFunctionClassKeyValueCoding.DefaultImplementation._keyGetBindingForKey(objectClass, key);
      return keyBinding != null ? WOHelperFunctionClassKeyValueCoding.DefaultImplementation.keyGetBindingForKeyPath(keyBinding.valueType(), keyPath.substring(index + 1)) : null;
    }
View Full Code Here

    Class helpedClass;
    if (helpedObject != null) {
      helpedClass = helpedObject.getClass();
    }
    else {
      _KeyBinding keyBinding = WOHelperFunctionClassKeyValueCoding.DefaultImplementation.keyGetBindingForKeyPath(targetObject.getClass(), keyPath);
      if (keyBinding != null) {
        helpedClass = keyBinding.valueType();
      }
      else {
        WOHelperFunctionRegistry.log.warn("Unable to determine the value class of the keypath '" + keyPath + "' for the object " + targetObject);
        helpedClass = Object.class;
      }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSKeyValueCoding

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.