public class BeanValidationPlugin
extends com.sun.tools.xjc.Plugin
Has two mods:
Is capable of generating the following annotations:"jsr303" - enables backward compatibility. "simpleRegex" - disables translation of UNICODE XML regex into UNICODE Java regex. Java ASCII regex are shorter to read.
Reacts to the following XSD restrictions and facets:- @DecimalMax - @DecimalMin - @Digits - @NotNull - @Pattern - @Size - @Valid - @AssertTrue - @AssertFalse - @Future - @Past
Basic usage:- maxExclusive - minExclusive - maxInclusive - minInclusive - nillable - pattern - length - maxLength - minLength - minOccurs - maxOccurs
Example usage with mods:xjc file.xsd -XBeanVal
Programmatic usage, with mods and extensions enabled:xjc file.xsd -XBeanVal jsr303 simpleRegex
Supports setting Target groups and Error message through binding customizations. Example:Driver.run(new String[] { schemaPath, "-extension", "-XBeanVal", "jsr303", "simpleRegex" }, System.out, System.out);
<xs:appinfo> <jxb:bindings node="/xs:schema/xs:complexType/xs:sequence/xs:element[@name='generic']"> <bv:facet type="maxLength" message="Hello, world!" groups="Object"/> <bv:facet type="future" message="Welcome to the Future!"/> </jxb:bindings> </xs:appinfo>
Supports custom-created BV annotations. Example:
<xs:appinfo> <jxb:bindings node="/xs:schema/xs:complexType/xs:sequence/xs:element[@name='generic']"> <bv:facet type="org.eclipse.persistence.annotations.AdditionalCriteria" value="This is a real custom annotation."/> </jxb:bindings> </xs:appinfo>
Modifier and Type | Field and Description |
---|---|
static String |
FACET |
static String |
JSR_303_MOD |
static String |
NS_URI |
static String |
PLUGIN_OPTION |
static String |
SIMPLE_REGEX_MOD |
Constructor and Description |
---|
BeanValidationPlugin() |
Modifier and Type | Method and Description |
---|---|
List<String> |
getCustomizationURIs() |
String |
getOptionName() |
String |
getUsage() |
boolean |
isCustomizationTagName(String nsUri,
String localName) |
int |
parseArgument(com.sun.tools.xjc.Options opt,
String[] args,
int i) |
boolean |
run(com.sun.tools.xjc.outline.Outline outline,
com.sun.tools.xjc.Options opts,
ErrorHandler errorHandler) |
public static final String PLUGIN_OPTION
public static final String JSR_303_MOD
public static final String SIMPLE_REGEX_MOD
public static final String NS_URI
public static final String FACET
public String getOptionName()
getOptionName
in class com.sun.tools.xjc.Plugin
public String getUsage()
getUsage
in class com.sun.tools.xjc.Plugin
public List<String> getCustomizationURIs()
getCustomizationURIs
in class com.sun.tools.xjc.Plugin
public boolean isCustomizationTagName(String nsUri, String localName)
isCustomizationTagName
in class com.sun.tools.xjc.Plugin
public int parseArgument(com.sun.tools.xjc.Options opt, String[] args, int i) throws com.sun.tools.xjc.BadCommandLineException, IOException
parseArgument
in class com.sun.tools.xjc.Plugin
com.sun.tools.xjc.BadCommandLineException
IOException
public boolean run(com.sun.tools.xjc.outline.Outline outline, com.sun.tools.xjc.Options opts, ErrorHandler errorHandler)
run
in class com.sun.tools.xjc.Plugin
Copyright © 2007–2020 Eclipse.org - EclipseLink Project. All rights reserved.