Suppress all constructors in the given class.

@param clazz
The classes whose constructors will be suppressed.
@param excludePrivateConstructors
optionally keep code in private constructors
182369
public static synchronized void suppressConstructor(Class<?> clazz, boolean excludePrivateConstructors) {
		Constructor<?>[] ctors = null;

		if (excludePrivateConstructors) {
			ctors = clazz.getConstructors();
		} else {
			ctors = clazz.getDeclaredConstructors();
		}

		for (Constructor<?> ctor : ctors) {
			MockRepository.addConstructorToSuppress(ctor);
		}
	}
302497
@SuppressWarnings("unchecked")
    public <T extends WebLocatorAbstractBuilder> T setExcludeClasses(final String... excludeClasses) {
        pathBuilder.setExcludeClasses(excludeClasses);
        return (T) this;
    }
288937
public ObjectGraph excludeClasses(Class<?>... classes) {
    for (Class<?> c : classes) {
      if (c == null) {
        throw new NullPointerException("Null class not allowed");
      }
      excludedClasses.add(c);
    }
    return this;
  }
618812
public static void load(Class<?> restrictionClass) {
    if(MASTER_CACHE == null) {
      initialize();
    }
    if(MASTER_CACHE.isEmpty()) {
      return;
    }
    Iterator<Class<?>> iter = MASTER_CACHE.iterator();
    while(iter.hasNext()) {
      Class<?> clazz = iter.next();
      // Skip other classes.
      if(!restrictionClass.isAssignableFrom(clazz)) {
        continue;
      }
      // skip abstract / private classes.
      if(Modifier.isInterface(clazz.getModifiers()) || Modifier.isAbstract(clazz.getModifiers()) || Modifier.isPrivate(clazz.getModifiers())) {
        continue;
      }
      boolean instantiable = false;
      try {
        instantiable = clazz.getConstructor() != null;
      }
      catch(Exception | Error e) {
        // ignore
      }
      try {
        instantiable = instantiable || ClassGenericsUtil.getParameterizer(clazz) != null;
      }
      catch(Exception | Error e) {
        // ignore
      }
      if(!instantiable) {
        continue;
      }
      ELKIServiceRegistry.register(restrictionClass, clazz);
    }
  }
497183
@SuppressWarnings({"unchecked"})
    public static <T> Constructor<T>[] collectConstructors(Class<T> clazz, int include, int exclude) {
        final List<Constructor<?>> result = new ArrayList<>();
        for (Constructor<?> c: clazz.getDeclaredConstructors()) {
            int mod = c.getModifiers();
            if (include(mod, include, exclude)) {
                result.add(c);
            }
        }
        return (Constructor<T>[]) result.toArray(new Constructor<?>[result.size()]);
    }
51255
static void assertConstructorIsPrivateAndCall(Class<?> cls) {
        Constructor<?> constructor;
        try {
            constructor = cls.getDeclaredConstructor();
        } catch (NoSuchMethodException e1) {
            throw new RuntimeException("private constructor without arguments not found", e1);
        } catch (SecurityException e1) {
            throw new RuntimeException(e1);
        }
        assertTrue("constructor is not private", Modifier.isPrivate(constructor.getModifiers()));
        constructor.setAccessible(true);
        try {
            constructor.newInstance();
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            // don't care if constructor threw an exception!
        }
    }
300319
static Constructor<?>[] getConstructors(final Class<?> clazz) {
        return AccessController.doPrivileged(new PrivilegedAction<Constructor<?>[]>() {
            public Constructor<?>[] run() {
                return clazz.getConstructors();
            }
        });
    }
1041727
public static List<Method> getPublicMethods(Class<?> clazz, Method... excludeMethods) {
		final HashSet<Method> excludeMethodSet = CollectionUtil.newHashSet(excludeMethods);
		return getPublicMethods(clazz, new Filter<Method>() {
			@Override
			public boolean accept(Method method) {
				return false == excludeMethodSet.contains(method);
			}
		});
	}
362538
synchronized void removeInterestedByClass(Class<?> clazz, ProbeListener listener) {
        Set<ProbeListener> listeners = listenersByClass.get(clazz);
        if (listeners != null) {
            listeners.remove(listener);
            if (listeners.isEmpty()) {
                listenersByClass.remove(clazz);
            }
        }
    }
979241
public static Constructor<?>[] getAllConstructors(Class<?> clazz) {
        Constructor<?>[] declaredConstructors = clazz.getDeclaredConstructors();
        for (Constructor<?> constructor : declaredConstructors) {
            if (!constructor.isAccessible()) {
                constructor.setAccessible(true);
            }
        }
        return declaredConstructors;
    }
138864
public void configureFactory(Class<?> clazz) {
        ConnectionConfiguration connectionConfiguration = resolveConnectionConfiguration(clazz);
        if (connectionConfiguration == null) {
            return;
        }
        connectionFactory.setHost(connectionConfiguration.host());
        connectionFactory.setVirtualHost(connectionConfiguration.virtualHost());
        connectionFactory.setPort(connectionConfiguration.port());
        connectionFactory.setConnectionTimeout(connectionConfiguration.timeout());
        connectionFactory.setRequestedHeartbeat(connectionConfiguration.heartbeat());
        connectionFactory.setUsername(connectionConfiguration.username());
        connectionFactory.setPassword(connectionConfiguration.password());
        connectionFactory.setRequestedFrameMax(connectionConfiguration.frameMax());
    }
1277436
public static Object defaultInstantiateDelegate(Class<?> clazz, List<FieldDeclaration> fieldDeclarations) {
    return defaultInstantiateDelegate(clazz.getName(), fieldDeclarations);
  }
222664
public static List<Method> getPublicMethods(Class<?> clazz, String... excludeMethodNames) {
		final HashSet<String> excludeMethodNameSet = CollectionUtil.newHashSet(excludeMethodNames);
		return getPublicMethods(clazz, new Filter<Method>() {
			@Override
			public boolean accept(Method method) {
				return false == excludeMethodNameSet.contains(method.getName());
			}
		});
	}
181433
public static Class<?> resolvePrimitiveIfNecessary(Class<?> clazz) {
		Assert.notNull(clazz, "Class must not be null");
		return (clazz.isPrimitive() && clazz != void.class? primitiveTypeToWrapperMap.get(clazz) : clazz);
	}
690259
@Deprecated
    public static synchronized void suppressMethod(Class<?> clazz, String methodName, Class<?>[] parameterTypes) {
        SuppressCode.suppressMethod(clazz, methodName, parameterTypes);
    }
749418
public static ConstructorInstance getConstructorInstance(Class clazz, Object[] args) throws NoSuchMethodException {
	ConstructorInstance ci = getConstructorInstance(clazz, args, null);
	if (ci != null) return ci;
	throw new NoSuchMethodException("No matching Constructor for " + clazz.getName() + "(" + getDspMethods(getClasses(args)) + ") found");
    }
1046874
public Exclude<ExceptionClassFilter<T>> getOrCreateExclude()
   {
      List<Node> nodeList = childNode.get("exclude");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new ExcludeImpl<ExceptionClassFilter<T>>(this, "exclude", childNode, nodeList.get(0));
      }
      return createExclude();
   }