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

Java TypeBasedGuardingDynamicLinker类代码示例

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

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



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

示例1: computeValue

import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker; //导入依赖的package包/类
@SuppressWarnings("fallthrough")
@Override
protected List<TypeBasedGuardingDynamicLinker> computeValue(final Class<?> clazz) {
    List<TypeBasedGuardingDynamicLinker> list = NO_LINKER;
    for(int i = 0; i < linkers.length; ++i) {
        final TypeBasedGuardingDynamicLinker linker = linkers[i];
        if(linker.canLinkType(clazz)) {
            switch(list.size()) {
                case 0: {
                    list = singletonLinkers[i];
                    break;
                }
                case 1: {
                    list = new LinkedList<>(list);
                }
                default: {
                    list.add(linker);
                }
            }
        }
    }
    return list;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:CompositeTypeBasedGuardingDynamicLinker.java


示例2: addTypeBased

import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker; //导入依赖的package包/类
private static void addTypeBased(final List<GuardingDynamicLinker> llinkers,
        final List<TypeBasedGuardingDynamicLinker> tblinkers) {
    switch(tblinkers.size()) {
        case 0: {
            break;
        }
        case 1: {
            llinkers.addAll(tblinkers);
            tblinkers.clear();
            break;
        }
        default: {
            llinkers.add(new CompositeTypeBasedGuardingDynamicLinker(tblinkers));
            tblinkers.clear();
            break;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:CompositeTypeBasedGuardingDynamicLinker.java


示例3: computeValue

import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker; //导入依赖的package包/类
@Override
protected List<TypeBasedGuardingDynamicLinker> computeValue(Class<?> clazz) {
    List<TypeBasedGuardingDynamicLinker> list = NO_LINKER;
    for(int i = 0; i < linkers.length; ++i) {
        final TypeBasedGuardingDynamicLinker linker = linkers[i];
        if(linker.canLinkType(clazz)) {
            switch(list.size()) {
                case 0: {
                    list = singletonLinkers[i];
                    break;
                }
                case 1: {
                    list = new LinkedList<>(list);
                }
                //$FALL-THROUGH$
                default: {
                    list.add(linker);
                }
            }
        }
    }
    return list;
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:24,代码来源:CompositeTypeBasedGuardingDynamicLinker.java


示例4: addTypeBased

import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker; //导入依赖的package包/类
private static void addTypeBased(List<GuardingDynamicLinker> llinkers,
        List<TypeBasedGuardingDynamicLinker> tblinkers) {
    switch(tblinkers.size()) {
        case 0: {
            break;
        }
        case 1: {
            llinkers.addAll(tblinkers);
            tblinkers.clear();
            break;
        }
        default: {
            llinkers.add(new CompositeTypeBasedGuardingDynamicLinker(tblinkers));
            tblinkers.clear();
            break;
        }
    }
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:19,代码来源:CompositeTypeBasedGuardingDynamicLinker.java


示例5: computeValue

import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker; //导入依赖的package包/类
@Override
protected TypeBasedGuardingDynamicLinker computeValue(final Class<?> clazz) {
    // If ClassValue.put() were public, we could just pre-populate with these known mappings...
    return
        clazz == Class.class ? new ClassLinker() :
        clazz == StaticClass.class ? new StaticClassLinker() :
        DynamicMethod.class.isAssignableFrom(clazz) ? new DynamicMethodLinker() :
        new BeanLinker(clazz);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:BeansLinker.java


示例6: getReadableInstancePropertyNames

import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker; //导入依赖的package包/类
/**
 * Returns a collection of names of all readable instance properties of a class.
 * @param clazz the class
 * @return a collection of names of all readable instance properties of a class.
 */
public static Collection<String> getReadableInstancePropertyNames(final Class<?> clazz) {
    final TypeBasedGuardingDynamicLinker linker = getLinkerForClass(clazz);
    if(linker instanceof BeanLinker) {
        return ((BeanLinker)linker).getReadablePropertyNames();
    }
    return Collections.emptySet();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BeansLinker.java


示例7: getWritableInstancePropertyNames

import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker; //导入依赖的package包/类
/**
 * Returns a collection of names of all writable instance properties of a class.
 * @param clazz the class
 * @return a collection of names of all writable instance properties of a class.
 */
public static Collection<String> getWritableInstancePropertyNames(final Class<?> clazz) {
    final TypeBasedGuardingDynamicLinker linker = getLinkerForClass(clazz);
    if(linker instanceof BeanLinker) {
        return ((BeanLinker)linker).getWritablePropertyNames();
    }
    return Collections.emptySet();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BeansLinker.java


示例8: getInstanceMethodNames

import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker; //导入依赖的package包/类
/**
 * Returns a collection of names of all instance methods of a class.
 * @param clazz the class
 * @return a collection of names of all instance methods of a class.
 */
public static Collection<String> getInstanceMethodNames(final Class<?> clazz) {
    final TypeBasedGuardingDynamicLinker linker = getLinkerForClass(clazz);
    if(linker instanceof BeanLinker) {
        return ((BeanLinker)linker).getMethodNames();
    }
    return Collections.emptySet();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BeansLinker.java


示例9: ClassToLinker

import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
ClassToLinker(final TypeBasedGuardingDynamicLinker[] linkers) {
    this.linkers = linkers;
    singletonLinkers = new List[linkers.length];
    for(int i = 0; i < linkers.length; ++i) {
        singletonLinkers[i] = Collections.singletonList(linkers[i]);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:CompositeTypeBasedGuardingDynamicLinker.java


示例10: CompositeTypeBasedGuardingDynamicLinker

import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker; //导入依赖的package包/类
/**
 * Creates a new composite type-based linker.
 *
 * @param linkers the component linkers
 */
public CompositeTypeBasedGuardingDynamicLinker(final Iterable<? extends TypeBasedGuardingDynamicLinker> linkers) {
    final List<TypeBasedGuardingDynamicLinker> l = new LinkedList<>();
    for(final TypeBasedGuardingDynamicLinker linker: linkers) {
        l.add(linker);
    }
    this.classToLinker = new ClassToLinker(l.toArray(new TypeBasedGuardingDynamicLinker[l.size()]));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:CompositeTypeBasedGuardingDynamicLinker.java


示例11: getGuardedInvocation

import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker; //导入依赖的package包/类
@Override
public GuardedInvocation getGuardedInvocation(final LinkRequest linkRequest, final LinkerServices linkerServices)
        throws Exception {
    final Object obj = linkRequest.getReceiver();
    if(obj == null) {
        return null;
    }
    for(final TypeBasedGuardingDynamicLinker linker: classToLinker.get(obj.getClass())) {
        final GuardedInvocation invocation = linker.getGuardedInvocation(linkRequest, linkerServices);
        if(invocation != null) {
            return invocation;
        }
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:CompositeTypeBasedGuardingDynamicLinker.java


示例12: optimize

import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker; //导入依赖的package包/类
/**
 * Optimizes a list of type-based linkers. If a group of adjacent linkers in the list all implement
 * {@link TypeBasedGuardingDynamicLinker}, they will be replaced with a single instance of
 * {@link CompositeTypeBasedGuardingDynamicLinker} that contains them.
 *
 * @param linkers the list of linkers to optimize
 * @return the optimized list
 */
public static List<GuardingDynamicLinker> optimize(final Iterable<? extends GuardingDynamicLinker> linkers) {
    final List<GuardingDynamicLinker> llinkers = new LinkedList<>();
    final List<TypeBasedGuardingDynamicLinker> tblinkers = new LinkedList<>();
    for(final GuardingDynamicLinker linker: linkers) {
        if(linker instanceof TypeBasedGuardingDynamicLinker) {
            tblinkers.add((TypeBasedGuardingDynamicLinker)linker);
        } else {
            addTypeBased(llinkers, tblinkers);
            llinkers.add(linker);
        }
    }
    addTypeBased(llinkers, tblinkers);
    return llinkers;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:CompositeTypeBasedGuardingDynamicLinker.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ContainerUtilRt类代码示例发布时间:2022-05-22
下一篇:
Java ShadowEffect类代码示例发布时间: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