本文整理汇总了Java中ma.glasnost.orika.MapperFacade类的典型用法代码示例。如果您正苦于以下问题:Java MapperFacade类的具体用法?Java MapperFacade怎么用?Java MapperFacade使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MapperFacade类属于ma.glasnost.orika包,在下文中一共展示了MapperFacade类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMapperFacade
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
private MapperFacade getMapperFacade() {
return mapperFactory.getMapperFacade();
}
示例2: mapperFacade
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
@Bean
MapperFacade mapperFacade() {
return new InsuranceHateoasMapper();
}
示例3: HistoryDownloader
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
public HistoryDownloader(Arguments arguments, MapperFacade mapper) {
this.arguments = arguments;
this.mapper = mapper;
this.apiClient = new LimitedApiClient(arguments.getToken());
this.apiExtensions = new ApiExtensions(this.apiClient, mapper);
}
示例4: getObject
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
public MapperFacade getObject() throws Exception {
MapperFactory mapperFactory = new DefaultMapperFactory.Builder()
.classMapBuilderFactory(new AnnotationClassMapBuilder.Factory())
.build();
mapperFactory.getConverterFactory().registerConverter(new PassThroughConverter(org.joda.time.DateTime.class));
// mapperFactory.registerClassMap(
// mapperFactory.classMap(ComplexCriterion.class, gov.va.vba.persistence.entity.ComplexCriterion.class)
// .field("criteria", "simpleCriteria")
// .byDefault()
// .toClassMap()
// );
return mapperFactory.getMapperFacade();
}
示例5: getObjectType
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
public Class<?> getObjectType() {
return MapperFacade.class;
}
示例6: getFascade
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
public MapperFacade getFascade() {
return mapperFactory.getMapperFacade();
}
示例7: mapper
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
protected MapperFacade mapper(){
return mapperFactory.getFascade();
}
示例8: beanMapper
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
@Bean
MapperFacade beanMapper() {
return new DefaultMapperFactory.Builder().build().getMapperFacade();
}
示例9: ApiExtensions
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
public ApiExtensions(IApiClient client, MapperFacade mapper) {
this.client = client;
this.mapper = mapper;
}
示例10: getMapper
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
@Override
public MapperFacade getMapper() {
return getFactory().getMapperFacade();
}
示例11: list
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
/**
* General convert method, it will convert VO to RO without any other logic
*
* @param vo converted object
* @param clazz class of converted object
* @param <I> Generic class of input
* @param <O> Generic class of output
* @return converted object
*/
public <I, O> O list(final I vo, Class<O> clazz) {
MapperFacade mapper = mapperFactory.getMapperFacade();
return mapper.map(vo, clazz);
}
示例12: convert
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
/**
* eneral convert method, it will convert list VO to list RO without any other logic
*
* @param vos list of converted object
* @param clazz class of converted object
* @param <I> Generic class of input
* @param <O> Generic class of output
* @return converted object
*/
public <I, O> List<O> convert(final Iterable<I> vos, Class<O> clazz) {
MapperFacade mapper = mapperFactory.getMapperFacade();
return mapper.mapAsList(vos, clazz);
}
示例13: doMapping
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private <From, To> To doMapping(final Class<To> toClass, From from, String mappingName, MappingType mappingType, boolean beenMappedWithOrika, To to) {
CustomMappingWrapper.Orika orikaOverrideSetting = CustomMappingWrapper.Orika.DEFAULT;
if (from == null) return null;
if (from instanceof CustomMappingWrapper) {
CustomMappingWrapper cmo = (CustomMappingWrapper) from;
from = (From)cmo.getObject();
mappingType = cmo.getMappingType();
mappingName = cmo.getMappingName();
orikaOverrideSetting = cmo.getOrika();
if (from == null) return null;
}
Class fromClass = from.getClass();
boolean mappedWithOrika = false;
if (orikaOverrideSetting == CustomMappingWrapper.Orika.FORCE_ON || (orikaOverrideSetting == CustomMappingWrapper.Orika.DEFAULT && (!beenMappedWithOrika && autoMapUsingOrika))) {
//TODO move to cache
MapperFacade orikaMapper;
if (!mapperFactory.existsRegisteredMapper(TypeFactory.valueOf(from.getClass()), TypeFactory.valueOf(toClass), false)) {
mapperFactory.classMap(fromClass, toClass)
.byDefault().register();
}
orikaMapper = mapperFactory.getMapperFacade();
to = orikaMapper.map(from, toClass);
beenMappedWithOrika = true;
mappedWithOrika = true;
}
if (to == null) {
try {
to = toClass.newInstance();
} catch (IllegalAccessException | InstantiationException e) {
throw new RuntimeException("Error creating instace of " + toClass, e);
}
}
doAudibleMapping(toClass, from, mappingName, mappingType, fromClass, to, beenMappedWithOrika, mappedWithOrika);
handlePostProcessor(to, toClass, from, mappingName);
return to;
}
示例14: getMapper
import ma.glasnost.orika.MapperFacade; //导入依赖的package包/类
public MapperFacade getMapper();