Skip to content

Commit 7ce0406

Browse files
committed
Merge pull request spring-projects#243 from jmnarloch/SPR-8509
# By Jakub Narloch * SPR-8509: Add Castor XSD information to reference docs
2 parents b27fc0e + 5d727b2 commit 7ce0406

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

src/reference/docbook/oxm.xml

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

0 commit comments

Comments
 (0)