jaxb-fluent-api is a JAXB extension that allows you to generate free api-style code. Now, a free api is a way to develop your class methods, so they always return this instead of void .
There is a good example on the project wiki (I shortened it a bit for brevity, check the site for a complete example):
Normal JAXB generated code should be used as follows:
Project project = factory.createProject(); project.setModelVersion("4.0.0"); project.setGroupId("redmosquito") project.setArtifactId("jaxb-fluent-api-ext") project.setPackaging("jar") project.setVersion("0.0.1") project.setName("JAXB Fluent API Extensions");
With the jaxb-fluent-api extension, you can program the following:
Project project = factory.createProject() .withModelVersion("4.0.0"); .withGroupId("redmosquito") .withArtifactId("jaxb-fluent-api-ext") .withPackaging("jar") .withVersion("0.0.1") .withName("JAXB Fluent API Extensions");
This is basically what the fluent api is talking about.
source share