Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
f4b4f28f
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f4b4f28f
编写于
4月 13, 2009
作者:
T
Thomas Risberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added language element to programlisting for syntax highlighting
上级
b7ab939d
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
171 addition
and
180 deletion
+171
-180
spring-framework-reference/src/jdbc.xml
spring-framework-reference/src/jdbc.xml
+55
-55
spring-framework-reference/src/orm.xml
spring-framework-reference/src/orm.xml
+63
-63
spring-framework-reference/src/oxm.xml
spring-framework-reference/src/oxm.xml
+18
-18
spring-framework-reference/src/transaction.xml
spring-framework-reference/src/transaction.xml
+35
-44
未找到文件。
spring-framework-reference/src/jdbc.xml
浏览文件 @
f4b4f28f
此差异已折叠。
点击以展开。
spring-framework-reference/src/orm.xml
浏览文件 @
f4b4f28f
此差异已折叠。
点击以展开。
spring-framework-reference/src/oxm.xml
浏览文件 @
f4b4f28f
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
Spring abstracts all marshalling operations behind the
Spring abstracts all marshalling operations behind the
<interfacename>
org.springframework.oxm.Marshaller
</interfacename>
interface, the main methods of which
<interfacename>
org.springframework.oxm.Marshaller
</interfacename>
interface, the main methods of which
is listed below.
is listed below.
<programlisting>
<![CDATA[
<programlisting
language=
"java"
>
<![CDATA[
public interface Marshaller {
public interface Marshaller {
/**
/**
...
@@ -115,7 +115,7 @@ public interface Marshaller {
...
@@ -115,7 +115,7 @@ public interface Marshaller {
<para>
<para>
Similar to the
<interfacename>
Marshaller
</interfacename>
, there is the
Similar to the
<interfacename>
Marshaller
</interfacename>
, there is the
<interfacename>
org.springframework.oxm.Unmarshaller
</interfacename>
interface.
<interfacename>
org.springframework.oxm.Unmarshaller
</interfacename>
interface.
<programlisting>
<![CDATA[
<programlisting
language=
"java"
>
<![CDATA[
public interface Unmarshaller {
public interface Unmarshaller {
/**
/**
...
@@ -205,7 +205,7 @@ public interface Unmarshaller {
...
@@ -205,7 +205,7 @@ public interface Unmarshaller {
Spring's OXM can be used for a wide variety of situations. In the following example, we will use it to
Spring's OXM can be used for a wide variety of situations. In the following example, we will use it to
marshal the settings of a Spring-managed application as an XML file. We will use a simple JavaBean to
marshal the settings of a Spring-managed application as an XML file. We will use a simple JavaBean to
represent the settings:
represent the settings:
<programlisting>
<![CDATA[
<programlisting
language=
"java"
>
<![CDATA[
public class Settings {
public class Settings {
private boolean fooEnabled;
private boolean fooEnabled;
...
@@ -223,7 +223,7 @@ public class Settings {
...
@@ -223,7 +223,7 @@ public class Settings {
methods:
<methodname>
saveSettings
</methodname>
saves the settings bean to a file named
methods:
<methodname>
saveSettings
</methodname>
saves the settings bean to a file named
<filename>
settings.xml
</filename>
, and
<methodname>
loadSettings
</methodname>
loads these settings again. A
<filename>
settings.xml
</filename>
, and
<methodname>
loadSettings
</methodname>
loads these settings again. A
<methodname>
main
</methodname>
method constructs a Spring application context, and calls these two methods.
<methodname>
main
</methodname>
method constructs a Spring application context, and calls these two methods.
<programlisting>
<![CDATA[
<programlisting
language=
"java"
>
<![CDATA[
import java.io.FileInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.IOException;
...
@@ -284,7 +284,7 @@ public class Application {
...
@@ -284,7 +284,7 @@ public class Application {
The
<classname>
Application
</classname>
requires both a
<property>
marshaller
</property>
The
<classname>
Application
</classname>
requires both a
<property>
marshaller
</property>
and
<property>
unmarshaller
</property>
property to be set. We can do so using the following
and
<property>
unmarshaller
</property>
property to be set. We can do so using the following
<filename>
applicationContext.xml
</filename>
:
<filename>
applicationContext.xml
</filename>
:
<programlisting>
<![CDATA[
<programlisting
language=
"xml"
>
<![CDATA[
<beans>
<beans>
<bean
id=
"application"
class=
"Application"
>
<bean
id=
"application"
class=
"Application"
>
<property
name=
"marshaller"
ref=
"castorMarshaller"
/>
<property
name=
"marshaller"
ref=
"castorMarshaller"
/>
...
@@ -302,7 +302,7 @@ public class Application {
...
@@ -302,7 +302,7 @@ public class Application {
</para>
</para>
<para>
<para>
This sample application produces the following
<filename>
settings.xml
</filename>
file:
This sample application produces the following
<filename>
settings.xml
</filename>
file:
<programlisting>
<![CDATA[
<programlisting
language=
"xml"
>
<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<settings
foo-enabled=
"false"
/>
<settings
foo-enabled=
"false"
/>
]]>
</programlisting>
]]>
</programlisting>
...
@@ -315,7 +315,7 @@ public class Application {
...
@@ -315,7 +315,7 @@ public class Application {
To make these tags available, the appropriate schema has to be referenced first in the preamble of the XML configuration file.
To make these tags available, the appropriate schema has to be referenced first in the preamble of the XML configuration file.
The emboldened text in the below snippet references the OXM schema:
The emboldened text in the below snippet references the OXM schema:
</para>
</para>
<programlisting>
<![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<programlisting
language=
"xml"
>
<![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
]]
><emphasis
role=
"bold"
>
<![CDATA[xmlns:oxm="http://www.springframework.org/schema/oxm"]]>
</emphasis>
]]
><emphasis
role=
"bold"
>
<![CDATA[xmlns:oxm="http://www.springframework.org/schema/oxm"]]>
</emphasis>
...
@@ -342,7 +342,7 @@ public class Application {
...
@@ -342,7 +342,7 @@ public class Application {
Each tag will be explained in its respective marshaller's section. As an example though, here is how
Each tag will be explained in its respective marshaller's section. As an example though, here is how
the configuration of a JAXB2 marshaller might look like:
the configuration of a JAXB2 marshaller might look like:
</para>
</para>
<programlisting>
<![CDATA[<oxm:jaxb2-marshaller id="marshaller" contextPath="org.springframework.ws.samples.airline.schema"/>]]>
</programlisting>
<programlisting
language=
"xml"
>
<![CDATA[<oxm:jaxb2-marshaller id="marshaller" contextPath="org.springframework.ws.samples.airline.schema"/>]]>
</programlisting>
</section>
</section>
<section
id=
"oxm-jaxb"
>
<section
id=
"oxm-jaxb"
>
<title>
JAXB
</title>
<title>
JAXB
</title>
...
@@ -368,7 +368,7 @@ public class Application {
...
@@ -368,7 +368,7 @@ public class Application {
classes to be supported by the marshaller. Schema validation is performed by specifying one or more
classes to be supported by the marshaller. Schema validation is performed by specifying one or more
schema resource to the bean, like so:
schema resource to the bean, like so:
</para>
</para>
<programlisting>
<![CDATA[
<programlisting
language=
"xml"
>
<![CDATA[
<beans>
<beans>
<bean
id=
"jaxb2Marshaller"
class=
"org.springframework.oxm.jaxb.Jaxb2Marshaller"
>
<bean
id=
"jaxb2Marshaller"
class=
"org.springframework.oxm.jaxb.Jaxb2Marshaller"
>
...
@@ -389,11 +389,11 @@ public class Application {
...
@@ -389,11 +389,11 @@ public class Application {
The
<literal>
jaxb2-marshaller
</literal>
tag configures a
<classname>
org.springframework.oxm.jaxb.Jaxb2Marshaller
</classname>
.
The
<literal>
jaxb2-marshaller
</literal>
tag configures a
<classname>
org.springframework.oxm.jaxb.Jaxb2Marshaller
</classname>
.
Here is an example:
Here is an example:
</para>
</para>
<programlisting>
<![CDATA[<oxm:jaxb2-marshaller id="marshaller" contextPath="org.springframework.ws.samples.airline.schema"/>]]>
</programlisting>
<programlisting
language=
"xml"
>
<![CDATA[<oxm:jaxb2-marshaller id="marshaller" contextPath="org.springframework.ws.samples.airline.schema"/>]]>
</programlisting>
<para>
<para>
Alternatively, the list of classes to bind can be provided to the marshaller via the
<literal>
class-to-be-bound
</literal>
child tag:
Alternatively, the list of classes to bind can be provided to the marshaller via the
<literal>
class-to-be-bound
</literal>
child tag:
</para>
</para>
<programlisting>
<![CDATA[<oxm:jaxb2-marshaller id="marshaller">
<programlisting
language=
"xml"
>
<![CDATA[<oxm:jaxb2-marshaller id="marshaller">
<oxm:class-to-be-bound
name=
"org.springframework.ws.samples.airline.schema.Airport"
/>
<oxm:class-to-be-bound
name=
"org.springframework.ws.samples.airline.schema.Airport"
/>
<oxm:class-to-be-bound
name=
"org.springframework.ws.samples.airline.schema.Flight"
/>
<oxm:class-to-be-bound
name=
"org.springframework.ws.samples.airline.schema.Flight"
/>
...
...
...
@@ -450,7 +450,7 @@ public class Application {
...
@@ -450,7 +450,7 @@ public class Application {
<interfacename>
Marshaller
</interfacename>
and
<interfacename>
Unmarshaller
</interfacename>
interface.
<interfacename>
Marshaller
</interfacename>
and
<interfacename>
Unmarshaller
</interfacename>
interface.
It can be wired up as follows:
It can be wired up as follows:
</para>
</para>
<programlisting>
<![CDATA[
<programlisting
language=
"xml"
>
<![CDATA[
<beans>
<beans>
<bean
id=
"castorMarshaller"
class=
"org.springframework.oxm.castor.CastorMarshaller"
/>
<bean
id=
"castorMarshaller"
class=
"org.springframework.oxm.castor.CastorMarshaller"
/>
...
@@ -469,7 +469,7 @@ public class Application {
...
@@ -469,7 +469,7 @@ public class Application {
The mapping can be set using the
<property>
mappingLocation
</property>
resource property, indicated
The mapping can be set using the
<property>
mappingLocation
</property>
resource property, indicated
below with a classpath resource.
below with a classpath resource.
</para>
</para>
<programlisting>
<![CDATA[
<programlisting
language=
"xml"
>
<![CDATA[
<beans>
<beans>
<bean
id=
"castorMarshaller"
class=
"org.springframework.oxm.castor.CastorMarshaller"
>
<bean
id=
"castorMarshaller"
class=
"org.springframework.oxm.castor.CastorMarshaller"
>
<property
name=
"mappingLocation"
value=
"classpath:mapping.xml"
/>
<property
name=
"mappingLocation"
value=
"classpath:mapping.xml"
/>
...
@@ -500,7 +500,7 @@ public class Application {
...
@@ -500,7 +500,7 @@ public class Application {
and
<interfacename>
Unmarshaller
</interfacename>
and
<interfacename>
Unmarshaller
</interfacename>
interfaces. It can be configured as follows:
interfaces. It can be configured as follows:
</para>
</para>
<programlisting>
<![CDATA[
<programlisting
language=
"xml"
>
<![CDATA[
<beans>
<beans>
<bean
id=
"xmlBeansMarshaller"
class=
"org.springframework.oxm.xmlbeans.XmlBeansMarshaller"
/>
<bean
id=
"xmlBeansMarshaller"
class=
"org.springframework.oxm.xmlbeans.XmlBeansMarshaller"
/>
...
@@ -520,7 +520,7 @@ public class Application {
...
@@ -520,7 +520,7 @@ public class Application {
The
<literal>
xmlbeans-marshaller
</literal>
tag configures a
<classname>
org.springframework.oxm.xmlbeans.XmlBeansMarshaller
</classname>
.
The
<literal>
xmlbeans-marshaller
</literal>
tag configures a
<classname>
org.springframework.oxm.xmlbeans.XmlBeansMarshaller
</classname>
.
Here is an example:
Here is an example:
</para>
</para>
<programlisting>
<![CDATA[<oxm:xmlbeans-marshaller id="marshaller"/>]]>
</programlisting>
<programlisting
language=
"xml"
>
<![CDATA[<oxm:xmlbeans-marshaller id="marshaller"/>]]>
</programlisting>
<para>
<para>
Available attributes are:
Available attributes are:
<informaltable>
<informaltable>
...
@@ -580,7 +580,7 @@ public class Application {
...
@@ -580,7 +580,7 @@ public class Application {
<property>
bindingName
</property>
property. In the next sample, we bind the
<property>
bindingName
</property>
property. In the next sample, we bind the
<classname>
Flights
</classname>
class:
<classname>
Flights
</classname>
class:
</para>
</para>
<programlisting>
<![CDATA[
<programlisting
language=
"xml"
>
<![CDATA[
<beans>
<beans>
<bean
id=
"jibxFlightsMarshaller"
class=
"org.springframework.oxm.jibx.JibxMarshaller"
>
<bean
id=
"jibxFlightsMarshaller"
class=
"org.springframework.oxm.jibx.JibxMarshaller"
>
...
@@ -600,7 +600,7 @@ public class Application {
...
@@ -600,7 +600,7 @@ public class Application {
The
<literal>
jibx-marshaller
</literal>
tag configures a
<classname>
org.springframework.oxm.jibx.JibxMarshaller
</classname>
.
The
<literal>
jibx-marshaller
</literal>
tag configures a
<classname>
org.springframework.oxm.jibx.JibxMarshaller
</classname>
.
Here is an example:
Here is an example:
</para>
</para>
<programlisting>
<![CDATA[<oxm:jibx-marshaller id="marshaller" target-class="org.springframework.ws.samples.airline.schema.Flight"/>]]>
</programlisting>
<programlisting
language=
"xml"
>
<![CDATA[<oxm:jibx-marshaller id="marshaller" target-class="org.springframework.ws.samples.airline.schema.Flight"/>]]>
</programlisting>
<para>
<para>
Available attributes are:
Available attributes are:
<informaltable>
<informaltable>
...
@@ -656,7 +656,7 @@ public class Application {
...
@@ -656,7 +656,7 @@ public class Application {
in an application context directly. To further customize the XML, you can set an
in an application context directly. To further customize the XML, you can set an
<emphasis>
alias map
</emphasis>
, which consists of string aliases mapped to classes:
<emphasis>
alias map
</emphasis>
, which consists of string aliases mapped to classes:
</para>
</para>
<programlisting>
<![CDATA[
<programlisting
language=
"xml"
>
<![CDATA[
<beans>
<beans>
<bean
id=
"xstreamMarshaller"
class=
"org.springframework.oxm.xstream.XStreamMarshaller"
>
<bean
id=
"xstreamMarshaller"
class=
"org.springframework.oxm.xstream.XStreamMarshaller"
>
...
...
spring-framework-reference/src/transaction.xml
浏览文件 @
f4b4f28f
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录