Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

[SPR-8509] Update for Spring OXM Reference, including changes introduced in CastorMarshaller #243

Closed
wants to merge 1 commit into from

2 participants

Jakub Narloch Phil Webb
Jakub Narloch

The Spring reference has been updated, so that it reflects the
CastorMarshaller XSD configuration.

Link to Spring JIRA: https://jira.springsource.org/browse/SPR-8509

Jakub Narloch SPR-8509 Update for Spring OXM Reference, including changes introduce…
…d in

CastorMarshaller

The Spring reference has been updated, so that it reflects the
CastorMarshaller XSD configuration.
e94fb9d
Jakub Narloch

Ah yes, I have accepted the aggrement.

Thanks!

Phil Webb
Owner

Merged with a minor weak to nest the XSD section for consistency with the other examples.

Thanks for your work here.

Phil Webb philwebb closed this October 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Feb 28, 2013
Jakub Narloch SPR-8509 Update for Spring OXM Reference, including changes introduce…
…d in

CastorMarshaller

The Spring reference has been updated, so that it reflects the
CastorMarshaller XSD configuration.
e94fb9d
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 84 additions and 0 deletions. Show diff stats Hide diff stats

  1. 84  src/reference/docbook/oxm.xml
84  src/reference/docbook/oxm.xml
@@ -333,6 +333,9 @@ public class Application {
333 333
                     <para><link linkend="oxm-xmlbeans-xsd"><literal>xmlbeans-marshaller</literal></link></para>
334 334
                 </listitem>
335 335
                 <listitem>
  336
+                    <para><link linkend="oxm-castor-xsd"><literal>castor-marshaller</literal></link></para>
  337
+                </listitem>
  338
+                <listitem>
336 339
                     <para><link linkend="oxm-jibx-xsd"><literal>jibx-marshaller</literal></link></para>
337 340
                 </listitem>
338 341
             </itemizedlist>
@@ -476,6 +479,87 @@ public class Application {
476 479
 </beans>
477 480
 ]]></programlisting>
478 481
         </section>
  482
+
  483
+        <section id="oxm-castor-xsd">
  484
+            <title>XML Schema-based Configuration</title>
  485
+            <para>
  486
+                The <literal>castor-marshaller</literal> tag configures a
  487
+                <classname>org.springframework.oxm.castor.CastorMarshaller</classname>.
  488
+                Here is an example:
  489
+            </para>
  490
+
  491
+            <programlisting language="xml">
  492
+                <![CDATA[<oxm:castor-marshaller id="marshaller" mapping-location="classpath:org/springframework/oxm/castor/mapping.xml"/>]]></programlisting>
  493
+
  494
+            <para>
  495
+                The marshaller instance can be configured in two ways, by specifying either the location of
  496
+                a mapping file (through the <property>mapping-location</property> property), or by
  497
+                identifying Java POJOs (through the <property>target-class</property> or
  498
+                <property>target-package</property> properties) for which there exist their corresponding
  499
+                XML descriptor classes. The latter way is usually used in conjunction with XML code generation
  500
+                from XML schemas.
  501
+            </para>
  502
+
  503
+            <para>
  504
+                Available attributes are:
  505
+                <informaltable>
  506
+                    <tgroup cols="3">
  507
+                        <colspec colwidth="1.5*"/>
  508
+                        <colspec colwidth="4*"/>
  509
+                        <colspec colwidth="1*"/>
  510
+                        <thead>
  511
+                            <row>
  512
+                                <entry>Attribute</entry>
  513
+                                <entry>Description</entry>
  514
+                                <entry>Required</entry>
  515
+                            </row>
  516
+                        </thead>
  517
+                        <tbody>
  518
+                            <row>
  519
+                                <entry>
  520
+                                    <literal>id</literal>
  521
+                                </entry>
  522
+                                <entry>the id of the marshaller</entry>
  523
+                                <entry>no</entry>
  524
+                            </row>
  525
+                            <row>
  526
+                                <entry>
  527
+                                    <literal>encoding</literal>
  528
+                                </entry>
  529
+                                <entry>the encoding to use for unmarshalling from XML</entry>
  530
+                                <entry>no</entry>
  531
+                            </row>
  532
+                            <row>
  533
+                                <entry>
  534
+                                    <literal>target-class</literal>
  535
+                                </entry>
  536
+                                <entry>a Java class name for a POJO for which an XML class descriptor is available (as
  537
+                                    generated through code generation).
  538
+                                </entry>
  539
+                                <entry>no</entry>
  540
+                            </row>
  541
+                            <row>
  542
+                                <entry>
  543
+                                    <literal>target-package</literal>
  544
+                                </entry>
  545
+                                <entry>a Java package name that identifies a package that contains POJOs and their
  546
+                                    corresponding Castor
  547
+                                    XML descriptor classes (as generated through code generation from XML schemas)
  548
+                                </entry>
  549
+                                <entry>no</entry>
  550
+                            </row>
  551
+                            <row>
  552
+                                <entry>
  553
+                                    <literal>mapping-location</literal>
  554
+                                </entry>
  555
+                                <entry>location of a Castor XML mapping file</entry>
  556
+                                <entry>no</entry>
  557
+                            </row>
  558
+                        </tbody>
  559
+                    </tgroup>
  560
+                </informaltable>
  561
+            </para>
  562
+        </section>
479 563
     </section>
480 564
 
481 565
     <section xml:id="oxm-xmlbeans">
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.