protected String getTypeFullName(DomainEntity domEntity) { return getEntityFullName(domEntity); }
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 generateRelationAddMethodCall(Role role, String otherArg, String indexParam, PrintWriter out) { print(out, getRelationMethodNameFor(role, true)); print(out, ".add("); if (role.isDirect()) { print(out, "("); print(out, getEntityFullName(role.getOtherRole().getType())); print(out, ")this, "); print(out, otherArg); } else { print(out, otherArg); print(out, ", ("); print(out, getEntityFullName(role.getOtherRole().getType())); print(out, ")this"); } print(out, ");"); }
protected void generateRelationRemoveMethodCall(Role role, String otherArg, PrintWriter out) { print(out, getRelationMethodNameFor(role, true)); print(out, ".remove("); if (role.isDirect()) { print(out, "("); print(out, getEntityFullName(role.getOtherRole().getType())); print(out, ")this, "); print(out, otherArg); } else { print(out, otherArg); print(out, ", ("); print(out, getEntityFullName(role.getOtherRole().getType())); print(out, ")this"); } print(out, ");"); }