Are you aware of any good JAXB Plugin which generated Builder pattern classes for the generated JAXB classes? Composing domain using JAXB generated classes is really nasty. I saw a plugin someone wrote back in 2010 but it doesn't use the newest maven plugin jaxb2-maven-plugin, and it also requires you to specify bindings for each schema type which is not robust.
Is there a JAXB Plugin which generates Builders?
14.1k Views Asked by Asaf Mesika At
2
There are 2 best solutions below
2
Mirko Klemm
On
Yes, there is now a plugin to generate fluent builders for JAXB-generated classes. There is a github project on
https://github.com/mklemm/jaxb2-rich-contract-plugin
It contains a couple of useful JAXB plugins. You can download source and binaries from github, or get maven artifacts from The Central Repository
Hope this helps. If you have any questions, just ask me, I'm the one who started it.
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in XML
- Impose component restriction to a series of parsys-CQ
- Wrong xml being inflated android
- Shorten the XSD
- Writing/Overwriting to specific XML file from ASP.NET code behind
- Magento custom block. Can't get block's file
- Layout not shifting up when keyboard is open
- CSV to XML XSLT: How to quote excape
- Getting deeply embedded XML element values
- Saving FileSystemInfo Array to File
- how to apply templates within xsl:for-each
- Spring - configure Jboss Intros for xml with java config?
- Problems with implementing custom actionbar android
- Can Apache Ant be told to cache its XML files?
- Is Log4j2 xml configuration case sensitive?
- How to get a specific node value in XML Pull Parser
Related Questions in JAXB2
- Using XJB with jaxb2-maven-plugin
- XJC generation error : can't parse argument number
- JAXB generated classes of certain types implementing a custom interface
- How to generate xml tag as full class name using jaxb?
- Spring Batch JAXB XML unmarshal targeting multiple XML nodes
- Error: Not supported: indent-number when using jaxb2-maven-plugin with jdk8
- Need help on JAXB
- XPATH evaluation results empty target node
- JAXB-Gen classes not getting added to class path
- Generate XSD from JAXB2 annotated class, without using APT
- Why has AnnotationReader been removed from JAXB reference implementation?
- Initialize JAXBContext in a post construct method
- JAXB Class Instance Listener
- File upload no longer works after upgrading from RESTEasy 2.4.3 to 3.0.1
- xml based representation for java code
Related Questions in JAXB2-MAVEN-PLUGIN
- Using XJB with jaxb2-maven-plugin
- Error: Not supported: indent-number when using jaxb2-maven-plugin with jdk8
- xjc or jaxb2-maven-plugin or maven: weird behavior while compiling XSDs, processing files twice but with altered names?
- Is there a JAXB Plugin which generates Builders?
- JAXB XML unmarshal with / in attribute value
- How to make jaxb plugin use OffsetDateTime
- unable to properly generate ObjectFactory with jaxb2-maven-plugin
- Using the JAXB2 Simplify Plugin together with Java 17 and jaxb2-maven-plugin of codehaus
- After migration of my jaxb code generator to jakarta, the unmarshalled xml is different
- WSDL generated Jaxb Add namespace prefix to only root element
- Why does jaxb2-maven-plugin xjc fail with Corretto jdk11.0.15_9 but not with Temurin jdk-11.0.14.1+1
- JAXB require boolean
- How to generate plural names with jaxb2
- XJC - Add Lombok Annotation on top of every Generated XSD class and remove Setters Getters
- No implicit JAXBElement conversion using Mapstruct with JAXB generated classes (for intermediate elements both nillable AND optionnal)
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The following snippet from a
pom.xmlfile, uses mavencxf-xjc-pluginto generate the JAXB classes and also leveragesjaxb-fluent-apito tack-on fluent interfaces ... which aren't exactly a complete builder pattern on their own ... but I think they leave room for folks to make decent headway in that direction.