Package com.webobjects.foundation.NSKeyValueCoding

Examples of com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding


          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 _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

      boolean publicFieldOnly = valueAccessor == null;
      Field field = _NSReflectionUtilities._fieldForClass(objectClass, fieldName, publicFieldOnly);
      if (field != null) {
        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);
View Full Code Here

      boolean publicMethodOnly = valueAccessor == null;
      Method method = WOHelperFunctionClassKeyValueCoding._ReflectionKeyBindingCreation._methodForClass(objectClass, methodName, null, publicMethodOnly);
      if (method != null) {
        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);
View Full Code Here

      boolean publicMethodOnly = valueAccessor == null;
      Method method = _NSReflectionUtilities._methodWithOneArgumentOfUnknownType(objectClass, methodName, key, publicMethodOnly, true, null, true);
      if (method != null) {
        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);
View Full Code Here

        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);

            methodNameBuffer.append(trueForSetAndFalseForGet ? "set" : "get");

            methodNameBuffer.append(Character.toUpperCase(key.charAt(0)));

            methodNameBuffer.append(key.substring(1));

            String methodName = methodNameBuffer.toString();

            if (trueForSetAndFalseForGet) {
              keyBinding = keyBindingCreationCallbackObject == null ? _methodKeySetBinding(objectClass, key, methodName) : keyBindingCreationCallbackObject._methodKeySetBinding(key, methodName);
            }
            else {
              keyBinding = keyBindingCreationCallbackObject == null ? _methodKeyGetBinding(objectClass, key, methodName) : keyBindingCreationCallbackObject._methodKeyGetBinding(key, methodName);
              if (keyBinding == null) {
                keyBinding = keyBindingCreationCallbackObject == null ? _methodKeyGetBinding(objectClass, key, key) : keyBindingCreationCallbackObject._methodKeyGetBinding(key, key);
              }
              if (keyBinding == null) {
                methodNameBuffer.setLength(0);
                methodNameBuffer.append("is");
                methodNameBuffer.append(Character.toUpperCase(key.charAt(0)));
                methodNameBuffer.append(key.substring(1));
                methodName = methodNameBuffer.toString();
                keyBinding = keyBindingCreationCallbackObject == null ? _methodKeyGetBinding(objectClass, key, methodName) : keyBindingCreationCallbackObject._methodKeyGetBinding(key, methodName);
              }
            }
            break;
          case 1:

            StringBuilder underbarMethodNameBuffer = new StringBuilder(key.length() + 4);

            underbarMethodNameBuffer.append(trueForSetAndFalseForGet ? "_set" : "_get");

            underbarMethodNameBuffer.append(Character.toUpperCase(key.charAt(0)));

            underbarMethodNameBuffer.append(key.substring(1));

            String underbarMethodName = underbarMethodNameBuffer.toString();

            if (trueForSetAndFalseForGet) {
              keyBinding = keyBindingCreationCallbackObject == null ? _methodKeySetBinding(objectClass, key, underbarMethodName) : keyBindingCreationCallbackObject._methodKeySetBinding(key, underbarMethodName);
            }
            else {
              keyBinding = keyBindingCreationCallbackObject == null ? _methodKeyGetBinding(objectClass, key, underbarMethodName) : keyBindingCreationCallbackObject._methodKeyGetBinding(key, underbarMethodName);
              if (keyBinding == null) {
                underbarMethodNameBuffer.setLength(0);
                underbarMethodNameBuffer.append('_');
                underbarMethodNameBuffer.append(key);
                underbarMethodName = underbarMethodNameBuffer.toString();
                keyBinding = keyBindingCreationCallbackObject == null ? _methodKeyGetBinding(objectClass, key, underbarMethodName) : keyBindingCreationCallbackObject._methodKeyGetBinding(key, underbarMethodName);
              }
              if (keyBinding == null) {
                underbarMethodNameBuffer.setLength(0);
                underbarMethodNameBuffer.append("_is");
                underbarMethodNameBuffer.append(Character.toUpperCase(key.charAt(0)));
                underbarMethodNameBuffer.append(key.substring(1));
                underbarMethodName = underbarMethodNameBuffer.toString();
                keyBinding = keyBindingCreationCallbackObject == null ? _methodKeyGetBinding(objectClass, key, underbarMethodName) : keyBindingCreationCallbackObject._methodKeyGetBinding(key, underbarMethodName);
              }
            }
            break;
          case 2:

            if (!canAccessFieldsDirectlyTestPerformed) {
              canAccessFieldsDirectlyTestPerformed = true;
              canAccessFieldsDirectly = NSKeyValueCoding._ReflectionKeyBindingCreation._canAccessFieldsDirectlyForClass(objectClass);
            }

            if (canAccessFieldsDirectly) {
              keyBinding = keyBindingCreationCallbackObject == null ? _fieldKeyBinding(objectClass, key, key) : keyBindingCreationCallbackObject._fieldKeyBinding(key, key);
              if (keyBinding == null) {
                StringBuilder fieldNameBuffer = new StringBuilder(key.length() + 2);
                fieldNameBuffer.append("is");
                fieldNameBuffer.append(Character.toUpperCase(key.charAt(0)));
                fieldNameBuffer.append(key.substring(1));
                String fieldName = fieldNameBuffer.toString();
                keyBinding = keyBindingCreationCallbackObject == null ? _fieldKeyBinding(objectClass, key, fieldName) : keyBindingCreationCallbackObject._fieldKeyBinding(key, fieldName);
              }
            }
            break;
          case 3:

            if (!canAccessFieldsDirectlyTestPerformed) {
              canAccessFieldsDirectlyTestPerformed = true;
              canAccessFieldsDirectly = NSKeyValueCoding._ReflectionKeyBindingCreation._canAccessFieldsDirectlyForClass(objectClass);
            }

            if (canAccessFieldsDirectly) {
              StringBuilder underbarFieldNameBuffer = new StringBuilder(key.length() + 3);
              underbarFieldNameBuffer.append('_');
              underbarFieldNameBuffer.append(key);
              String underbarFieldName = underbarFieldNameBuffer.toString();
              keyBinding = keyBindingCreationCallbackObject == null ? _fieldKeyBinding(objectClass, key, underbarFieldName) : keyBindingCreationCallbackObject._fieldKeyBinding(key, underbarFieldName);
              if (keyBinding == null) {
                underbarFieldNameBuffer.setLength(0);
                underbarFieldNameBuffer.append("_is");
                underbarFieldNameBuffer.append(Character.toUpperCase(key.charAt(0)));
                underbarFieldNameBuffer.append(key.substring(1));
                underbarFieldName = underbarFieldNameBuffer.toString();
                keyBinding = keyBindingCreationCallbackObject == null ? _fieldKeyBinding(objectClass, key, underbarFieldName) : keyBindingCreationCallbackObject._fieldKeyBinding(key, underbarFieldName);
              }
            }
            break;
          case 4:

            keyBinding = keyBindingCreationCallbackObject == null ? null : keyBindingCreationCallbackObject._otherStorageBinding(key);
            break;
          }
          if (keyBinding == null) {
            keyBinding = _NotAvailableIndicator;
          }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding

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.