else {
val = fieldDemarshall(memberMapping, MetaClassFactory.get(EJObject.class));
}
if (memberMapping.getBindingMember() instanceof MetaField) {
final MetaField field = (MetaField) memberMapping.getBindingMember();
// handle long case -- GWT does not support long in JSNI
if (field.isPublic()) {
builder.append(loadVariable("entity").loadField(field.getName()).assignValue(val));
continue;
}
else {
final MetaMethod setterMeth = GenUtil.findCaseInsensitiveMatch(null,
field.getDeclaringClass(), "set" + field.getName(),
field.getType());
if (setterMeth != null && !setterMeth.isPrivate()) {
// Bind via setter
bindingStatement =
loadVariable("entity").invoke(setterMeth, Cast.to(memberMapping.getTargetType(), val));
}
else if (field.getType().getCanonicalName().equals("long")) {
throw new RuntimeException("cannot support private field marshalling of long type" +
" (not supported by JSNI) for field: "
+ field.getDeclaringClass().getFullyQualifiedName() + "#" + field.getName());
}
else {
if (!context.isExposed(field)) {
PrivateAccessUtil.addPrivateAccessStubs(gwtTarget ? "jsni" : "reflection", context.getClassStructureBuilder(), field);
context.markExposed(field);