Lines Matching refs:lookup

65      * Returns a {@link Lookup lookup object} on the caller,
68 * This lookup object is a <em>capability</em> which may be delegated to trusted agents.
72 public static Lookup lookup() {
77 * Returns a {@link Lookup lookup object} which is trusted minimally.
81 * As a matter of pure convention, the {@linkplain Lookup#lookupClass lookup class}
82 * of this lookup object will be {@link java.lang.Object}.
84 * The lookup class can be changed to any other class {@code C} using an expression of the form
94 * A <em>lookup object</em> is a factory for creating method handles,
101 * is known as the {@linkplain #lookupClass lookup class}.
103 * A lookup class which needs to create method handles will call
104 * {@link MethodHandles#lookup MethodHandles.lookup} to create a factory for itself.
105 * When the {@code Lookup} factory object is created, the identity of the lookup class is
107 * The lookup class (or its delegates) may then use factory methods
109 * This includes all methods, constructors, and fields which are allowed to the lookup class,
117 * <table border=1 cellpadding=5 summary="lookup method behaviors">
118 * <tr><th>lookup expression</th><th>member</th><th>behavior</th></tr>
120 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findGetter lookup.findGetter(C.class,"f",FT.class)}</td>
124 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findStaticGetter lookup.findStaticGetter(C.class,"f",FT.class)}</td>
128 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findSetter lookup.findSetter(C.class,"f",FT.class)}</td>
132 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findStaticSetter lookup.findStaticSetter(C.class,"f",FT.class)}</td>
136 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findVirtual lookup.findVirtual(C.class,"m",MT)}</td>
140 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findStatic lookup.findStatic(C.class,"m",MT)}</td>
144 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findSpecial lookup.findSpecial(C.class,"m",MT,this.class)}</td>
148 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findConstructor lookup.findConstructor(C.class,MT)}</td>
152 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#unreflectGetter lookup.unreflectGetter(aField)}</td>
156 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#unreflectSetter lookup.unreflectSetter(aField)}</td>
160 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}</td>
164 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#unreflectConstructor lookup.unreflectConstructor(aConstructor)}</td>
168 * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}</td>
174 * documented as a parameter named {@code refc} in the lookup methods.
181 * restricted in type to the lookup class; see below.)
196 * <li>If {@code C} is not symbolically accessible from the lookup class's loader,
197 * the lookup can still succeed, even when there is no equivalent
200 * is not symbolically accessible from the lookup class's loader,
201 * the lookup can still succeed.
204 * <li>If there is a security manager installed, it can forbid the lookup
218 * compares its recorded lookup class against all requests to
222 * lookup class.
227 * to create method handles on private members of the lookup class.
230 * original lookup class.
232 * A lookup can fail, because
233 * the containing class is not accessible to the lookup class, or
235 * desired class member is not accessible to the lookup class.
237 * thrown from the attempted lookup. The exact class will be one of
247 * under which the lookup class could have compiled and resolved a call to {@code M}.
248 * And the effect of invoking the method handle resulting from the lookup
253 * including the requirement that the lookup class must be either be in the
258 * to objects of the lookup class or one of its subclasses.
261 * (which will necessarily be a superclass of the lookup class)
262 * to the lookup class itself.
274 * which can transform a lookup on {@code C.E} into one on any of those other
312 * <li>If the class loader of the lookup class is not
329 * and if the class loader of the lookup class is not
338 /** The class on behalf of whom the lookup is being performed. */
380 /** Tells which class is performing the lookup. It is this class against
397 /** Tells which access-protection classes of members this lookup object can produce.
404 * A freshly-created lookup object
405 * on the {@linkplain java.lang.invoke.MethodHandles#lookup() caller's class}
407 * A lookup object on a new lookup class
408 * {@linkplain java.lang.invoke.MethodHandles.Lookup#in created from a previous lookup object}
410 * The purpose of this is to restrict access via the new lookup object,
412 * lookup object, and also by the new lookup class.
418 /** Embody the current class (the lookupClass) as a lookup class
438 * Creates a lookup on the specified new lookup class.
445 * <li>If the new lookup class differs from the old one,
448 * <li>If the new lookup class is in a different package
450 * <li>If the new lookup class is not within the same package member
452 * <li>If the new lookup class is not accessible to the old lookup class,
457 * @param requestedLookupClass the desired lookup class for the new lookup object
458 * @return a lookup object which reports the desired lookup class
463 if (allowedModes == TRUSTED) // IMPL_LOOKUP can make any lookup at all
479 // The requested class it not accessible from the lookup class.
490 /** Version of lookup which is trusted minimally.
496 /** Package-private version of lookup which is trusted. */
508 * If there are restrictions on the access permitted to this lookup,
522 * {@link java.lang.invoke.MethodHandles#lookup MethodHandles.lookup}.
562 * The method and all its argument types must be accessible to the lookup class.
593 * The method and all its argument types must be accessible to the lookup class.
601 * The first argument will be of type {@code refc} if the lookup
604 * will be restricted in type to the lookup class.
656 * The constructor and all its argument types must be accessible to the lookup class.
699 * lookup class, or if this lookup object does not have private access
733 * Access checking is performed immediately on behalf of the lookup class.
756 * Access checking is performed immediately on behalf of the lookup class.
778 * Access checking is performed immediately on behalf of the lookup class.
800 * Access checking is performed immediately on behalf of the lookup class.
820 * of the given name and type is accessible to the lookup class.
821 * The method and all its argument types must be accessible to the lookup class.
840 MethodHandle mh0 = lookup().{@link #findVirtual findVirtual}(defc, name, type);
849 * to the lookup class.
872 * Makes a direct method handle to <i>m</i>, if the lookup class has permission.
879 * access checking is performed immediately on behalf of the lookup class.
898 Lookup lookup = m.isAccessible() ? IMPL_LOOKUP : this;
899 return lookup.getDirectMethod(refKind, method.getDeclaringClass(), method, findBoundCallerClass(method));
909 * access checking is performed immediately on behalf of the lookup class,
941 * access checking is performed immediately on behalf of the lookup class.
957 Lookup lookup = c.isAccessible() ? IMPL_LOOKUP : this;
958 return lookup.getDirectConstructor(ctor.getDeclaringClass(), ctor);
969 * access checking is performed immediately on behalf of the lookup class.
983 Lookup lookup = f.isAccessible() ? IMPL_LOOKUP : this;
984 return lookup.getDirectField(field.getReferenceKind(), f.getDeclaringClass(), field);
995 * access checking is performed immediately on behalf of the lookup class.
1029 * If this lookup object has private access, then the caller class is the lookupClass.
1035 // Only full-power lookup is allowed to resolve caller-sensitive methods
1039 throw new IllegalAccessException("Attempt to lookup caller-sensitive method using restricted lookup object");
1252 // repeat the search (symbolic lookup) from LC.super.
1282 if ((allowedModes & PRIVATE) == 0) // caller must use full-power lookup
1764 MethodHandle cat = lookup().findVirtual(String.class,
1822 MethodHandle cat = lookup().findVirtual(String.class,
1887 MethodHandle cat = lookup().findVirtual(String.class,
1889 MethodHandle upcase = lookup().findVirtual(String.class,
1978 MethodHandle cat = lookup().findVirtual(String.class,
1980 MethodHandle length = lookup().findVirtual(String.class,
2072 MethodHandle cat = lookup().findVirtual(String.class,