Package ns.foundation.NSKeyValueCoding._KeyBindingCreation._KeyBindingFactory

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


  }

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

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "integerMethod");
    assertEquals(Integer.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.integerField = FORTY_TWO;
    assertEquals(FORTY_TWO, kb.valueInObject(obj));
   
    kb = DefaultImplementation._keyGetBindingForKey(obj, "intMethod");
    assertEquals(Integer.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.intField = FORTY_TWO;
    assertEquals(FORTY_TWO, kb.valueInObject(obj));

  }
View Full Code Here


  }

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

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "longObjectMethod");
    assertEquals(Long.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.longObjectField = FORTY_TWO_LONG;
    assertEquals(FORTY_TWO_LONG, kb.valueInObject(obj));
   
    kb = DefaultImplementation._keyGetBindingForKey(obj, "longMethod");
    assertEquals(Long.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.longField = FORTY_TWO_LONG;
    assertEquals(FORTY_TWO_LONG, kb.valueInObject(obj));
  }
View Full Code Here

  }

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

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "floatObjectMethod");
    assertEquals(Float.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.floatObjectField = FORTY_TWO_FLOAT;
    assertEquals(FORTY_TWO_FLOAT, kb.valueInObject(obj));
   
    kb = DefaultImplementation._keyGetBindingForKey(obj, "floatMethod");
    assertEquals(Float.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.floatField = FORTY_TWO_FLOAT;
    assertEquals(FORTY_TWO_FLOAT, kb.valueInObject(obj));
  }
View Full Code Here

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

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "doubleObjectMethod");
    assertEquals(Double.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.doubleObjectField = FORTY_TWO_DOUBLE;
    assertEquals(FORTY_TWO_DOUBLE, kb.valueInObject(obj));
   
    kb = DefaultImplementation._keyGetBindingForKey(obj, "doubleMethod");
    assertEquals(Double.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.doubleField = FORTY_TWO_DOUBLE;
    assertEquals(FORTY_TWO_DOUBLE, kb.valueInObject(obj));
  }
View Full Code Here

  }

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

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "booleanObjectMethod");
    assertEquals(Boolean.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.booleanObjectField = Boolean.TRUE;
    assertEquals(Boolean.TRUE, kb.valueInObject(obj));
   
    kb = DefaultImplementation._keyGetBindingForKey(obj, "booleanMethod");
    assertEquals(Boolean.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.booleanField = Boolean.TRUE;
    assertEquals(Boolean.TRUE, kb.valueInObject(obj));
  }
View Full Code Here

    _KeyBindingCreation obj = new _KeyBindingCreation() {
      private Object _value;
     
      @Override
      public _KeyBinding _keySetBindingForKey(String s) {
        return new _KeyBinding(Object.class, "knownKey") {
          @Override
          public void setValueInObject(Object value, Object object) {
            _value = value;
          }
        };
      }
     
      @Override
      public _KeyBinding _keyGetBindingForKey(String s) {
        return new _KeyBinding(Object.class, "knownKey") {
          @Override
          public Object valueInObject(Object object) {
            return _value;
          }
        };
View Full Code Here

      public Object methodValue() { return _value; }
      public Object fieldValue() { return field; }
     
      @Override
      public _KeyBinding _otherStorageBinding(String s) {
        return new _KeyBinding(Object.class, "otherStorage") {
          @Override
          public Object valueInObject(Object object) {
            return "otherStorage";
          }
        };
      }
     
      @Override
      public _KeyBinding _methodKeySetBinding(String s, String s1) {
        return new _KeyBinding(Object.class, "setMethod") {
          @Override
          public void setValueInObject(Object value, Object object) {
            _value = value;
          }
        };
      }
     
      @Override
      public _KeyBinding _methodKeyGetBinding(String s, String s1) {
        return new _KeyBinding(Object.class, "method") {
          @Override
          public Object valueInObject(Object object) {
            return _value;
          }
        };
      }
     
      @Override
      public _KeyBinding _fieldKeyBinding(String s, String s1) {
        return new _KeyBinding(Object.class, "field") {
          @Override
          public void setValueInObject(Object value, Object object) {
            _value = value;
          }
         
View Full Code Here

   */

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

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

  }

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

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

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

    _KeyBinding kb = DefaultImplementation._keyGetBindingForKey(obj, "byteObjectField");
    assertEquals(Byte.class, kb.valueType());
    assertFalse(kb.isScalarProperty());
    obj.byteObjectField = FORTY_TWO_BYTE;
    assertEquals(FORTY_TWO_BYTE, kb.valueInObject(obj));
   
    kb = DefaultImplementation._keyGetBindingForKey(obj, "byteField");
    assertEquals(Byte.TYPE, kb.valueType());
    assertTrue(kb.isScalarProperty());
    obj.byteField = FORTY_TWO_BYTE;
    assertEquals(FORTY_TWO_BYTE, 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.