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
- 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 JAXB
- Why doesn't wrapping a List/Map in a JAXBElement work?
- JAXB How to append and XML String into a XML element?
- JAXB - why can i only marshal to a stream/file?
- I am new to JAXB. How can I merge two different xmls with different namespaces into one xml with a root element and unmarshal it?
- Why fasterxml lost the "xsi:type" attribute with JaxbAnnotationModule but JAXB Marshaller is fine
- Can I unmarshal a single xml property to a multi element array?
- How to stop XML Tag Attributes from sorting in Ascending Order after modifying the XML file using Java?
- Efficiently unmarshaling a part of a large xml file with JAXB and XMLStreamReader
- exception unmarshalling xml file using jaxb
- OSGI compatible artifact for jaxb2-basics?
- Unable to locate binding.xml for Maven JAXB plugin (jaxb2-maven-plugin)
- XMLGregorianCalendar not displayed in the right format when marshalled
- Convert date type to string in jaxb using bindings
- JAXB on-demand unmarshalling
- JAXB - how to create xml from object with <set varname = "String" value = name "String2"> elements
Related Questions in XJC
- How to validate xsd schema if it includes ohter schemas?
- Custom JAXB Map for Complex Types
- Using XJB with jaxb2-maven-plugin
- XJC generation error : can't parse argument number
- JAXB generated classes of certain types implementing a custom interface
- JAXB with nillable root
- JAXB binding for xs:integer to Java Integer instead of BigInteger
- Bulid JAXB classes in Gradle usin Kotlin
- Relative paths in XML catalogs are treated differently on windows and linux using XJC
- xjc or jaxb2-maven-plugin or maven: weird behavior while compiling XSDs, processing files twice but with altered names?
- xjc, maven-jaxb2-plugin: cryptic java.lang.NoSuchMethodException: javax.xml.bind.annotation.XmlElementRef.required()
- Custom JAXB Binding Causes Namespace Error
- When generating beans from dtd with xjc default values are in getter methods
- maven-jaxb2-plugin: how to accomplish this xjc command-line in the pom.xml?
- Forcing Jaxb preference of union member type when compiling
Related Questions in LOMBOK
- Using @NonNull for checking class members too
- How to exclude property from Lombok builder?
- Missing dependency LombokGetSetter.jar ver 1.0
- Lombok - @Singular annotation not found
- Lombok @NonNull vs Validate.notNull
- Trigger error when using a particular third-party or java.* method or constructor
- Google errorprone java compiler - Bugs during maven build: java.lang.NoSuchFieldError: pid
- Is there any "PostConstruct" feature of lombok?
- Create custom annotation for Lombok
- Project Lombok - Value annotation: is it possible to suppress @Getter?
- How to make Gradle add Lombok to its Project and external dependencies libraries?
- Lombok val and var not working on Android
- why ElastiMq keeps requiring server and check parameters since I am passing it
- JPA - OneToMany persist - EntityExistsException
- Can't use annotation @data in maven
Related Questions in JAXB2-ANNOTATE-PLUGIN
- custom annotation from xsd
- How to add include=JsonSerialize.Inclusion.NON_NULL to @JsonSerialize using annox plugin
- XJC - Add Lombok Annotation on top of every Generated XSD class and remove Setters Getters
- jaxb2-annotate-plugin adding broken optional content for lombok annotation
- jaxb2: Ignores annotation
- JAXB binding to annotate all strings in all schemas under /schema with a custom annotation
- xjc generates incorrect jaxb annotations for collection of IDREF elements
- XJC annotation issue
- How to use jaxb2-annotate-plugin
- jaxb2-annotate-plugin: Adding annotations to the XJC classpath
- Problem with adding annotation for JAXB created classes
- JAXB schema to Java Different XmlRootElement name and Class name
- Modify java classes to include specific annotations at compile time
- How to annotate enum using jaxb2-basics-annotate?
- 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 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.