Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EclipseLink/Examples/MOXy/BVinJAXB/DisablingBV
< EclipseLink | Examples | MOXy | BVinJAXB
Turn BV in JAXB off
By default, BV is in mode AUTO. That means, if BV provider is found on classpath, it is turned on, otherwise it is silently turned off and an informative message is logged.
In order to switch BV off, a property must be passed to either JAXBContext, Marshaller or Unmarshaller.
Example:
Map<String, BeanValidationMode> props = new HashMap<>(); props.put(JAXBContextProperties.BEAN_VALIDATION_MODE, BeanValidationMode.NONE); Class[] classes = new Class[] { Customer.class }; JAXBContext jaxbContext = JAXBContext.newInstance(classes, props);