Questions tagged [xjb]

xjb is a configuration file that is used to customize the default binding behaviour of the JAXB compiler.

The xjb file extension is related to JAXB (Java Architecture for XML Binding) and its binding compiler.

This file allows to customize the JAXB Bindings, when it is needed to modify the default bindings defined through the JAXB compiler. The file contains a set of binding declarations, e.g.:

<jxb:bindings version="1.0" 
  xmlns:jxb="http://java.sun.com/xml/ns/jaxb" 
  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
  xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" 
  jxb:extensionBindingPrefixes="xjc">
    <jxb:bindings schemaLocation="po4.xsd" node="/xs:schema">
        <jxb:globalBindings>
            <xjc:superClass name="com.syh.Shape"/>
            <xjc:serializable uid="12343"/>
        </jxb:globalBindings>
        <jxb:bindings node="//xs:element[@name='Widgets']//xs:complexType//xs:choice">
            <jxb:property name="Shapes"/>
        </jxb:bindings>
    </jxb:bindings>
</jxb:bindings>

(this sample comes from O'Reilly onjava.com)

The xjc compiler may be invoked like so:

xjc <schema.xsd> -b <file.jxb>

See also:

40 questions
0
votes
1 answer

Inheritance plugin for JAXB2 not working on simpleTypes

I have some trouble applying xjb inheritance bindings to a simpleType. Applying it to a complexType seems to work fine. The error I get is: compiler was unable to honor this implements customization. It is attached to a wrong place, or its…
Cloud
  • 458
  • 1
  • 13
  • 34
0
votes
1 answer

JAXB binding to remove propOrder

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

How do I change the case of XSD element name when generated as @XmlElement via xjc

I have a schema where element names are defined in PascalCase eg: But I would like this to generate as: @XmlElement(name = "employeeName") I know this sounds slightly strange but it…
MandyW
  • 1,117
  • 3
  • 14
  • 23
0
votes
0 answers

Change XmlRootElement annotation name by using binding

I am trying to convert my xsd files to java objects by using jax-b plugin (This plugin reads my xsd files and convert them to models). Since I have two xsd's with Request and Response schema. In both schemas , I have same root element name i.e XML.…
user2985842
  • 437
  • 9
  • 24
0
votes
1 answer

Same element name in two different xsd files

I have two xsd files.However , the element name is same in both files. So , to overcome from conflicts I have created binding file. Request.xsd
user2985842
  • 437
  • 9
  • 24
0
votes
2 answers

cxf wsdl2java generating ArrayOf instead of Type[]

I am using cxf wsdl2java commandline command in order to generate the client (java files). My xsd looks something like this -
callMeJava
  • 61
  • 1
  • 2
  • 12
0
votes
0 answers

Java Unmarshalling an XML file using JAXB without knowing the tags

So I have about 950 XML files that I need to read, I have the Java classes for those XML files generated using an .xsd and a binding .xjb file. My problem is that I need this code to be interchangeable, meaning it must be able to read different XML…
Umar Osman
  • 21
  • 9
0
votes
1 answer

JAXB binding XPath error

I am attempting to fix a collision when JAXB is generating classes from a set of XSDs. Here's the XML: ... ... …
fazed
  • 81
  • 1
  • 5
0
votes
1 answer

XJC xsd:any parsing

I have an element in XSD schema: Is it possible to switch processContents to strict through XJB binding? Without modifying schema file. May be set it as global property. I want to get: @XmlAnyElement(lax =…
Mikhail
  • 4,175
  • 15
  • 31
0
votes
1 answer

XJB file with translations

I generated my JAXB classes using XJC tool. Almost everything looks fine, but the schema elements are named in German not English. I want to rename fileds in classes to be en english and I know that I need to create XJB file with custom…
wojtek
  • 493
  • 1
  • 7
  • 12
1 2
3