importedNames.put("augmentFieldReturnType", importedName(augmentField.getReturnType()));
}
}
+ } else if (Instantiable.class.getName().equals(implementedIfc.getFullyQualifiedName())) {
+ importedNames.put("class", importedName(Class.class));
}
}
}
childTreeNode = true;
}
+ boolean instantiable = false;
+ if (getType().getImplements().contains(BindingTypes.INSTANTIABLE)) {
+ instantiable = true;
+ }
+
importedNames.put("augmentation", importedName(Augmentation.class));
importedNames.put("classInstMap", importedName(ClassToInstanceMap.class));
List<String> getterMethods = new ArrayList<>(Collections2.transform(properties, this::getterMethod));
return builderTemplate.render(getType(), properties, importedNames, importedNamesForProperties, augmentField,
- copyConstructorHelper, getterMethods, parentTypeForBuilderName, childTreeNode)
+ copyConstructorHelper, getterMethods, parentTypeForBuilderName, childTreeNode, instantiable)
.body();
}
@(genType: GeneratedType, properties: Set[GeneratedProperty], importedNames: Map[String, String],
ImportedNamesWithProperties: Map[GeneratedProperty, String], augmentField: GeneratedProperty, copyConstructorHelper: String,
-getterMethods: List[String], parentTypeForBuilderName: String, childTreeNode: Boolean)
+getterMethods: List[String], parentTypeForBuilderName: String, childTreeNode: Boolean, instantiable: Boolean)
@if(genType != null) {
@{wrapToDocumentation(formatDataForJavaDocBuilder(importedNames.get("genType")))}
public class @{genType.getName}Builder implements @{getSimpleNameForBuilder} <@{importedNames.get("genType")}> {
}
private static final class @{genType.getName}Impl implements @{genType.getName} {
- @if(parentTypeForBuilderName != null) {
+ @if(instantiable) {
@implementedInterfaceGetter()
}
+
@generateFields(true)
@generateAugmentField(true)