krasa-jaxb-tools | JAXB plugin for generation of Bean Validation Annotations
kandi X-RAY | krasa-jaxb-tools Summary
kandi X-RAY | krasa-jaxb-tools Summary
NOTE: I no longer use and maintain this plugin.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Processes the outline
- Returns the setter body for a setter
- Returns a method map from a field
- Get the body of a method
- Runs the outline properties
- Process an attribute
- Process an element
- Process a type
- Generate the validators
- Parses the validation policy string
- Parses XJC
- Determine whether or not the given namespace name is a customization tag name
- Parses the command line arguments
- The list of customization URIs
- Override this to be overridden by subclasses
krasa-jaxb-tools Key Features
krasa-jaxb-tools Examples and Code Snippets
Community Discussions
Trending Discussions on krasa-jaxb-tools
QUESTION
According to ValidationFeature documentation in order for the validation to happen the operations input and output bindings must be annotated with @Valid
However, the webservice interface generated by cxf-codegen-plugin does not have these annotations, and I don't seem to find a command line argument or a plugin that allows to add them.
The @Valid
annotations cannot be put in the implementation of the webservice interface without violating Liskov substitution principle: the reference implementation of JSR-349 (Hibernate Validator) in this case produces HV000151: A method overriding another method must not alter the parameter constraint configuration
Question: Is anybody aware of a way to annotate the cxf-generated webservice interface method parameters with @Valid
?
I'm aware of the existance of the Annox plugin but this does not seems to be an easy task to accomplish with it.
The easiest solution possible would be to manually add the @Valid
annotation to the webservice interface but I'm not comfortable in modifying generated code
Example
pom.xml
...ANSWER
Answered 2017-Feb-05 at 18:01Apache CXF's wsdl2java support is pluggable. There is a META-INF/tools-plugin.xml descriptor that allows you to define custom generators ("frontend profiles"). So if you need a @Valid
annotation on all cxf-generated webservice interfaces, you can just plug-in a custom SEIGenerator
.
Apache CXF uses Velocity templates to generate the SEI interfaces. So you just need to overwrite the default template with the custom one.
So instead of using the Anox or Krasa you can just create a simple cxf-codegen-plugin
overwrite.
So lets create a separate project, still you can put it in the same project but in different module, but for better reusability I would say a new project.
pom.xml
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install krasa-jaxb-tools
You can use krasa-jaxb-tools like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the krasa-jaxb-tools component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page