google / auto

A collection of source code generators for Java.
Apache License 2.0
10.43k stars 1.2k forks source link

Request to consider new parameter ImmutableList<AutoValueExtension> applicableExtensions in AutoValueExtension.generateClass #540

Closed sopak closed 7 years ago

sopak commented 7 years ago

I created an extension to enforce guided auto value object initialisation.
https://github.com/sopak/auto-value-step-builder I would like to be able to return false from method mustBeFinal(), and for that, I need to know constructor of a final class.

I would like to extend class AutoValueExtension and add method and call it from AutoValueProccessor.writeExtensions

public String generateClass(Context context, String className, String classToExtend, boolean isFinal, ImmutableList<AutoValueExtension> applicableExtensions) {
  generateClass(context, className, classToExtend,isFinal);
}

Can you give me your oppinion?

eamonnmcmanus commented 7 years ago

I'm not really clear on what you're asking for. If you got a list of applicable extensions, what would you use it for?

sopak commented 7 years ago

I need to know the name of the final AutoValue_ClassName. Respective how many "$" I have to prepend. I need it for a case where no builder/creator is used and I want to create an instance.

JakeWharton commented 7 years ago

The final one has no prefix

On Tue, Oct 24, 2017 at 6:22 PM Kamil Sopko notifications@github.com wrote:

I need to know the name of the final AutoValue_ClassName. Respective how many "$" I have to prepend. I need it for a case where no builder/creator is used and I want to create an instance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/auto/issues/540#issuecomment-339085088, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEERsZZM5jhUA80Sd2ZNTNYME-Xyhgks5svir3gaJpZM4QCHZj .

sopak commented 7 years ago

@JakeWharton ups, thank you. How can I miss it. :)