protected void startMethodBody(PrintWriter out) { newBlock(out); }
protected void generateCurrentBackEndIdClass(String className, PrintWriter out) { println(out, "@SuppressWarnings(\"all\")"); printWords(out, "public", "class", className, "extends", ABSTRACT_BACKEND_ID_CLASS); newBlock(out); generateBackEndIdClassBody(out); closeBlock(out); }
protected void generatePublicClass(DomainClass domClass, PrintWriter out) { String leafClassName = domClass.getName(); // This should be the other way around, but that would cause API disruption String modifier = domClass.hasModifier(Modifier.PROTECTED) ? "" : "public"; printWords(out, modifier, "class", leafClassName, "extends", domClass.getBaseName()); newBlock(out); generatePublicClassConstructors(leafClassName, out); closeBlock(out); }
protected void generateBaseClass(DomainClass domClass, PrintWriter out) { newline(out); println(out, "@SuppressWarnings(\"all\")"); // This should be the other way around, but that would cause API disruption String modifier = domClass.hasModifier(Modifier.PROTECTED) ? "" : "public"; printWords(out, modifier, "abstract", "class", domClass.getBaseName(), "extends"); String superclassName = getEntityFullName(domClass.getSuperclass()); printWords(out, (superclassName == null) ? getDomainClassRoot() : superclassName); final List interfacesNames = domClass.getInterfacesNames(); if (interfacesNames != null && !interfacesNames.isEmpty()) { printWords(out, "implements"); for (final Object ifsn : interfacesNames) { printWords(out, ifsn.toString()); } } newBlock(out); generateBaseClassBody(domClass, out); closeBlock(out); }
protected void generateStaticRoleSlots(Role role, PrintWriter out) { onNewline(out); Role otherRole = role.getOtherRole(); // The Role slot String roleType = getRoleType(role); printWords(out, "public", "final", "static", roleType, getRoleHandlerName(role, false), "=", "new", roleType); print(out, "("); print(out, getRoleArgs(role)); print(out, ")"); newBlock(out); boolean multOne = (role.getMultiplicityUpper() == 1); if (multOne) { generateStaticRoleSlotsMultOne(role, otherRole, out); } else { generateStaticRoleSlotsMultStar(role, otherRole, out); } generateRoleMethodGetInverseRole(role, otherRole, out); closeBlock(out, false); println(out, ";"); }
startMethodBody(out); print(out, "try"); newBlock(out); printWords(out, "return", "(Class<? extends pt.ist.fenixframework.Config>)Class.forName(\"" + getDefaultConfigClassName() + "\");"); closeBlock(out); printWords(out, "catch", "(Exception e)"); newBlock(out); print(out, "throw new RuntimeException(e);"); closeBlock(out);
print(out, "private final static class "); print(out, relationSlotName); newBlock(out); print(out, "private static final "); print(out, directRelationType);