File: codegen-customs.html

package info (click to toggle)
libjibx1.2-java 1.2.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 26,260 kB
  • sloc: java: 75,013; xml: 14,068; makefile: 17
file content (905 lines) | stat: -rw-r--r-- 41,950 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>CodeGen Customizations</title>
      <style type="text/css">
        @import url("../style/tigris.css");
        @import url("../style/maven.css");
    .dtd-comment {
      color: #993399;
      font-weight: bold;
      </style>
      <script type="text/javascript">
        if (document.layers) {
          document.writeln('<link rel="stylesheet" type="text/css" href="../style/ns4_only.css" media="screen" /><link rel="stylesheet" type="text/css" href="../style/maven_ns4_only.css" media="screen" />')
        }
      </script>
      <link rel="stylesheet" type="text/css" href="../style/print.css" media="print" />
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body class="composite">
<div id="banner">
<table border="0" cellspacing="0" cellpadding="8" width="100%">
  <tbody>
    <tr>
      <td><h1>CodeGen Customizations</h1>
      </td>
      <td>
      <div align="right" id="login"><a href="http://sourceforge.net/projects/jibx"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=69358&type=16" width="150" height="40" border="0" alt="Get JiBX - XML Data Binding for Java at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></div>
      </td>
    </tr>
  </tbody>
</table>
</div>
<div id="breadcrumbs">
<table border="0" cellspacing="0" cellpadding="4" width="100%">
  <tbody>
    <tr>
      <td>
        <div align="right">
          <a href="../index.html">Home Page</a> |
          <a href="http://www.sourceforge.net/projects/jibx/">SourceForge Page</a> |
          <a href="../mail-lists.html">Mailing Lists</a> |
          <a href="../bugs.html">Bugs</a> |
          <a href="http://sourceforge.net/project/showfiles.php?group_id=69358">Downloads</a>
        </div>
      </td>
    </tr>
  </tbody>
</table>
</div>
<table border="0" cellspacing="0" cellpadding="8" width="100%" id="main">
  <tbody>
	<tr valign="top">
	  <td id="leftcol" width="20%">
		<div id="navcolumn">


                  <div>
            <strong>JiBX Basics</strong>
                              <div>
            <small>
                    <a href="../index.html">Overview</a>
                  </small>
                              <div>
            <small>
                    <a href="../getting-started.html">Getting Started</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../bindcomp.html">Binding Compiler</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../bindonload.html">Binding on Load</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../runtime.html">Runtime</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../extras.html">Extras</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../building.html">Building JiBX</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href=".././jibx-maven-plugin/index.html">Maven</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../contributing.html">Contributing</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../jibx-license.html">License</a>
                  </small>
                </div>
                      </div>
                                    <div>
            <small>
                    <a href="../status.html">News and Status</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../support.html">Support</a>
                  </small>
                              <div>
            <small>
                    <a href="../faq.html">FAQ</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../mail-lists.html">Mailing Lists</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../bugs.html">Bugs</a>
                  </small>
                </div>
                      </div>
                                    <div>
            <small>
                    <a href="../comments.html">User Comments</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../sponsors.html">Sponsors</a>
                  </small>
                </div>
                      </div>
                        <div>
            <strong>Start from Code</strong>
                              <div>
            <small>
                    <a href="../fromcode/index.html">Start from Code</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../fromcode/bindgen.html">BindGen</a>
                  </small>
                              <div>
            <small>
                    <a href="../fromcode/bindgen-examples.html">Example Code</a>
                  </small>
                              <div>
            <small>
                    <a href="../fromcode/bindgen-example1.html">Example 1</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../fromcode/bindgen-example2.html">Example 2</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../fromcode/bindgen-example3.html">Example 3</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../fromcode/bindgen-example4.html">Example 4</a>
                  </small>
                </div>
                      </div>
                                    <div>
            <small>
                    <a href="../fromcode/bindgen-customs.html">Customizations Reference</a>
                  </small>
                </div>
                      </div>
                                    <div>
            <small>
                    <a href="../fromcode/schemagen.html">SchemaGen</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../fromcode/jibx2wsdl.html">Jibx2Wsdl</a>
                  </small>
                              <div>
            <small>
                    <a href="../fromcode/jibx2wsdl-examples.html">Examples</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../fromcode/jibx2wsdl-customs.html">Customizations</a>
                  </small>
                </div>
                      </div>
                      </div>
                        <div>
            <strong>Start from Schema</strong>
                              <div>
            <small>
                    <a href="index.html">Start from Schema</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="codegen.html">CodeGen</a>
                  </small>
                              <div>
            <small>
                    <a href="codegen-types.html">Schema Datatype Handling</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="codegen-examples.html">Example Code</a>
                  </small>
                              <div>
            <small>
                    <a href="example-default.html">Default Generation</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="example-custom1.html">Simple Customizations</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="example-custom2.html">More Customizations</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="example-modular.html">Modular Generation</a>
                  </small>
                </div>
                      </div>
                                    <div>
            <small>
                    <span class="menu-selection">Customizations Reference</span>
                  </small>
                              <div>
            <small>
                    <a href="codegen-extends.html">Extensions Reference</a>
                  </small>
                </div>
                      </div>
                      </div>
                      </div>
                        <div>
            <strong>Binding Definition</strong>
                              <div>
            <small>
                    <a href="../binding/tutorial/binding-tutorial.html">Binding Tutorial</a>
                  </small>
                              <div>
            <small>
                    <a href="../binding/tutorial/binding-start.html">A basic binding</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/tutorial/binding-extras.html">Binding extras</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/tutorial/binding-structures.html">Structure mapping</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/tutorial/binding-collects.html">Collections and arrays</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/tutorial/binding-mappings.html">Using mappings</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/tutorial/binding-advanced.html">Advanced binding</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/tutorial/binding-extend.html">Method hooks</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/tutorial/binding-custom.html">Custom code</a>
                  </small>
                </div>
                      </div>
                                    <div>
            <small>
                    <a href="../binding/precompiled.html">Precompiled Bindings</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/binding-overview.html">Definition details</a>
                  </small>
                              <div>
            <small>
                    <a href="../binding/contexts.html">Definition contexts</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/conversions.html">Conversions</a>
                  </small>
                              <div>
            <small>
                    <a href="../binding/date-time.html">Date/time conversions</a>
                  </small>
                </div>
                      </div>
                                    <div>
            <small>
                    <a href="../binding/xml-summary.html">XML summary</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/binding-element.html">&lt;binding&gt; element</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/include-element.html">&lt;include&gt; element</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/format-element.html">&lt;format&gt; element</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/namespace-element.html">&lt;namespace&gt; element</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/mapping-element.html">&lt;mapping&gt; element</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/value-element.html">&lt;value&gt; element</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/structure-element.html">&lt;structure&gt; element</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/collection-element.html">&lt;collection&gt; element</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../binding/binding-attributes.html">Attribute groups</a>
                  </small>
                </div>
                      </div>
                      </div>
                        <div>
            <strong>Usage API</strong>
                              <div>
            <small>
                    <a href=".././api/index.html">Runtime JavaDocs</a>
                  </small>
                </div>
                      </div>
                        <div>
            <strong>Subprojects</strong>
                              <div>
            <small>
                    <a href="../eclipse/index.html">Eclipse Plug-in</a>
                  </small>
                              <div>
            <small>
                    <a href="../eclipse/index.html">Introduction</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../eclipse/install.html">Install</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../eclipse/usage.html">Usage</a>
                  </small>
                </div>
                      </div>
                                    <div>
            <small>
                    <a href="../jibxws/index.html">JiBX/WS</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../axis2/index.html">Axis2 Usage</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href="../jibxota/index.html">JiBX/OTA</a>
                  </small>
                </div>
                                    <div>
            <small>
                    <a href=".././schema-library/index.html">Schema Library</a>
                  </small>
                </div>
                      </div>
      

        </div>
      </td>
      <td>


<div id="bodycol">
<div class="app">
<div class="h3">
<h3><a name="intro"></a>CodeGen customizations</h3>

<p>Customizations are used to control how CodeGen interprets your schemas and generates
both Java code and a corresponding JiBX binding. The customizations are normally
supplied to CodeGen in the form of an XML document, though certain customizations can
alternatively be set by means of <a href="#command">command line parameters</a>.</p>

</div>
<div class="h3">
<h3><a name="docstruct"></a>Customization document structure</h3>

<p>The general form of a customizations document consists of a root <b>schema-set</b>
element which applies to all the schemas being used, within which there may be both
other <b>schema-set</b> elements and <b>schema</b> elements for individual schemas. If you're
only working with a single schema, you can instead skip the <b>schema-set</b> element and
use the <b>schema</b> element directly as the root of your customizations. Within a <b>schema</b>
element, you can use elements with names corresponding to various schema definition
components (<b>attribute</b>, <b>complexType</b>, <b>element</b>, etc.) to customize
specific schema components, using XPath-like features to relate the customization elements
to particular instances of the corresponding schema definition element.</p>

<p>Sound confusing? It's really pretty simple and intuitive, once you get the basic
concepts down. Here's a sample using nested <b>schema-set</b> and <b>schema</b> elements for a
complex collection of schemas, to show how this works:</p>

<code><pre>&lt;schema-set xmlns:xs="http://www.w3.org/2001/XMLSchema"
    type-substitutions="xs:integer xs:int xs:decimal xs:float">
  &lt;schema-set package="org.ota.air" names="OTA_Air*.xsd">
    &lt;schema-set generate-all="false" prefer-inline="true"
        names="OTA_AirCommonTypes.xsd OTA_AirPreferences.xsd"/>
    &lt;schema name="OTA_AirAvailRS.xsd">
      &lt;element path="element[@name=OTA_AirAvailRS]/**/element[@name=OriginDestinationOption]"
        ignore="true"/>
    &lt;/schema>
  &lt;/schema-set>
  &lt;schema-set package="org.ota.hotel" names="OTA_Hotel*.xsd">
    &lt;schema-set generate-all="false" prefer-inline="true"
        names="OTA_HotelCommonTypes.xsd OTA_HotelContentDescription.xsd
        OTA_HotelEvent.xsd OTA_HotelPreferences.xsd OTA_HotelReservation.xsd
        OTA_HotelRFP.xsd"/>
  &lt;/schema-set>
  ...</pre></code>

<p>In this customizations document, the root <b>schema-set</b> element sets some customization
options which apply to the full collection of schemas. The child <b>schema-set</b> elements
each specify a particular subset of the schemas (which must be distinct from those specified
by sibling schema-set elements); in this example,
the first child <b>schema-set</b> applies to schemas with names matching the "OTA_Air*.xsd"
pattern, the second to schemas with names matching "OTA_Hotel*.xsd". The first child
<b>schema-set</b> has yet another <b>schema-set</b> element and a <b>schema-set</b> element as its children.
Within the <b>schema-set</b> element, an <b>element</b> child is used to customize the handling of one
particular xs:element component within the schema definition.</p>

<p>The remainder of this page discusses the customization elements used to model the structure
of the collection of schemas being generated. In addition to these structural customization
elements, there are a few other customization elements which are used to extend or modify the
actual code generation. These extension customization elements must be direct children of a
<b>schema</b> or <b>schema-set</b> element, and must precede any other child elements. See
<a href="codegen-extends.html">CodeGen Extension</a> for the details of using these elements. The full
schema definition for the customizations is
<a href="../schemas/codegen-customizations.xsd">included in the documentation.</a></p>

</div>
<div class="h3">
<h3><a name="schemacust"></a><b>schema-set</b> and <b>schema</b> customizations</h3>

<p>Customization attributes which apply at the schema level can be used with both
<b>schema-set</b> and <b>schema</b> elements. These elements can be nested in the customizations
document, and customizations are inherited through the nesting: A customization attribute
on a <b>schema-set</b> applies to all the schemas in the set, but may be overridden by a
different setting of the attribute on a nested <b>schema-set</b> or <b>schema</b> element. Here's
the alphabetical list of these schema-level customization attributes:</p>

<h4>Schema-level customization attributes</h4>
<table cellpadding="3" cellspacing="2" border="1" width="100%">
<tr class="b">
<td><p><a name="binding-file-name"></a>binding-file-name</p></td>
<td><p>Specify the file name to be used for the generated binding definition. If this
is not specified the root binding is always named <i>binding.xml</i> and any other
bindings use names derived from the namespace associated with the binding.</p></td>
</tr>
<tr class="a">
<td><p><a name="binding-per-schema"></a>binding-per-schema</p></td>
<td><p>Control whether a separate binding definition will be generated for each schema
definition. By default, bindings for schemas using the same namespace are merged into
a single binding definition. Allowed values are
<code>true</code> and <code>false</code> (the default).</p></td>
</tr>
<tr class="b">
<td><p><a name="delete-annotations"></a>delete-annotations</p></td>
<td><p>Delete annotations from schema fragments shown in Javadocs. This generally makes
the schema fragments easier to understand, especially since xs:documentation elements in
the schema are normally converted to Javadocs in any case. Allowed values are
<code>true</code> (the default) and <code>false</code>.</p></td>
</tr>
<tr class="a">
<td><p><a name="enumeration-type"></a>enumeration-type</p></td>
<td><p>Control the type of classes generated for enumerations. Allowed values are
<code>java5</code> for Java 5 enum classes (the default) and <code>simple</code> for
simple typesafe enumeration classes compatible with all Java compiler versions.</p></td>
</tr>
<tr class="b">
<td><p><a name="generate-all"></a>generate-all</p></td>
<td><p>If the value is <code>false</code>, skip any unused global schema definitions
in the code generation. This is intended for use with schemas referenced by xs:include
or xs:import, which often include definitions not needed by the original schema. By
skipping code generation for these unnecessary definitions you can reduce the number of
classes in the generated data model. Allowed values are <code>true</code> (the default)
and <code>false</code>.</p></td>
</tr>
<tr class="a">
<td><p><a name="import-docs"></a>import-docs</p></td>
<td><p>Convert xs:documentation annotations in the schema definition to Javadocs in the
generated code if <code>true</code>. Allowed values are <code>true</code> (the default)
and <code>false</code>.</p></td>
</tr>
<tr class="b">
<td><p><a name="line-width"></a>line-width</p></td>
<td><p>Specify the desired maximum line width in the generated Java code. The value can
be any integer.</p></td>
</tr>
<tr class="a">
<td><p><a name="package"></a>package</p></td>
<td><p>Give the name of the package to be used for generated Java code. The value can
be any package name.</p></td>
</tr>
<tr class="b">
<td><p><a name="prefer-inline"></a>prefer-inline</p></td>
<td><p>If <code>true</code>, use inline definitions where possible rather than creating
separate classees. Allowed values are <code>true</code> and <code>false</code> (the
default).</p></td>
</tr>
<tr class="a">
<td><p><a name="prefix"></a>prefix</p></td>
<td><p>Prefix to be used in the generated bindings for the namespace associated with a
schema. Prefixes are normally assigned based on the usages found in the schema documents,
but this customization can be used to change these values. If you use this customization
on a <b>schema-set</b> element, all the schemas included in the set must use the
same namespace.</p></td>
</tr>
<tr class="b">
<td><p><a name="repeated-type"></a>repeated-type</p></td>
<td><p>Control how repeated schema components (both xs:list values, and particles with
minOccurs > 1) are represented in Java code. Allowed values are <code>array</code> (for
arrays), <code>list</code> (for untyped <code>java.util.List</code>), and
<code>typed</code> (for Java 5 typed list, the default).</p></td>
</tr>
<tr class="a">
<td><p><a name="show-schema"></a>show-schema</p></td>
<td><p>If <code>true</code>, include schema fragments corresponding to the generated
code in class Javadocs. The schema fragments included are based on a post-processing
view of the schema, after processing type substitutions, deletions, and schema
normalizations. Allowed values are <code>true</code> (the default) and
<code>false</code>.</p></td>
</tr>
<tr class="b">
<td><p><a name="structure-optional"></a>structure-optional</p></td>
<td><p>Control whether references to classes with no associated element and all
components optional should be made optional in the generated binding. The effect of
making such class references optional is that the reference will be set <code>null</code>
when unmarshalling if none of the components are present, and will be checked for
<code>null</code> when marshalling. Allowed values are <code>true</code> (the default) and
<code>false</code>.</p></td>
</tr>
<tr class="a">
<td><p><a name="use-inner"></a>use-inner</p></td>
<td><p>Control whether inner classes are used for secondary structures within the generated
Java code. If <code>true</code> inner classes will be used; otherwise, separate top-level
classes will be used. This only applies for the equivalent of anonymous xs:complexType
definitions, or definitions which have been inlined; top-level classes are always used
when definitions are used in more than one place. Allowed values are <code>true</code> (the
default) and <code>false</code>.</p></td>
</tr>
</table>

<p>Besides these schema-level customizations, any of the nesting customizations listed in
the next section can also be used on <b>schema-set</b> and <b>schema</b> elements. There are also
some attributes which are only allowed with <b>schema-set</b>, and some which are only allowed
with <b>schema</b>. Here's the list of these attributes for <b>schema-set</b>:</p>

<h4>Attributes only allowed on <b>schema-set</b> element</h4>
<table cellpadding="3" cellspacing="2" border="1" width="100%">
<tr class="b">
<td><p><a name="names"></a>names</p></td>
<td><p>List of name patterns for schemas included in this set. Individual patterns are
whitespace-separated, and may include '*' characters as wildcards matching any number of
arbitrary characters. Multiple '*' wildcards may be used within a single pattern, but
may not be contiguous (i.e., there must be one or more regular characters between any
pair of wildcards).</p></td>
</tr>
<tr class="a">
<td><p><a name="namespaces"></a>namespaces</p></td>
<td><p>List of namespace URIs for schemas included in this set. Individual URIs are
whitespace-separated.</p></td>
</tr>
</table>

<p>These attributes are not allowed on the root <b>schema-set</b> element of a customizations
document, but at least one is required on any nested <b>schema-set</b> element (since they
determine which schemas are actually included in the set). When multiple <b>schema-set</b>
child elements are used, the sets of schemas identified by each <b>schema-set</b> must be
disjoint.</p>

<p>Here's the list of attributes only allowed with <b>schema</b> customization elements:</p>

<h4>Attributes only allowed on <b>schema-set</b> element</h4>
<table cellpadding="3" cellspacing="2" border="1" width="100%">
<tr class="b">
<td><p><a name="excludes"></a>excludes</p></td>
<td><p>List of schema global definitions to be excluded from the code generation. Names
are separated by whitespace characters. This overrides the normal reference checks used
to determine which schema definitions are going to be generated as Java code.</p></td>
</tr>
<tr class="a">
<td><p><a name="includes"></a>includes</p></td>
<td><p>List of schema global definitions to be included in the code generation. Names
are separated by whitespace characters. This overrides the normal reference checks used
to determine which components are going to be generated as Java code.</p></td>
</tr>
<tr class="b">
<td><p><a name="name"></a>name</p></td>
<td><p>The schema name, meaning the last component in the schema path (whether accessed
from the file system, by using HTTP, or by any other means). No wildcard characters are
allowed, so the name must be an exact match.</p></td>
</tr>
<tr class="a">
<td><p><a name="namespace"></a>namespace</p></td>
<td><p>Schema target namespace URI. This can only be used to identify a schema if there's
only one schema using that namespace.</p></td>
</tr>
</table>

</div>
<div class="h3">
<h3><a name="nestcust"></a>Nesting customizations</h3>

<p>Nesting customization attributes can be used on any customization element, including
<b>schema-set</b>, <b>schema</b>, and schema component customizations (described below).
Here's the alphabetical list of these attributes:</p>

<h4>Nesting customization attributes</h4>
<table cellpadding="3" cellspacing="2" border="1" width="100%">
<tr class="b">
<td><p><a name="any-handling"></a>any-handling</p></td>
<td><p>Controls how xs:any particles are represented in the generated Java code and
binding definition. Allowed values are <code>discard</code> (meaning discard when
unmarshalling and don't generate when marshalling), <code>dom</code> (meaning use a
<code>org.w3c.dom.Element</code> or list of elements for a repeating xs:any, the default),
and <code>mapped</code> (meaning require any element(s) matching the xs:any to be
defined as a global element in the schema).</p></td>
</tr>
<tr class="a">
<td><p><a name="choice-exposed"></a>choice-exposed</p></td>
<td><p>When <code>true</code>, the generated code directly exposes xs:choice states to
the user in the generated code. In this case the constants used for the choice states are
made public, and there's an added <code>stateXXX()</code> method which returns the current
state of the choice. Otherwise, the choice state is only exposed to the user via
<code>ifXXX()</code> methods checking if a particular state has been set. Allowed values
are <code>true</code> and <code>false</code> (the default).</p></td>
</tr>
<tr class="b">
<td><p><a name="choice-handling"></a>choice-handling</p></td>
<td><p>Control how xs:choice is implemented in the generated code. xs:choice handling
always uses a separate property for each alternative in the choice, and in most cases
also uses a state variable that tracks the most-recent setting. There are several options
for how the state is set and changed, though, and this customization selects the option
to be used. Allowed values are <code>stateless</code> (meaning there is no state variable,
and it's up to the user to make sure only one of the choice values is set),
<code>checkset</code> (meaning that when the 'set' access method for one of the choice
properties is called the code will throw an exception if a different choice had previously
been set and the <code>clearXXX()</code> method has not been called), <code>checkboth</code>
(meaning that in addition to the <code>checkset</code> check on setting a choice property,
the choice property 'get' access methods will also check that the current state is either
unset or matches that property), <code>overset</code> (meaning that when the 'set' access
method for one of the choice properties is called it will overwrite any previous choice),
and <code>overboth</code> (meaning 'set' methods overwrite previous choices, while 'get'
access methods check that the current state is either unset or matches that property).</p></td>
</tr>
<tr class="a">
<td><p><a name="enforced-facets"></a>enforced-facets</p></td>
<td><p>This is included for use once xs:simpleType facet handling is implemented, but is
currently ignored.</p></td>
</tr>
<tr class="b">
<td><p><a name="ignored-facets"></a>ignored-facets</p></td>
<td><p>This is included for use once xs:simpleType facet handling is implemented, but is
currently ignored.</p></td>
</tr>
<tr class="a">
<td><p><a name="union-exposed"></a>union-exposed</p></td>
<td><p>This is included for use once full xs:union handling is implemented, but is
currently ignored.</p></td>
</tr>
<tr class="b">
<td><p><a name="union-handling"></a>union-handling</p></td>
<td><p>This is included for use once full xs:union handling is implemented, but is
currently ignored.</p></td>
</tr>
<tr class="a">
<td><p><a name="type-substitutions"></a>type-substitutions</p></td>
<td><p>Defines type substitutions to be applied before generating code. The substitutions
are given as pairs of type names, with the type to be replaced first and the type to be
substituted second. The type names are all treated as namespace-qualified values, and are
separated by one or more whitespace characters.</p></td>
</tr>
</table>

</div>
<div class="h3">
<h3><a name="schemacomp"></a>Schema component customizations</h3>

<p>Schema component customizations each apply to a particular element within a schema
definition. The element name for the customization always matches the name of the schema
definition element being customized (but without namespace), so the following are all
legal schema component customization element names: <b>any</b>, <b>anyAttribute</b>,
<b>all</b>, <b>attribute</b>, <b>attributeGroup</b> <b>choice</b>, <b>complexType</b>,
<b>element</b>, <b>extension</b>, <b>group</b>, <b>list</b>, <b>restriction</b>,
<b>sequence</b>, <b>simpleContent</b>, <b>simpleType</b>, and <b>union</b>. These
component customizations can be nested, and use XPath-like path specifications (realative
to the containing customization) to identify the particular instance of the schema
definition element to which the component customization applies. All schema component
customizations can use any of the nesting customization attributes defined in the last
section, and also the following attributes:</p>

<h4>Common component customization attributes</h4>
<table cellpadding="3" cellspacing="2" border="1" width="100%">
<tr class="b">
<td><p><a name="path"></a>path</p></td>
<td><p>Path to the schema element to be customized. The path is in XPath-like form, with
path steps separated by '/' characters. '*' can be used as a path step matching any
arbitrary schema element, and '**' as a path step matching any nesting of arbitrary
schema elements, with the restriction that these wildcard steps cannot be used as the
initial path step if the customization element is a direct child of a <b>schema-set</b>
customization - in other words, you can only use wildcards once you've identified the
global schema component involved. Steps matching named components of the schema
definition (global type, group, or attribute group definitions, or element or attribute
definitions whether global or not) can use a '[@name=...]' predicate to single out a
particular instance of the component type (which will match either a 'name' or 'ref'
attribute value in the schema definition). Steps can also use a numeric predicate '[n]'
to identify which of several potential matches is being referenced, where the numbering
starts at '1' for the first match (as in XPath). The last path step may be left empty,
since the element name for this path step must always be the same as the customization
element name.</p></td>
</tr>
<tr class="a">
<td><p><a name="position"></a>position</p></td>
<td><p>Number of the instance to be matched. This is equivalent to a '[n]' predicate on
the last step in a path expression, but as a convenience can be used directly for cases
where no path expression is otherwise required.</p></td>
</tr>
</table>

<p>Beyond these common attributes, different types of customization elements support
one or more added attributes as defined below:</p>

<h4>Specialized component customization attributes</h4>
<table cellpadding="3" cellspacing="2" border="1" width="100%">
<tr class="b">
<td><p><a name="class-name"></a>class-name</p></td>
<td><p>Java class name used for the representation of the schema component (ignored if
no class required). This must be a simple class name, without package information (since
the package is determined on a per-schema basis). This attribute is allowed on the
following types of customization elements: <b>all</b>, <b>attribute</b>, <b>attributeGroup</b>, <b>choice</b>,
<b>complexType</b>, <b>element</b>, <b>group</b>, <b>sequence</b>, <b>simpleType</b>.</p></td>
</tr>
<tr class="a">
<td><p><a name="exclude"></a>exclude</p></td>
<td><p>Remove component from code generation if <code>true</code>. This effectively deletes
the target component from the schema definition before code generation. Allowed values
are <code>true</code> and <code>false</code> (the default). This attribute is allowed on
the following types of customization elements: <b>all</b>, 'any', 'anyAttribute', <b>attribute</b>,
<b>attributeGroup</b>, <b>choice</b>, <b>complexType</b>, <b>element</b>, <b>group</b>, <b>sequence</b>, <b>simpleType</b>.</p></td>
</tr>
<tr class="b">
<td><p><a name="ignore"></a>ignore</p></td>
<td><p>Ignore element or attribute when unmarshalling documents. This drops the component from
the generated data model, but accepts it and discards any content when unmarshalling (as opposed
to the <a href="#exclude">exclude</a> behavior, which completely removes the component from the
schema definition, meaning input documents containing an excluded element will cause errors in
unmarshalling). Allowed values are <code>true</code> and <code>false</code> (the default). This
attribute is allowed on the following types of customization elements: <b>attribute</b> and
<b>element</b>.</p></td>
</tr>
<tr class="a">
<td><p><a name="inline"></a>inline</p></td>
<td><p>Control whether the schema component is represented using a separate class or inline
values. The control provided by this customization is limited, in that all schema components
which represent or contain data values can be represented by a separate class, but not all
can be inlined by CodeGen. Allowed values are: <code>default</code>, meaning the default
handling applies (the default); <code>block</code>, meaning the component should be
represented using a separate class; and <code>prefer</code>, meaning inlining should be used
if possible. Since the default CodeGen handling is to prefer inlining for local definitions,
the <code>prefer</code> value generally only makes a difference when used on a global
definition schema component. This attribute is allowed on all types of customization elements,
but will be ignored if not applicable.</p></td>
</tr>
<tr class="b">
<td><p><a name="name"></a>name</p></td>
<td><p>Schema component name attribute value. This is equivalent to an '[@name=XXX]'
predicate on the last step in a path expression, but as a convenience can be used directly
for cases where no path expression is otherwise required. The attribute is allowed on
the following types of customization elements: <b>attribute</b>, <b>attributeGroup</b>, <b>complexType</b>,
<b>element</b>, <b>group</b>, <b>simpleType</b>.</p></td>
</tr>
<tr class="a">
<td><p><a name="type"></a>type</p></td>
<td><p>Substitute type to be used for component. This is used to replace the type specified
in the schema for the target component with some other type before code generation. It is
similar to using the <a href="#type-substitutions">'type-substitutions'</a> nesting customization
attribute, but supports replacing anonymous type definitions in addition to global types. This
attribute is allowed on the following customization elements: <b>attribute</b>,
<b>complexType</b>, <b>element</b>, <b>simpleType</b>. <b>Note: not yet supported</b></p></td>
</tr>
<tr class="b">
<td><p><a name="value-name"></a>value-name</p></td>
<td><p>Name used for the Java property value representing the component, and also for the
class name when the component is represented using a separate class. This customization
is normally only useful when applied to nested components of a schema definition, rather
than global definitions (so on group <i>references</i>, rather than group <i>definitions</i>,
for instance). It is allowed on the following customization elements: <b>all</b>,
<b>attribute</b>, <b>attributeGroup</b>, <b>choice</b>, <b>element</b>, <b>group</b>, <b>sequence</b>.</p></td>
</tr>
</table>

</div>
<div class="h3">
<h3><a name="command"></a>Command line customizations</h3>

<p>If you just want to set some basic global customizations for CodeGen you do this using
command-line parameters and avoid the need to create a customizations file. The special prefix
"--" is used to do this. So to set <code>delete-annotations="true"</code> and
<code>any-handling="mapped"</code>, for instance, you'd add <code>--delete-annotations=true</code>
and <code>--any-handling=mapped</code> to the BindGen command line. No quotes are needed for
the attribute value when you use this technique. This technique only allows you to set global
customizations, though, so if you're doing anything at the individual schema or component level
you'll still need to use a customizations file.</p>

</div>
</div>
</div>


      </td>
    </tr>
  </tbody>
</table>
<div id="footer">
<table border="0" cellspacing="0" cellpadding="4">
  <tbody>
    <tr>
      <td> &copy; 2003-2011, Dennis M. Sosnoski (<a href="http://www.sosnoski.co.nz">Sosnoski Software Associates Ltd</a>).
      Licensed to the JiBX Project for free distribution and use. </td>
    </tr>
  </tbody>
</table>
</div>
<br>
</body>
</html>