コード例 #1
0
 /**
  * Create a name for the given reflected method. The resulting name will be in a resolved state.
  */
 public MemberName(Method m) {
   Object[] typeInfo = {m.getReturnType(), m.getParameterTypes()};
   init(m.getDeclaringClass(), m.getName(), typeInfo, flagsMods(IS_METHOD, m.getModifiers()));
   // fill in vmtarget, vmindex while we have m in hand:
   MethodHandleNatives.init(this, m);
   assert (isResolved());
 }
コード例 #2
0
 /** Create a name for the given class. The resulting name will be in a resolved state. */
 public MemberName(Class<?> type) {
   init(
       type.getDeclaringClass(),
       type.getSimpleName(),
       type,
       flagsMods(IS_TYPE, type.getModifiers()));
   vmindex = 0; // isResolved
   assert (isResolved());
 }
コード例 #3
0
 /**
  * Create a name for the given reflected field. The resulting name will be in a resolved state.
  */
 public MemberName(Field fld) {
   init(
       fld.getDeclaringClass(),
       fld.getName(),
       fld.getType(),
       flagsMods(IS_FIELD, fld.getModifiers()));
   // fill in vmtarget, vmindex while we have fld in hand:
   MethodHandleNatives.init(this, fld);
   assert (isResolved());
 }
コード例 #4
0
 /**
  * Create a name for the given reflected constructor. The resulting name will be in a resolved
  * state.
  */
 public MemberName(Constructor ctor) {
   Object[] typeInfo = {void.class, ctor.getParameterTypes()};
   init(
       ctor.getDeclaringClass(),
       CONSTRUCTOR_NAME,
       typeInfo,
       flagsMods(IS_CONSTRUCTOR, ctor.getModifiers()));
   // fill in vmtarget, vmindex while we have ctor in hand:
   MethodHandleNatives.init(this, ctor);
   assert (isResolved());
 }
コード例 #5
0
 /**
  * Create a method or constructor name from the given components: Declaring class, name, type,
  * modifiers. It will be a constructor if and only if the name is {@code "&lt;init&gt;"}. The
  * declaring class may be supplied as null if this is to be a bare name and type. The resulting
  * name will in an unresolved state.
  */
 public MemberName(Class<?> defClass, String name, MethodType type, int modifiers) {
   int flagBit = (name.equals(CONSTRUCTOR_NAME) ? IS_CONSTRUCTOR : IS_METHOD);
   init(defClass, name, type, flagBit | (modifiers & RECOGNIZED_MODIFIERS));
 }
コード例 #6
0
 /**
  * Create a field or type name from the given components: Declaring class, name, type, modifiers.
  * The declaring class may be supplied as null if this is to be a bare name and type. The
  * resulting name will in an unresolved state.
  */
 public MemberName(Class<?> defClass, String name, Class<?> type, int modifiers) {
   init(defClass, name, type, IS_FIELD | (modifiers & RECOGNIZED_MODIFIERS));
 }