/** The access modifier is that of the sourceType. */ @NonNull @Override public TypeSpec getTypeSpec() { TypeSpec.Builder result = TypeSpec.classBuilder(getTypeName()); sourceType.applyAccessModifier(result); sourceType.applyTypeVariables(result); result.addJavadoc(createGeneratedAnnotation(processorClass).toString()); result.addJavadoc("\n"); result.addSuperinterface(getDecoratedTypeName()); for (Element element : sourceType.getAllEnclosedElements()) { if (element.getKind() == ElementKind.METHOD) { MethodSpec method = createOverridingMethod((ExecutableElement) element).build(); result.addMethod(method); } } return result.build(); }
private TypeName getDecoratedTypeName() { return TypeName.get(sourceType.asType()); }
@Override public TypeElement getSourceType() { return sourceType.getTypeElement(); }