6 changed files with 161 additions and 36 deletions
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
/* |
||||
* Copyright 2002-2011 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.oxm.config; |
||||
|
||||
import org.w3c.dom.Element; |
||||
|
||||
import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser; |
||||
|
||||
/** |
||||
* Parser for the <code><oxm:castor-marshaller/></code> element. |
||||
* |
||||
* @author Jakub Narloch |
||||
* @since 3.1 |
||||
*/ |
||||
public class CastorMarshallerBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser { |
||||
|
||||
private static final String CASTOR_MARSHALLER_CLASS_NAME = "org.springframework.oxm.castor.CastorMarshaller"; |
||||
|
||||
@Override |
||||
protected String getBeanClassName(Element element) { |
||||
return CASTOR_MARSHALLER_CLASS_NAME; |
||||
} |
||||
} |
@ -1,23 +1,38 @@
@@ -1,23 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xmlns:oxm="http://www.springframework.org/schema/oxm" |
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd |
||||
http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd"> |
||||
<!--<oxm:jibx-marshaller id="jibxMarshaller" target-class="org.springframework.oxm.jibx.Flights"/>--> |
||||
<oxm:xmlbeans-marshaller id="xmlBeansMarshaller" options="xmlBeansOptions"/> |
||||
|
||||
<bean id="xmlBeansOptions" class="org.springframework.oxm.xmlbeans.XmlOptionsFactoryBean"> |
||||
<property name="options"> |
||||
<props> |
||||
<prop key="SAVE_PRETTY_PRINT">true</prop> |
||||
</props> |
||||
</property> |
||||
</bean> |
||||
|
||||
<oxm:jaxb2-marshaller id="contextPathMarshaller" contextPath="org.springframework.oxm.jaxb.test"/> |
||||
<oxm:jaxb2-marshaller id="classesMarshaller"> |
||||
<oxm:class-to-be-bound name="org.springframework.oxm.jaxb.test.Flights"/> |
||||
<oxm:class-to-be-bound name="org.springframework.oxm.jaxb.test.FlightType"/> |
||||
<beans xmlns="http://www.springframework.org/schema/beans" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oxm="http://www.springframework.org/schema/oxm" |
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd |
||||
http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.1.xsd"> |
||||
|
||||
<!-- XMLBeans --> |
||||
<oxm:xmlbeans-marshaller id="xmlBeansMarshaller" |
||||
options="xmlBeansOptions" /> |
||||
|
||||
<bean id="xmlBeansOptions" class="org.springframework.oxm.xmlbeans.XmlOptionsFactoryBean"> |
||||
<property name="options"> |
||||
<props> |
||||
<prop key="SAVE_PRETTY_PRINT">true</prop> |
||||
</props> |
||||
</property> |
||||
</bean> |
||||
|
||||
<!-- JAXB2 --> |
||||
<oxm:jaxb2-marshaller id="jaxb2ContextPathMarshaller" |
||||
contextPath="org.springframework.oxm.jaxb.test" /> |
||||
|
||||
<oxm:jaxb2-marshaller id="jaxb2ClassesMarshaller"> |
||||
<oxm:class-to-be-bound name="org.springframework.oxm.jaxb.test.Flights" /> |
||||
<oxm:class-to-be-bound name="org.springframework.oxm.jaxb.test.FlightType" /> |
||||
</oxm:jaxb2-marshaller> |
||||
|
||||
<!-- Castor --> |
||||
|
||||
<oxm:castor-marshaller id="castorEncodingMarshaller" encoding="ISO-8859-1" /> |
||||
|
||||
<oxm:castor-marshaller id="castorTargetClassMarshaller" target-class="org.springframework.oxm.castor.Flight" /> |
||||
|
||||
<oxm:castor-marshaller id="castorTargetPackageMarshaller" target-package="org.springframework.oxm.castor" /> |
||||
|
||||
<oxm:castor-marshaller id="castorMappingLocationMarshaller" |
||||
mapping-location="classpath:org/springframework/oxm/castor/mapping.xml" /> |
||||
</beans> |
||||
|
Loading…
Reference in new issue