Package com.webobjects.foundation.NSKeyValueCoding

Examples of com.webobjects.foundation.NSKeyValueCoding._KeyBinding.valueType()


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

    DefaultImplementation() {
      throw new IllegalStateException("Cannot instantiate an instance of class " + getClass().getName());
    }
View Full Code Here


      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

  public void testDefaultImplementation$_keyGetBindingForKey$stringMethod() {   
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "stringMethod");
    assertEquals(String.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.stringField = FORTY_TWO_STRING;
    assertEquals(FORTY_TWO_STRING, kb.valueInObject(obj));
  }
 
View Full Code Here

   */
  public void testDefaultImplementation$_keySetBindingForKey$byteMethod() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "byteObjectMethod");
    assertEquals(Byte.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_BYTE, obj);
    assertEquals(FORTY_TWO_BYTE, obj.byteObjectField);

View Full Code Here

    kb.setValueInObject(FORTY_TWO_BYTE, obj);
    assertEquals(FORTY_TWO_BYTE, obj.byteObjectField);

    kb = DefaultImplementation._keySetBindingForKey(obj, "byteMethod");
    assertEquals(Byte.TYPE, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_BYTE, obj);
    assertEquals(FORTY_TWO_BYTE.byteValue(), obj.byteField);
  }
View Full Code Here

  public void testDefaultImplementation$_keySetBindingForKey$charMethod() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "charObjectMethod");
    assertEquals(Character.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_CHAR, obj);
    assertEquals(FORTY_TWO_CHAR, obj.charObjectField);
View Full Code Here

    kb.setValueInObject(FORTY_TWO_CHAR, obj);
    assertEquals(FORTY_TWO_CHAR, obj.charObjectField);

    kb = DefaultImplementation._keySetBindingForKey(obj, "charMethod");
    assertEquals(Character.TYPE, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_CHAR, obj);
    assertEquals(FORTY_TWO_CHAR.charValue(), obj.charField);
View Full Code Here

  public void testDefaultImplementation$_keySetBindingForKey$shortMethod() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "shortObjectMethod");
    assertEquals(Short.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_SHORT, obj);
    assertEquals(FORTY_TWO_SHORT, obj.shortObjectField);
   
View Full Code Here

    kb.setValueInObject(FORTY_TWO_SHORT, obj);
    assertEquals(FORTY_TWO_SHORT, obj.shortObjectField);
   
    kb = DefaultImplementation._keySetBindingForKey(obj, "shortMethod");
    assertEquals(Short.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_SHORT, obj);
    assertEquals(FORTY_TWO_SHORT.shortValue(), obj.shortField);
View Full Code Here

  public void testDefaultImplementation$_keySetBindingForKey$integerMethod() {
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keySetBindingForKey(obj, "integerMethod");
    assertEquals(Integer.class, kb.valueType());
    assertFalse(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO, obj);
    assertEquals(FORTY_TWO, obj.integerField);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.