private static IMethod getPublicDefaultCtor(IClass klass) { IMethod ctorMethod = klass.getMethod(defCtorSelector); if (ctorMethod != null && ctorMethod.isPublic() && ctorMethod.getDeclaringClass() == klass) { return ctorMethod; } return null; }
private static IMethod getPublicDefaultCtor(IClass klass) { IMethod ctorMethod = klass.getMethod(defCtorSelector); if (ctorMethod != null && ctorMethod.isPublic() && ctorMethod.getDeclaringClass() == klass) { return ctorMethod; } return null; }
/** * Get all the public constructors of a class */ private static Collection<IMethod> getPublicConstructors(IClass cls) { Collection<IMethod> result = HashSetFactory.make(); for (IMethod m : cls.getDeclaredMethods()) { if (m.isInit() && m.isPublic()) { result.add(m); } } return result; }
/** * Get all the public constructors of a class */ private static Collection<IMethod> getPublicConstructors(IClass cls) { Collection<IMethod> result = HashSetFactory.make(); for (IMethod m : cls.getDeclaredMethods()) { if (m.isInit() && m.isPublic()) { result.add(m); } } return result; }
/** * Get all non-constructor, non-class-initializer methods declared by a class and all its superclasses */ private static Collection<IMethod> getAllNormalPublicMethods(IClass cls) { Collection<IMethod> result = HashSetFactory.make(); Collection<? extends IMethod> allMethods = null; allMethods = cls.getAllMethods(); for (IMethod m : allMethods) { if (!m.isInit() && !m.isClinit() && m.isPublic()) { result.add(m); } } return result; }
/** * Get all non-constructor, non-class-initializer methods declared by a class and all its superclasses */ private static Collection<IMethod> getAllNormalPublicMethods(IClass cls) { Collection<IMethod> result = HashSetFactory.make(); Collection<? extends IMethod> allMethods = null; allMethods = cls.getAllMethods(); for (IMethod m : allMethods) { if (!m.isInit() && !m.isClinit() && m.isPublic()) { result.add(m); } } return result; }
if (im.isBridge() || im.isSynthetic()) continue; if (im.isPublic()) { publicMethods.add(im.getSignature()); } else {
/** * Get all non-constructor, non-class-initializer methods declared by a class * and all its superclasses if their name is equal to the specified name. * @param cls the class * @param name the name */ private static Collection<IMethod> getAllNormalPublicMethods(IClass cls,Atom name) { Collection<IMethod> result = HashSetFactory.make(); Collection<? extends IMethod> allMethods = null; allMethods = cls.getAllMethods(); for (IMethod m : allMethods) { if (!m.isInit() && !m.isClinit() && m.isPublic() && m.getSelector().getName().equals(name)) { result.add(m); } } return result; }
/** * Get all non-constructor, non-class-initializer methods declared by a class * and all its superclasses if their name is equal to the specified name. * @param cls the class * @param name the name */ private static Collection<IMethod> getAllNormalPublicMethods(IClass cls,Atom name) { Collection<IMethod> result = HashSetFactory.make(); Collection<? extends IMethod> allMethods = null; allMethods = cls.getAllMethods(); for (IMethod m : allMethods) { if (!m.isInit() && !m.isClinit() && m.isPublic() && m.getSelector().getName().equals(name)) { result.add(m); } } return result; }
private static Iterable<Entrypoint> makePublicEntrypoints(IClassHierarchy cha, String entryClass) { Collection<Entrypoint> result = new ArrayList<>(); IClass klass = cha.lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application, StringStuff.deployment2CanonicalTypeString(entryClass))); for (IMethod m : klass.getDeclaredMethods()) { if (m.isPublic()) { result.add(new DefaultEntrypoint(m, cha)); } } return result; } }
public static int getMethodAccessCode(IMethod m) { int res = 0x0; if (m == null) return res; if (m.isPublic()) { res |= AccessFlags.PUBLIC.getValue(); } else if (m.isProtected()) { res |= AccessFlags.PROTECTED.getValue(); } else if (m.isPrivate()) { res |= AccessFlags.PRIVATE.getValue(); } else { res |= AccessFlags.PACKAGE_PROTECTED.getValue(); } return res; } }
public static Iterable<Entrypoint> makePrimordialPublicEntrypoints(ClassHierarchy cha, String pkg) { final HashSet<Entrypoint> result = HashSetFactory.make(); for (IClass clazz : cha) { if (clazz.getName().toString().indexOf(pkg) != -1 && !clazz.isInterface() && !clazz.isAbstract()) { for (IMethod method : clazz.getDeclaredMethods()) { if (method.isPublic() && !method.isAbstract()) { System.out.println("Entry:" + method.getReference()); result.add(new DefaultEntrypoint(method, cha)); } } } } return result::iterator; }
public static int getMethodAccessCode(IMethod m) { int res = 0x0; if (m == null) return res; if (m.isPublic()) { res |= JvmMethodAccessFlags.PUBLIC.getValue(); } else if (m.isProtected()) { res |= JvmMethodAccessFlags.PROTECTED.getValue(); } else if (m.isPrivate()) { res |= JvmMethodAccessFlags.PRIVATE.getValue(); } else { res |= JvmMethodAccessFlags.PACKAGE_PROTECTED.getValue(); } if (m.isStatic()) res |= JvmMethodAccessFlags.STATIC.getValue(); if (m.isFinal()) res |= JvmMethodAccessFlags.FINAL.getValue(); if (m.isAbstract()) res |= JvmMethodAccessFlags.ABSTRACT.getValue(); return res; }