• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Type类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中ma.glasnost.orika.metadata.Type的典型用法代码示例。如果您正苦于以下问题:Java Type类的具体用法?Java Type怎么用?Java Type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Type类属于ma.glasnost.orika.metadata包,在下文中一共展示了Type类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: shouldMap

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
@Override
public <S, D> boolean shouldMap(Type<S> type, String s, S s1, Type<D> type1, String s2, D d,
    MappingContext mappingContext) {
  if (type != null && s1 != null) {
    if (type.isCollection()) {
      if (s1 instanceof AbstractPersistentCollection) {
        return false;
      }

      if (((PersistentSet) s1).wasInitialized()) {
        return false;
      }
    }
  }

  return true;
}
 
开发者ID:empt-ak,项目名称:meditor,代码行数:18,代码来源:OrikaHibernateFilter.java


示例2: MappingBuilder

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
public MappingBuilder(MapperFactory mapperFactory, Type<?> sourceType, Type<?> destinationType, ApplicationContext applicationContext) {
    this.sourceType = sourceType;
    this.destinationType = destinationType;
    this.mapperFactory = mapperFactory;
    this.sourceClass = this.sourceType.getRawType();
    this.destinationClass = this.destinationType.getRawType();
    this.buildMapping();
    this.buildConverts();
    this.applicationContext = applicationContext;
}
 
开发者ID:yjy8749,项目名称:orika-mapper,代码行数:11,代码来源:MappingBuilder.java


示例3: addMappingIfNotRegistered

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
private void addMappingIfNotRegistered(Type<?> sourceType, Type<?> destinationType){

        if(!this.mapperFactory.existsRegisteredMapper(sourceType,destinationType,true)){
            synchronized (mapperBuildLock){
                if(!this.mapperFactory.existsRegisteredMapper(sourceType,destinationType,true)) {
                    new MappingBuilder(this.mapperFactory, sourceType, destinationType,applicationContext).build();
                }
            }
        }

    }
 
开发者ID:yjy8749,项目名称:orika-mapper,代码行数:12,代码来源:Mapper.java


示例4: map

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
@Override
public <S, D> void map(S sourceObject, D destinationObject, Type<S> sourceType, Type<D> destinationType) {
    if(sourceObject==null){
        return;
    }
    addMappingIfNotRegistered(sourceType,destinationType);
    this.mapper.map(sourceObject,destinationObject,sourceType,destinationType);
}
 
开发者ID:yjy8749,项目名称:orika-mapper,代码行数:9,代码来源:Mapper.java


示例5: mapAsSet

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
@Override
public <S, D> Set<D> mapAsSet(Iterable<S> source, Type<S> sourceType, Type<D> destinationType) {
    Class<S> elclass = this.getElementClass(source);
    if(elclass==null){
        return new HashSet<D>();
    }
    addMappingIfNotRegistered(sourceType,destinationType);
    return this.mapper.mapAsSet(source,sourceType,destinationType);
}
 
开发者ID:yjy8749,项目名称:orika-mapper,代码行数:10,代码来源:Mapper.java


示例6: mapAsList

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
@Override
public <S, D> List<D> mapAsList(Iterable<S> source, Type<S> sourceType, Type<D> destinationType) {
    Class<S> elclass = this.getElementClass(source);
    if(elclass==null){
        return new ArrayList<D>();
    }
    addMappingIfNotRegistered(sourceType,destinationType);
    return this.mapper.mapAsList(source,sourceType,destinationType);
}
 
开发者ID:yjy8749,项目名称:orika-mapper,代码行数:10,代码来源:Mapper.java


示例7: mapAsArray

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
@Override
public <S, D> D[] mapAsArray(D[] destination, Iterable<S> source, Type<S> sourceType, Type<D> destinationType) {
    Class<S> elclass = this.getElementClass(source);
    if(elclass==null){
        return (D[]) new Object[1];
    }
    addMappingIfNotRegistered(sourceType,destinationType);
    return this.mapper.mapAsArray(destination,source,sourceType,destinationType);
}
 
开发者ID:yjy8749,项目名称:orika-mapper,代码行数:10,代码来源:Mapper.java


示例8: mapAsCollection

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
@Override
public <S, D> void mapAsCollection(Iterable<S> source, Collection<D> destination, Type<S> sourceType, Type<D> destinationType) {
    Class<S> elclass = this.getElementClass(source);
    if(elclass==null){
        return;
    }
    addMappingIfNotRegistered(sourceType,destinationType);
    this.mapper.mapAsCollection(source,destination,sourceType,destinationType);
}
 
开发者ID:yjy8749,项目名称:orika-mapper,代码行数:10,代码来源:Mapper.java


示例9: convert

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
@Override
public <S, D> D convert(S source, Type<S> sourceType, Type<D> destinationType, String converterId) {
    if(source==null){
        return null;
    }
    addMappingIfNotRegistered(sourceType,destinationType);
    return this.mapper.convert(source,sourceType,destinationType,converterId);
}
 
开发者ID:yjy8749,项目名称:orika-mapper,代码行数:9,代码来源:Mapper.java


示例10: mapAsMap

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
@Override
public <Sk, Sv, Dk, Dv> Map<Dk, Dv> mapAsMap(Map<Sk, Sv> source, Type<? extends Map<Sk, Sv>> sourceType, Type<? extends Map<Dk, Dv>> destinationType) {
    if(source==null){
        return null;
    }
    addMappingIfNotRegistered(sourceType,destinationType);
    return this.mapper.mapAsMap(source,sourceType,destinationType);
}
 
开发者ID:yjy8749,项目名称:orika-mapper,代码行数:9,代码来源:Mapper.java


示例11: newObject

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
@Override
public <S, D> D newObject(S source, Type<? extends D> destinationType, MappingContext context) {
    if(source==null){
        return null;
    }
    addMappingIfNotRegistered(TypeFactory.valueOf(source.getClass()),destinationType);
    return this.mapper.newObject(source,destinationType,context);
}
 
开发者ID:yjy8749,项目名称:orika-mapper,代码行数:9,代码来源:Mapper.java


示例12: convert

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
@Override
public BasicInfo convert(BasicInfo source, Type<? extends BasicInfo> destinationType, MappingContext mappingContext) {
    if (source == null) {
        return null;
    }

    return new BasicInfo(source.getKeyword(), source.getName(), source.getArguments());
}
 
开发者ID:pgentile,项目名称:zucchini-ui,代码行数:9,代码来源:BasicInfoConverter.java


示例13: ClonerConverter

import ma.glasnost.orika.metadata.Type; //导入依赖的package包/类
/**
 * Constructs a new ClonerConverter configured to handle the provided list of types by
 * cloning.
 * @param cloneStrategy Strategy to be used
 * @param types one or more types that should be copied using the ClonerConverter
 */
public ClonerConverter(CloneStrategy cloneStrategy, java.lang.reflect.Type... types) {

    this.cloner = new BasicCloner(cloneStrategy);

    if (types.length == 0) {
        this.types = null;
    }
    for (java.lang.reflect.Type type : types) {
        this.types.add(TypeFactory.valueOf(type));
    }
}
 
开发者ID:JadiraOrg,项目名称:jadira,代码行数:18,代码来源:ClonerConverter.java



注:本文中的ma.glasnost.orika.metadata.Type类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UserModel类代码示例发布时间:2022-05-22
下一篇:
Java SVNErrorMessage类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap