Package ns.foundation.NSKeyValueCoding._KeyBindingCreation._KeyBindingFactory

Examples of ns.foundation.NSKeyValueCoding._KeyBindingCreation._KeyBindingFactory.Callback


        _KeyBindingFactory.FieldLookup,
        _KeyBindingFactory.MethodLookup,
        _KeyBindingFactory.UnderbarMethodLookup,
        _KeyBindingFactory.UnderbarFieldLookup,
        _KeyBindingFactory.OtherStorageLookup };
    _KeyBinding binding = NSKeyValueCoding.DefaultImplementation._createKeyGetBindingForKey(obj, "knownKey", lookupOrder);
    assertEquals(4, binding.valueInObject(obj));
  }
View Full Code Here


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

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

    kb.setValueInObject(FORTY_TWO_FLOAT, obj);
    assertEquals(FORTY_TWO_FLOAT, obj.floatObjectField);
   
    kb = DefaultImplementation._keySetBindingForKey(obj, "floatField");
    assertEquals(Float.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_FLOAT, obj);
    assertEquals(FORTY_TWO_FLOAT.floatValue(), obj.floatField);
  }
View Full Code Here

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

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

    kb.setValueInObject(FORTY_TWO_DOUBLE, obj);
    assertEquals(FORTY_TWO_DOUBLE, obj.doubleObjectField);
   
    kb = DefaultImplementation._keySetBindingForKey(obj, "doubleField");
    assertEquals(Double.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(FORTY_TWO_DOUBLE, obj);
    assertEquals(FORTY_TWO_DOUBLE.doubleValue(), obj.doubleField);
  }
View Full Code Here

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

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

    kb.setValueInObject(true, obj);
    assertTrue(obj.booleanObjectField);
   
    kb = DefaultImplementation._keySetBindingForKey(obj, "booleanField");
    assertEquals(Boolean.class, kb.valueType());
    assertTrue(kb.isScalarProperty());

    kb.setValueInObject(true, obj);
    assertTrue(obj.booleanField);
  }
View Full Code Here

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

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

    kb.setValueInObject(FORTY_TWO_STRING, obj);
    assertEquals(FORTY_TWO_STRING, obj.stringField);
  }
View Full Code Here

   */
 
  public void testDefaultImplementation$_keyGetBindingForKey$knownMethod() {   
    KeyBindingTypeTest obj = new KeyBindingTypeTest();

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "knownMethod");
    assertEquals(obj.getClass(), kb.targetClass());
    assertEquals("knownMethod", kb.key());
    assertEquals(Integer.class, kb.valueType());
  }
View Full Code Here

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

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "unknownMethod");
    assertEquals(obj.getClass(), kb.targetClass());
    assertEquals("unknownMethod", kb.key());
    assertEquals(Object.class, kb.valueType());
  }
View Full Code Here

  }

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

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "byteObjectMethod");
    assertEquals(Byte.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.byteObjectField = FORTY_TWO_BYTE;
    assertEquals(FORTY_TWO_BYTE, kb.valueInObject(obj));
   
    kb = DefaultImplementation._keyGetBindingForKey(obj, "byteMethod");
    assertEquals(Byte.TYPE, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.byteField = FORTY_TWO_BYTE;
    assertEquals(FORTY_TWO_BYTE, kb.valueInObject(obj));
  }
View Full Code Here

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

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "charObjectMethod");
    assertEquals(Character.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.charObjectField = FORTY_TWO_CHAR;
    assertEquals(FORTY_TWO_CHAR, kb.valueInObject(obj));
   
    kb = DefaultImplementation._keyGetBindingForKey(obj, "charMethod");
    assertEquals(Character.TYPE, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.charField = FORTY_TWO_CHAR;
    assertEquals(FORTY_TWO_CHAR, kb.valueInObject(obj));
  }
View Full Code Here

  }

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

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "shortObjectMethod");
    assertEquals(Short.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.shortObjectField = FORTY_TWO_SHORT;
    assertEquals(FORTY_TWO_SHORT, kb.valueInObject(obj));
   
    kb = DefaultImplementation._keyGetBindingForKey(obj, "shortMethod");
    assertEquals(Short.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.shortField = FORTY_TWO_SHORT;
    assertEquals(FORTY_TWO_SHORT, kb.valueInObject(obj));
  }
View Full Code Here

TOP

Related Classes of ns.foundation.NSKeyValueCoding._KeyBindingCreation._KeyBindingFactory.Callback

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.