Lines Matching refs:TypeBasedGuardingDynamicLinker
94 import jdk.dynalink.linker.TypeBasedGuardingDynamicLinker;
99 * {@link TypeBasedGuardingDynamicLinker#canLinkType(Class)} method. The linkers
104 public class CompositeTypeBasedGuardingDynamicLinker implements TypeBasedGuardingDynamicLinker {
107 private static class ClassToLinker extends ClassValue<List<TypeBasedGuardingDynamicLinker>> {
108 private static final List<TypeBasedGuardingDynamicLinker> NO_LINKER = Collections.emptyList();
109 private final TypeBasedGuardingDynamicLinker[] linkers;
110 private final List<TypeBasedGuardingDynamicLinker>[] singletonLinkers;
113 ClassToLinker(final TypeBasedGuardingDynamicLinker[] linkers) {
123 protected List<TypeBasedGuardingDynamicLinker> computeValue(final Class<?> clazz) {
124 List<TypeBasedGuardingDynamicLinker> list = NO_LINKER;
126 final TypeBasedGuardingDynamicLinker linker = linkers[i];
146 private final ClassValue<List<TypeBasedGuardingDynamicLinker>> classToLinker;
155 public CompositeTypeBasedGuardingDynamicLinker(final Iterable<? extends TypeBasedGuardingDynamicLinker> linkers) {
156 final List<TypeBasedGuardingDynamicLinker> l = new LinkedList<>();
157 for(final TypeBasedGuardingDynamicLinker linker: linkers) {
160 this.classToLinker = new ClassToLinker(l.toArray(new TypeBasedGuardingDynamicLinker[0]));
165 * {@link TypeBasedGuardingDynamicLinker#canLinkType(Class)} for the type.
168 * from {@link TypeBasedGuardingDynamicLinker#canLinkType(Class)}, false
183 for(final TypeBasedGuardingDynamicLinker linker: classToLinker.get(obj.getClass())) {
194 * the list all implement {@link TypeBasedGuardingDynamicLinker}, they will
205 final List<TypeBasedGuardingDynamicLinker> tblinkers = new LinkedList<>();
208 if(linker instanceof TypeBasedGuardingDynamicLinker) {
209 tblinkers.add((TypeBasedGuardingDynamicLinker)linker);
220 final List<TypeBasedGuardingDynamicLinker> tblinkers) {