I have many classes generated by JAXB's xsd2java. I need all these classes to be annotated with specific annotations at compile time (for example with lombok annotations). Is there any way to do this, with some code generation tool for example?
Modify java classes to include specific annotations at compile time
5k Views Asked by alex At
1
There are 1 best solutions below
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in JAXB
- Migrating Spring Boot 2 to 3 throws org.glassfish.jaxb.runtime.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
- ModelMapper: mapping an xs:IDREF which is a List of JAXBElement of Object
- 'Code too large' XML to Java using Jaxb2 and Castor maven plugins
- Migrating TransformerFactory Property from javax.xml.Transform to Jakarta in Spring 6 and Java 17
- Quarkus 3.8.x Java 17 NoClassDefFoundError: javax/xml/bind/JAXBException Dependency Conflict
- Why is this Enum class not JAXB-marshalled?
- CXF Codegen wsdlToJava JAXBException
- Troubleshooting JAXBException in JobRunr Scheduled Task with JDK 17 Spring Boot App deployed in Azure App Service
- Upgrading java 8 to 17, jaxb to jakarta generates source classes from wsdl with javax.xml.bind package and complains about package does not exist
- How to share/reuse classes between modularized JAXB/JAX-WS maven modules?
- Docx4J not working on Websphere Liberty Server 24.0.0.2
- JAXBException: Property appears in @XmlType.propOrder, but no such property exists
- How to consume SOAP web service in Spring?
- Applying constraints to the type arguments of parameterized types
- java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
Related Questions in XJC
- Java Annox library relocated
- Using xjc to add additional attribute to jaxb class
- JAXB is not generating enum classes from XSD simple types
- How to make JAXB Classes with parent child relationship
- Prevent JAXB from marshalling empty content for type with length restriction
- What is the best way to validate incoming json data using Jackson in Spring boot?
- Jaxb2 "Expected elements are (none)" when unmarshalling a java object from a XML document
- Best way to handle identical data within two different Java types generated from XSD files
- How to access xsi:type attribute of a xs:anySimpleType element in xjc generated class?
- Using the JAXB2 Simplify Plugin together with Java 17 and jaxb2-maven-plugin of codehaus
- Attribute jaxb:extensionBindingPrefixes is not allowed here
- Let xjc NOT use inheritance for XSD inheritance
- hisrc-higherjaxb-maven-plugin generates source code for an xsd file but doesn't annotate all elements in ObjectFactory with XmlElementDecl
- XJC throws java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException after migrating JAXB from javax to jakarta
- Issue with JAXB and xjc: Parsing xs:decimal with minExclusive constraint when building the project
Related Questions in LOMBOK
- While using Lombok 1.18.32 with java 17 it gives error that The type Lombok.Setter and Lombok.Setter is not accessible
- Unresloved dependency in maven
- Deserialize Builder Class without using Jacksonized
- Lombok AnnotationProcessor failing with Bazel build
- Lombok @SuperBuilder inheritance with generics always shows "capture of ?"
- Using a scope defined Override for a JPA Entity
- Springboot and Lombok
- In spring Lombok's annotations are not effective(maybe this is the bug)
- Builder annotation access level private
- Intellij does not pick lambok while running the application
- org.springframework.beans.BeanUtils.copyProperties(Object source, Object target) throws error Could not copy property 'channel' from source to target
- Cannot set any value LocalDateTime in Entity of Spring Boot Example
- Lombok not generating Getters and setters in Gradle Project
- Lombok @Data not generating getters and setters when compiled with Maven
- Debug logs are not printed on console after spring boot update from 2.7 to 3.2.3 using lombok
Related Questions in JAXB2-ANNOTATE-PLUGIN
- JAXB: xsd + xjb to POJO without annotations
- Problem with adding annotation for JAXB created classes
- XJC - Add Lombok Annotation on top of every Generated XSD class and remove Setters Getters
- jaxb2: Ignores annotation
- xjc generates incorrect jaxb annotations for collection of IDREF elements
- jaxb2-annotate-plugin adding broken optional content for lombok annotation
- JAXB binding to annotate all strings in all schemas under /schema with a custom annotation
- Manipulate JAXB to create IDREF Elements instead of JaxBElement<?>
- Jaxb2-annotate-plugin does not work with episodes
- custom annotation from xsd
- jaxb2-annotate-plugin: Adding annotations to the XJC classpath
- How to use jaxb2-annotate-plugin
- Custom annotation with jaxb2-annotate-plugin and XJC tool
- How to use jaxb2-annotate-plugin with XJC in command line
- jaxb2-annotate-plugin not working
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 # Hahtags
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?
Disclaimer: I am the author of JAXB2 Annotate Plugin which allows you adding arbitrary annotations to the schema-derived classes.
Short example:
Works in external binding files as well.
Limitations:
ps. I assume that when you said
xsd2javayou probably meant XJC.Update
The OP asked about in comments how to configure it with the jaxb2-maven-plugin.
You can use
jaxb2-annotate-pluginwith jaxb2-maven-plugin as well. I just have never tried it.dependencies/depenencyinpom.xml.argumentsinto the configuration.See this answer (and question) for examples:
It is about other plugins but you'll get a clue on how to configure it with Codehaus jaxb2-maven-plugin.
Configuration with my maven-jaxb2-plugin would be as follows:
This part:
refers to the artifact containing the annotation classes.
Here's a sample
pom.xmlfor maven-jaxb2-plugin/jaxb2-annotate-plugin combo.