sclass ToJava { O get(O o) { try object getOpt(o); fail("Can't ToJava: " + className(o)); } O getOpt(O o) { if (o == null) ret "null"; if (o instanceof String) ret quote(o); if (o instanceof Number) ret str(o); //if (o instanceof Int) ret str(o); if (o cast IFieldsToList) ret formatFunctionCall("new " + shortName(o), map get(o._fieldsToList())); if (o cast L) ret functionCall_list ll(map get(o)); if (o cast Class) ret shortClassName(o) + ".class"; if (o cast int[]) ret "new int[] {" + joinWithComma(toList(o)) + "}"; null; } }