本文整理匯總了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;
}