本文整理汇总了Java中org.springframework.oxm.jaxb.Jaxb2Marshaller.setMarshallerProperties方法的典型用法代码示例。如果您正苦于以下问题:Java Jaxb2Marshaller.setMarshallerProperties方法的具体用法?Java Jaxb2Marshaller.setMarshallerProperties怎么用?Java Jaxb2Marshaller.setMarshallerProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.oxm.jaxb.Jaxb2Marshaller
的用法示例。
在下文中一共展示了Jaxb2Marshaller.setMarshallerProperties方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: lukeMooselikeharvestsExportJaxbMarshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Bean(name = "lukeMooselikeharvestsExportMarshaller")
public Jaxb2Marshaller lukeMooselikeharvestsExportJaxbMarshaller() {
final Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setMarshallerProperties(getMarshallerDefaultProperties());
marshaller.setContextPath("fi.riista.integration.luke_export.mooselikeharvests");
marshaller.setSchema(new ClassPathResource("/xsd/luke/export-mooselikeharvests-v1.xsd"));
return activateLoggingValidation(marshaller);
}
示例2: castorMarshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Bean
public Jaxb2Marshaller castorMarshaller() {
Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setPackagesToScan("org.sitenv.service.ccda.smartscorecard.cofiguration");
Map<String,Object> map = new HashMap<>();
map.put("jaxb.formatted.output", true);
jaxb2Marshaller.setMarshallerProperties(map);
return jaxb2Marshaller;
}
示例3: getMarshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Bean
public Jaxb2Marshaller getMarshaller() {
Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setClassesToBeBound(Kml.class);
final Map<String,Object> map = new HashMap<>();
map.put("jaxb.formatted.output", true);
jaxb2Marshaller.setMarshallerProperties(map);
return jaxb2Marshaller;
}
示例4: testExceptionSimple
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void testExceptionSimple() throws Throwable
{
// Cannot use configured because of aspects.
Jaxb2Marshaller exceptionMarshaller = new Jaxb2Marshaller();
exceptionMarshaller.setPackagesToScan(new String[] { "com.genologics.ri.exception" });
exceptionMarshaller.setMarshallerProperties(context.getBean("genologicsJaxbMarshallerProperties", Map.class));
Jaxb2Marshaller original = marshaller;
try
{
marshaller = exceptionMarshaller;
fetchMarshalAndCompare(com.genologics.ri.exception.Exception.class);
}
finally
{
marshaller = original;
}
}
示例5: testExceptionSimple
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void testExceptionSimple() throws Throwable
{
// Cannot use configured because of aspects.
Jaxb2Marshaller exceptionMarshaller = new Jaxb2Marshaller();
exceptionMarshaller.setPackagesToScan(new String[] { "com.genologics.ri.exception" });
exceptionMarshaller.setMarshallerProperties(context.getBean("genologicsJaxbMarshallerProperties", Map.class));
Jaxb2Marshaller original = marshaller;
try
{
marshaller = exceptionMarshaller;
fetchMarshalAndSerialize(com.genologics.ri.exception.Exception.class);
}
finally
{
marshaller = original;
}
}
示例6: lupaHallintaExportJaxbMarshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Bean(name = "lupaHallintaExportMarshaller")
public Jaxb2Marshaller lupaHallintaExportJaxbMarshaller() {
final Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setMarshallerProperties(getMarshallerDefaultProperties());
marshaller.setPackagesToScan("fi.riista.integration.lupahallinta.model");
marshaller.setSchema(new ClassPathResource("/xsd/lupahallinta/LupaHallintaExport.xsd"));
return marshaller;
}
示例7: lupaHallintaPermitAreaExportJaxbMarshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Bean(name = "lupaHallintaPermitAreaExportMarshaller")
public Jaxb2Marshaller lupaHallintaPermitAreaExportJaxbMarshaller() {
final Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setMarshallerProperties(getMarshallerDefaultProperties());
marshaller.setPackagesToScan("fi.riista.integration.lupahallinta.permitarea");
marshaller.setSchema(new ClassPathResource("/xsd/lupahallinta/PermitAreaExport.xsd"));
return marshaller;
}
示例8: mooseDataCardJaxbMarshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Bean(name = "mooseDataCardMarshaller")
public Jaxb2Marshaller mooseDataCardJaxbMarshaller() {
final Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setMarshallerProperties(getMarshallerDefaultProperties());
marshaller.setPackagesToScan("fi.riista.integration.luke_import.model.v1_0");
marshaller.setSchemas(
new ClassPathResource("/xsd/luke/FormData_v1.0.xsd"),
new ClassPathResource("/xsd/luke/Hirvitietokortti_v1.0.xsd"),
new ClassPathResource("/xsd/luke/AdditionalFormData_v1.0.xsd"));
return marshaller;
}
示例9: srvaRvrExportJaxbMarshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Bean(name = "srvaRvrExportMarshaller")
public Jaxb2Marshaller srvaRvrExportJaxbMarshaller() {
final Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setMarshallerProperties(getMarshallerDefaultProperties());
marshaller.setPackagesToScan("fi.riista.integration.srva.rvr");
marshaller.setSchema(new ClassPathResource("/xsd/srva/rvr/SrvaRvrExport.xsd"));
return marshaller;
}
示例10: jaxb2Marshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
/**
* Gets a new JAXB marshaller that is aware of our XSD and can perform schema validation. It is also aware of all our auto-generated classes that are in the
* org.finra.herd.model.api.xml package. Note that REST endpoints that use Java objects which are not in this package will not use this marshaller and will
* not get schema validated which is good since they don't have an XSD.
*
* @return the newly created JAXB marshaller.
*/
@Bean
public Jaxb2Marshaller jaxb2Marshaller()
{
try
{
// Create the marshaller that is aware of our Java XSD and it's auto-generated classes.
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setPackagesToScan("org.finra.herd.model.api.xml");
marshaller.setSchemas(resourceResolver.getResources("classpath:herd.xsd"));
// Get the JAXB XML headers from the environment.
String xmlHeaders = configurationHelper.getProperty(ConfigurationValue.JAXB_XML_HEADERS);
// We need to set marshaller properties to reconfigure the XML header.
Map<String, Object> marshallerProperties = new HashMap<>();
marshaller.setMarshallerProperties(marshallerProperties);
// Remove the header that JAXB will generate.
marshallerProperties.put(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
// Specify the new XML headers.
marshallerProperties.put(ConfigurationValue.JAXB_XML_HEADERS.getKey(), xmlHeaders);
// Specify a custom character escape handler to escape XML 1.1 restricted characters.
marshallerProperties.put(MarshallerProperties.CHARACTER_ESCAPE_HANDLER, herdCharacterEscapeHandler);
// Return the marshaller.
return marshaller;
}
catch (Exception ex)
{
// Throw a runtime exception instead of a checked IOException since the XSD file should be contained within our application.
throw new IllegalArgumentException("Unable to create marshaller.", ex);
}
}
示例11: taxiiStatusMarshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Bean
public Jaxb2Marshaller taxiiStatusMarshaller() {
Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setClassesToBeBound(TaxiiStatus.class);
jaxb2Marshaller.setMarshallerProperties(ImmutableMap.of(
javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, true));
return jaxb2Marshaller;
}