Questions tagged [jaxb2-simplify-plugin]

JAXB2 Simplify Plugin simplifies complex properties (like xOrYOrZ) which XJC (JAXB schema compiler) sometimes generates.

JAXB2 Simlify plugin is a plugin for schema compiler which simplifies "weird" properties like xOrYOrZ which XJC sometimes generates. JAXB2 Simlify plugin is a part of the extensive plugins package.


Purpose

If you use XJC to generate Java classes from XML schemas, sometimes instead of the expected properties x, y, z you get something weird-looking like xOrYOrZ. This happens in a number of cases, for instance with repeatable choices:

<xs:choice maxOccurs="unbounded">
    <xs:element name="x" type="..."/>
    <xs:element name="y" type="..."/>
    <xs:element name="z" type="..."/>
</xs:choice>  

Working with such "complex" properties is not convenient. JAXB2 Simlify plugin allows splitting such properties into several "simple" properties (ex. x, y, z).

Usage

  • Add to the XJC classpath.
  • Declare http://jaxb2-commons.dev.java.net/basic/simplify as an extension namespace.
  • Use simplify:as-element-property or simplify:as-reference-property customization elements to specify, which properties you want to simplify.

Please refer to the full documentation for more information

11 questions
7
votes
1 answer

JAXB Simplify plugin still usable?

I tried the solution of the question here JAXB Simplify plugin vs *.xjb. but it failed with the following exception " compiler was unable to honor this simplify:as-element-property customization. It is attached to a wrong place, or its inconsistent…
Yinan
  • 83
  • 6
4
votes
1 answer

JAXB Simplify plugin vs *.xjb

I'm trying to use the Simplify plugin to replace a complex property with a set of simpler ones. I made it working following the plugin's manual. But I can't change the original schema, so I have to use an external bindings.xjb. And it gives me all…
1
vote
1 answer

jaxb2 simplify plugin binding issue

I tried to use JAXB2 simplify plugin using the XJC 2.2.4. D:\>xjc -d . -extension -p org.my.space sample.xsd parsing a schema... [ERROR] Unsupported binding namespace "http://jaxb2-commons.dev.java.net/basic/simplify". Perhaps you…
ulab
  • 1,079
  • 3
  • 15
  • 45
1
vote
1 answer

JAXB Binding Unsupported binding namespace "http://www.w3.org/2001/XMLSchema"

I have the following XSD which I'm generating JAXB bindings from... (only left relevant portions for this question):
alessandro ferrucci
  • 1,261
  • 2
  • 24
  • 48
1
vote
0 answers

How to enable JAXB Simplify plugin in Eclipse

In Eclipse with a JAXB project, I try to generate classes with the Simplify plugin enabled. Simplify plugin I've put the required annotation in the XSD file:
Ivan
  • 417
  • 1
  • 4
  • 10
1
vote
1 answer

Jaxb Simplify Plugin

i try to use the simplify plugin to simplify the generated code. I have a defined type:
wrm
  • 1,898
  • 13
  • 24
0
votes
1 answer

JAXB 2.1 implement Comparable for the generated Class

Using Jaxb 2.1 to generate java code from .xsd Jaxb2-basics plug-in is used Wants to have generated Class Student to implement Comparable. public class Student implements Serializable, Comparable { ... //bean class... public int…
0
votes
1 answer

JAXB binding to remove propOrder

I have written an XSD:
Sean
  • 2,315
  • 20
  • 25
0
votes
1 answer

jaxb2 simplify plugin for xs:choice having same types

I'm trying to use jaxb2 basics simplify plugin for my schema to JAXB conversion. It works fine for the complex types like below. Each element is defined inside the xs:choice has different types (type1 and type2). sample.xsd (complex choice type with…
ulab
  • 1,079
  • 3
  • 15
  • 45
0
votes
1 answer

jaxb2 simplify plugin elements not simplified

I have tried to convert XSD to JAXB classes using mave-jaxb2 plugin and jaxb2-basics simplify plugin. The configuration in pom.xml is available in this post sample.xsd (complex choice type)
ulab
  • 1,079
  • 3
  • 15
  • 45
0
votes
1 answer

JAXB2 maven plugin in eclipse shows error

I'm using JDK 1.6 (due to dependencies) and to generate classes from xsd, I have added maven-jaxb2 plugin as shown below in pom.xml. But the eclipse (Kepler) complains as below. Error parsing the command line [[-Xsimplify, -episode, …
ulab
  • 1,079
  • 3
  • 15
  • 45