本文整理汇总了Java中org.springframework.oxm.jaxb.Jaxb2Marshaller.setPackagesToScan方法的典型用法代码示例。如果您正苦于以下问题:Java Jaxb2Marshaller.setPackagesToScan方法的具体用法?Java Jaxb2Marshaller.setPackagesToScan怎么用?Java Jaxb2Marshaller.setPackagesToScan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.oxm.jaxb.Jaxb2Marshaller
的用法示例。
在下文中一共展示了Jaxb2Marshaller.setPackagesToScan方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: GOClient
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Builder
private GOClient(
@NonNull final GOClientConfig config,
final GOClientLogger goClientLogger)
{
this.config = config;
this.goClientLogger = goClientLogger != null ? goClientLogger : SLF4JGOClientLogger.instance;
final HttpComponentsMessageSender messageSender = createMessageSender(config.getAuthUsername(), config.getAuthPassword());
final Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setPackagesToScan(de.metas.shipper.gateway.go.schema.ObjectFactory.class.getPackage().getName());
webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setDefaultUri(config.getUrl());
webServiceTemplate.setMessageSender(messageSender);
webServiceTemplate.setMarshaller(marshaller);
webServiceTemplate.setUnmarshaller(marshaller);
}
示例3: 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;
}
}
示例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;
fetchMarshalAndSerialize(com.genologics.ri.exception.Exception.class);
}
finally
{
marshaller = original;
}
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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);
}
}
示例10: instanciateMarshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
/**
* Crea un nuevo marhsaller.
*
* @param packagesFound
* lista de paquetes.
* @return
*/
private Jaxb2Marshaller instanciateMarshaller(List<String> packagesFound) {
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
String[] packages = packagesFound.toArray(new String[0]);
log.info("Add packages to the marshaller {}: ",
new Object[] { packages });
marshaller.setPackagesToScan(packages);
return marshaller;
}
示例11: formMarshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Bean
Jaxb2Marshaller formMarshaller(CalendarAdapter calendarAdapter) {
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setPackagesToScan(FORM_PKG);
marshaller.setAdapters(calendarAdapter);
return marshaller;
}
示例12: createNewMarshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
public static Jaxb2Marshaller createNewMarshaller() {
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setPackagesToScan(
packageName(StandardBusinessDocument.class),
packageName(Envelope.class),
packageName(org.w3.soap.Envelope.class),
packageName(org.w3.xmldsig.Reference.class),
packageName(Messaging.class),
packageName(NonRepudiationInformation.class),
packageName(SDPKvittering.class),
packageName(XAdESSignatures.class),
packageName(QualifyingProperties.class));
marshaller.setSchemas(Schemas.allSchemaResources());
return marshaller;
}
示例13: createMarshaller
import org.springframework.oxm.jaxb.Jaxb2Marshaller; //导入方法依赖的package包/类
@Bean
public Jaxb2Marshaller createMarshaller() {
final Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setPackagesToScan(new String[]{"com.captechconsulting.webservice.generated.packages"});
return marshaller;
}