/** * Looks up public constructor in this class. * * @return method descriptor or {@code null} if there is no public constructor */ public JavaMethodDesc lookupConstructor() { return getMembers().constructor; }
public JavaMethodDesc getFunctionalMethod() { return getMembers().functionalMethod; }
/** * Looks up a public non-static method in this class. * * @param name method name * @return method descriptor or {@code null} if there is no such method */ public JavaMethodDesc lookupMethod(String name) { return getMembers().methods.get(name); }
/** * Looks up a public static field in this class. * * @param name field name * @return field or {@code null} if there is no such field */ public JavaFieldDesc lookupStaticField(String name) { return getMembers().staticFields.get(name); }
/** * Looks up a public static method in this class. * * @param name method name * @return method descriptor or {@code null} if there is no such method */ public JavaMethodDesc lookupStaticMethod(String name) { return getMembers().staticMethods.get(name); }
/** * Looks up a public non-static field in this class. * * @param name field name * @return field or {@code null} if there is no such field */ public JavaFieldDesc lookupField(String name) { return getMembers().fields.get(name); }
public Collection<String> getFieldNames(boolean onlyStatic) { return Collections.unmodifiableCollection((onlyStatic ? getMembers().staticFields : getMembers().fields).keySet()); }
public Collection<String> getMethodNames(boolean onlyStatic, boolean includeInternal) { Map<String, JavaMethodDesc> methods = onlyStatic ? getMembers().staticMethods : getMembers().methods; if (includeInternal || onlyStatic) { return Collections.unmodifiableCollection(methods.keySet()); } else { Collection<String> methodNames = new ArrayList<>(methods.size()); for (Map.Entry<String, JavaMethodDesc> entry : methods.entrySet()) { if (!entry.getValue().isInternal()) { methodNames.add(entry.getKey()); } } return methodNames; } }
private JNIMembers getJNIMembers() { JNIMembers m = jniMembers; if (m == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); synchronized (this) { m = jniMembers; if (m == null) { jniMembers = m = new JNIMembers(getMembers()); } } } return m; }