eclipse-vertx / vertx-codegen

Vert.x code generator for asynchronous polyglot APIs
Apache License 2.0
104 stars 90 forks source link

Handlers are reported as CLASS_API #158

Open codepitbull opened 6 years ago

codepitbull commented 6 years ago

When using type.kind for Handlers (e.g. io.vertx.ext.web.handler.CookieHandler) the kind is reported to be CLASS_API instead of CLASS_HANDLER.

vietj commented 6 years ago

can you give an example of code that declares this type ?

codepitbull commented 6 years ago

My assumption is that during codegen the io.vertx.ext.web.handler.CookieHandler should be reported as CLASS_HANDLER, it is reported to be CLASS_API. What kind of example should I provide?

vietj commented 6 years ago

no it should be _CLASSAPI

however on ApiTypeInfo you do have the isHandler() method (accessible with handler property in templates) and also the getHandlerArg() method that you can use to achieve this effect.

codepitbull commented 6 years ago

Argh, you are right. But what sense does CLASS_HANDLER make if all @VertxGen annotated handlers are CLASS_API? Maybe we could clarify that in the docs.

vietj commented 6 years ago

CLASS_HANDLER == really the Handler class CLASS_API == anything annotated with vertxgen

vietj commented 6 years ago

can you make a PR for doc ?

codepitbull commented 6 years ago

Will do when I get home.