本文整理汇总了Java中org.dozer.DozerBeanMapper.setMappingFiles方法的典型用法代码示例。如果您正苦于以下问题:Java DozerBeanMapper.setMappingFiles方法的具体用法?Java DozerBeanMapper.setMappingFiles怎么用?Java DozerBeanMapper.setMappingFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dozer.DozerBeanMapper
的用法示例。
在下文中一共展示了DozerBeanMapper.setMappingFiles方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mapper
import org.dozer.DozerBeanMapper; //导入方法依赖的package包/类
@Bean
public DozerBeanMapper mapper() {
final DozerBeanMapper dozerBeanMapper = new DozerBeanMapper();
dozerBeanMapper.setMappingFiles(Collections.singletonList("dozerJdk8Converters.xml"));
dozerBeanMapper.addMapping(new StockToStockDtoMapping());
return dozerBeanMapper;
}
示例2: DozerBean
import org.dozer.DozerBeanMapper; //导入方法依赖的package包/类
public DozerBean(List<String> mappingFiles) {
dozer = new DozerBeanMapper();
if(mappingFiles!=null){
mappingFiles.add(0, GLOBAL_CONFIG);
}else{
mappingFiles = new ArrayList<String>(3);
mappingFiles.add(GLOBAL_CONFIG);
}
dozer.setMappingFiles(mappingFiles);
}
示例3: DozerTransformer
import org.dozer.DozerBeanMapper; //导入方法依赖的package包/类
/**
* Constructor.
* @param from From type.
* @param to To type.
* @param config config.
*/
protected DozerTransformer(final QName from, final QName to, List<String> configs) {
super(from, to);
_dozerBeanMapper = new DozerBeanMapper();
if (configs != null && !configs.isEmpty()) {
_dozerBeanMapper.setMappingFiles(configs);
}
}
示例4: mapFromPerson
import org.dozer.DozerBeanMapper; //导入方法依赖的package包/类
public static PersonBean mapFromPerson(Person sourceObject) {
List<String> myMappingFiles = new ArrayList<String>();
myMappingFiles.add("dozerMappings.xml");
DozerBeanMapper mapper = new DozerBeanMapper();
mapper.setMappingFiles(myMappingFiles);
System.out.println("Mapping Person to PersonBean...");
return (PersonBean) mapper.map(sourceObject, PersonBean.class);
}
示例5: mapToPerson
import org.dozer.DozerBeanMapper; //导入方法依赖的package包/类
public static Person mapToPerson(PersonBean sourceObject) {
List<String> myMappingFiles = new ArrayList<String>();
myMappingFiles.add("dozerMappings.xml");
DozerBeanMapper mapper = new DozerBeanMapper();
mapper.setMappingFiles(myMappingFiles);
System.out.println("Mapping PersonBean to Person...");
return (Person) mapper.map(sourceObject, Person.class);
}
示例6: mapFromPerson
import org.dozer.DozerBeanMapper; //导入方法依赖的package包/类
public static PersonAnnotationBean mapFromPerson(Person sourceObject) {
List<String> myMappingFiles = new ArrayList<String>();
myMappingFiles.add("dozerMappings.xml");
DozerBeanMapper mapper = new DozerBeanMapper();
mapper.setMappingFiles(myMappingFiles);
System.out.println("Mapping Person to PersonAnnotationBean...");
return (PersonAnnotationBean) mapper.map(sourceObject, PersonAnnotationBean.class);
}
示例7: mapToPerson
import org.dozer.DozerBeanMapper; //导入方法依赖的package包/类
public static Person mapToPerson(PersonAnnotationBean sourceObject) {
List<String> myMappingFiles = new ArrayList<String>();
myMappingFiles.add("dozerMappings.xml");
DozerBeanMapper mapper = new DozerBeanMapper();
mapper.setMappingFiles(myMappingFiles);
System.out.println("Mapping PersonAnnotationBean to Person...");
return (Person) mapper.map(sourceObject, Person.class);
}
示例8: createMapper
import org.dozer.DozerBeanMapper; //导入方法依赖的package包/类
/**
* Creates and configures a bean mapper
*
* @return the configured mapper object
*/
public static Mapper createMapper()
{
// create a new dozer mapper
DozerBeanMapper mapper = new DozerBeanMapper();
// set the mapping files for this mapper
mapper.setMappingFiles(Arrays.asList(MAPPING_FILES));
return mapper;
}
示例9: mapper
import org.dozer.DozerBeanMapper; //导入方法依赖的package包/类
@Bean
DozerBeanMapper mapper() {
DozerBeanMapper dozerBeanMapper = new DozerBeanMapper();
dozerBeanMapper.setMappingFiles(Arrays.asList("dozer/domain-mapping.xml"));
return dozerBeanMapper;
}