use of org.whole.lang.model.EnumValue in project whole by wholeplatform.
the class TestsDataTypePresentationParser method parseEnumValue.
public EnumValue parseEnumValue(EntityDescriptor<?> ed, String value) {
if (TestsEntityDescriptorEnum.CommentKind_ord == ed.getOrdinal()) {
EnumType<?> dataEnumType = ed.getDataEnumType();
if (dataEnumType == null)
throw new WholeIllegalArgumentException(WholeMessages.no_data_type);
EnumValue result = dataEnumType.valueOf(value);
if (result == null)
throw new WholeIllegalArgumentException(WholeMessages.no_data_type);
return result;
} else
return super.parseEnumValue(ed, value);
}
use of org.whole.lang.model.EnumValue in project whole by wholeplatform.
the class JavaBeanBindingManagerTest method testBindData.
@Test
public void testBindData() {
bm.wDefValue("boolF", false);
assertTrue(bm.wBooleanValue("boolF") == false);
bm.wDefValue("byteF", (byte) 4);
assertTrue(bm.wByteValue("byteF") == 4);
bm.wDefValue("charF", 'c');
assertTrue(bm.wCharValue("charF") == 'c');
bm.wDefValue("doubleF", 3.5d);
assertTrue(bm.wDoubleValue("doubleF") == 3.5d);
bm.wDefValue("floatF", 1.25f);
assertTrue(bm.wFloatValue("floatF") == 1.25f);
bm.wDefValue("intF", 12);
assertTrue(bm.wIntValue("intF") == 12);
bm.wDefValue("longF", 324l);
assertTrue(bm.wLongValue("longF") == 324l);
bm.wDefValue("shortF", (short) 34);
assertTrue(bm.wShortValue("shortF") == 34);
bm.wDefValue("stringF", "abc");
assertEquals("abc", bm.wStringValue("stringF"));
Date d = new Date();
bm.wDefValue("dateF", d);
assertSame(d, bm.wDateValue("dateF"));
EnumValue e = FeatureModifierEnum.optional;
bm.wDefValue("enumF", e);
assertEquals(e, bm.wEnumValue("enumF"));
Object o = new Object();
bm.wDefValue("objectF", o);
assertSame(o, bm.wGetValue("objectF"));
}
Aggregations