public JPackage getPackage() { return parentContainer().getPackage(); }
public JPackage getPackage() { return parentContainer().getPackage(); }
public JPackage getPackage() { return parentContainer().getPackage(); }
public JPackage getPackage() { return parentContainer().getPackage(); }
public JPackage getPackage() { return parentContainer().getPackage(); }
public String getTableName(ClassOutline classContext) { final JDefinedClass theClass = classContext.ref; if (theClass.parentContainer() instanceof JDefinedClass) { final JDefinedClass container = (JDefinedClass) theClass .parentContainer(); final ClassOutline containingClassOutline = getClassOutline( classContext.parent(), container.fullName()); if (containingClassOutline != null) { return getTableName(containingClassOutline) + "_" + classContext.target.shortName; } else { return classContext.target.shortName; } } else { return classContext.target.shortName; } }
if (clazz.parentContainer().isClass()) { JDefinedClass parentClass = (JDefinedClass) clazz.parentContainer(); JPackage parentPackage = (JPackage) clazz.parentContainer();
if (clazz.parentContainer().isClass()) { JDefinedClass parentClass = (JDefinedClass) clazz.parentContainer(); JPackage parentPackage = (JPackage) clazz.parentContainer();
assert c.parentContainer().isPackage() : "this method is only for a pacakge-level class"; JPackage pkg = (JPackage) c.parentContainer(); if (!pkg.isUnnamed()) { nl().d(pkg);
assert c.parentContainer().isPackage() : "this method is only for a pacakge-level class"; JPackage pkg = (JPackage) c.parentContainer(); if (!pkg.isUnnamed()) { nl().d(pkg);
assert c.parentContainer().isPackage() : "this method is only for a pacakge-level class"; JPackage pkg = (JPackage) c.parentContainer(); if (!pkg.isUnnamed()) { nl().d(pkg);
assert c.parentContainer().isPackage() : "this method is only for a pacakge-level class"; JPackage pkg = (JPackage) c.parentContainer(); if (!pkg.isUnnamed()) { nl().d(pkg);
assert c.parentContainer().isPackage() : "this method is only for a pacakge-level class"; JPackage pkg = (JPackage) c.parentContainer(); if (!pkg.isUnnamed()) { nl().d(pkg);
JDefinedClass parent = (JDefinedClass) clazz.parentContainer(); JClassContainer grandParent = parent.parentContainer(); Map<String, JDefinedClass> classes;
methodName.insert(0, container.name()); if (container.parentContainer().isClass()) { container = (JDefinedClass) container.parentContainer();
JDefinedClass parent = (JDefinedClass) clazz.parentContainer(); JClassContainer grandParent = parent.parentContainer(); Map<String, JDefinedClass> classes;
methodName.insert(0, container.name()); if (container.parentContainer().isClass()) { container = (JDefinedClass) container.parentContainer();
while (!(owningClass.parentContainer() instanceof JPackage)) { owningClass = (JDefinedClass) owningClass.parentContainer();
/** * If candidate class contains the inner class which is collection parametrisation (type), then this inner class has * to be moved to top class. For example from<br> * {@code TypeClass (is a collection type) -> ContainerClass (marked for removal) -> ElementClass}<br> * we need to get<br> * {@code TypeClass -> ElementClass}.<br> * Also this move should be reflected on factory method names. */ private boolean moveInnerClassToParent(Outline outline, Candidate candidate) { // Skip basic parametrisations like "List<String>": if (candidate.getFieldParametrisationClass() == null) { return false; } JDefinedClass fieldParametrisationImpl = candidate.getFieldParametrisationImpl(); if (candidate.getClazz() != fieldParametrisationImpl.parentContainer()) { // Field parametrisation class is not inner class of the candidate: return false; } JDefinedClass fieldParametrisationClass = candidate.getFieldParametrisationClass(); String oldFactoryMethodName = fieldParametrisationClass.outer().name() + fieldParametrisationClass.name(); moveClassLevelUp(outline, fieldParametrisationImpl); renameFactoryMethod(fieldParametrisationImpl._package()._getClass(FACTORY_CLASS_NAME), oldFactoryMethodName, fieldParametrisationClass.name()); if (candidate.isValueObjectDisabled()) { moveClassLevelUp(outline, fieldParametrisationClass); renameFactoryMethod(fieldParametrisationClass._package()._getClass(FACTORY_CLASS_NAME), oldFactoryMethodName, fieldParametrisationClass.name()); } return true; }
/** * If candidate class contains the inner class which is collection parametrisation (type), then this inner class has * to be moved to top class. For example from<br> * {@code TypeClass (is a collection type) -> ContainerClass (marked for removal) -> ElementClass}<br> * we need to get<br> * {@code TypeClass -> ElementClass}.<br> * Also this move should be reflected on factory method names. */ private boolean moveInnerClassToParent(Outline outline, Candidate candidate) { // Skip basic parametrisations like "List<String>": if (candidate.getFieldParametrisationClass() == null) { return false; } JDefinedClass fieldParametrisationImpl = candidate.getFieldParametrisationImpl(); if (candidate.getClazz() != fieldParametrisationImpl.parentContainer()) { // Field parametrisation class is not inner class of the candidate: return false; } JDefinedClass fieldParametrisationClass = candidate.getFieldParametrisationClass(); String oldFactoryMethodName = fieldParametrisationClass.outer().name() + fieldParametrisationClass.name(); moveClassLevelUp(outline, fieldParametrisationImpl); renameFactoryMethod(fieldParametrisationImpl._package()._getClass(FACTORY_CLASS_NAME), oldFactoryMethodName, fieldParametrisationClass.name()); if (candidate.isValueObjectDisabled()) { moveClassLevelUp(outline, fieldParametrisationClass); renameFactoryMethod(fieldParametrisationClass._package()._getClass(FACTORY_CLASS_NAME), oldFactoryMethodName, fieldParametrisationClass.name()); } return true; }