I want to use JSR 303 Bean validation on my classes. My problem is that these classes are generated from schema. I am using the jaxb annotate plugin on my bindings file and was able to define simple validation annotations like @NotNull. My problem comes when I have to define multiple annotations of same type for different groups. javax.validation offers a solution for this using annotations like @Size.List{@Size...). How can I use jaxb-annotate and annox plugin to define annotations like those.
How to define javax.validation.constraints.Size.List in my binding file using jaxb annotate and annox plugins?
1.4k Views Asked by Bitter Me At
1
There are 1 best solutions below
Related Questions in ANNOTATIONS
- @Value annotation not resolved in a class that belongs to dependency jar
- How to use annotorious with angular
- Annotator dependencies: UIMA Type Capabilities?
- Symfony2 - Custom annotation loading
- What is the point of the name method in the symfony2 annotation?
- Only display annotations within visible mapview area
- Java annotation: validating primitives inside a list via an annotation
- Can't get custom annotation to work within test context using spring boot
- Technical debt on custom web rule in sonarqube 5.1
- Python - Add annotation in subplot imshow
- Make model-schema capture element addition on an array field request
- sal annotation (prefast) to enforce number of variadic args
- Changing the size of the UIImage
- getAllMembers from Elements does not return Parent's member annotations
- Pluggable Annotations Java 6 new feature
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 ANNOX
- How to add include=JsonSerialize.Inclusion.NON_NULL to @JsonSerialize using annox plugin
- JAXB \ Annox \ Package \ ObjectFactory
- Annotation with parameter using annox
- ClassNotFoundException with jaxb/annox and custom annotation
- Adding annotations to JAXB-generated classes which depend on information in XSD
- xjc with annox running from command prompt
- Adding annotations to package-info generated by JAXB
- Does annox(https://github.com/highsource/annox) support nested collection object while marshalling/unmarshalling using JAXB?
- Issue with Annox plugin in Jaxb
- JAXB annox and getting error java.lang.NoSuchMethodError: com.sun.codemodel.JAnnotatable.annotations()Ljava/util/Collection
- Edit JAXB generated annotation using annox and add namespace in param
- How to define javax.validation.constraints.Size.List in my binding file using jaxb annotate and annox plugins?
- jaxb annox plugin not working
- unsupported namespace annox xjc maven 1
- Jaxb Annox plugin : Is it possible to change annotation in objectFactory class @XmlElementDecl
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?
You can define nested annotations with Annox, it's no problem. In your case it will be something like:
In *.xjb file:
In schema:
I haven't tested it, so the syntax may be a bit different.
See the Annox user guide an the Annotate plugin docs.