ciscoo / cxf-codegen-gradle

Gradle plugin to generate Java artifacts from WSDL
Apache License 2.0
28 stars 6 forks source link

Provide idiomatic configure method for wsdl2java container #6

Closed ciscoo closed 3 years ago

ciscoo commented 3 years ago

For plugin authors, if they wanted to configure the wsdl2java container, they will need to do the following:

cxfCodegen.getWsdl2java().register("foo", (foo) -> foo.getWsdl().set(temp));
cxfCodegen.getWsdl2java().register("bar", (bar) -> bar.getWsdl().set(temp));

The getter is more useful when authors need to reference the container in other places, not so much when it's just used for configuring the container.

Instead, the following should be possible:

cxfCodegen.wsdl2java((wsdl2Java) -> {
    wsdl2Java.register("foo", (foo) -> foo.getWsdl().set(temp));
    wsdl2Java.register("bar", (bar) -> bar.getWsdl().set(temp));
});