Collects constructors of {@code clazz}.
Constructors are included if their modifier bits match each bit of {@code include}
and no bit of {@code exclude}.
@param <T>
@param clazz
@param include
@param exclude
@return constructors
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()]);
    }
881873
public static Field[] getFieldArrayIncludeSupClassExcludeUID(Class<?> clazz) {
        Field[] currField = clazz.getDeclaredFields();
        clazz = clazz.getSuperclass();
        Field[] supField = clazz.getDeclaredFields();
        Field[] temp = new Field[currField.length + supField.length];
        int length = 0;
        for (Field curr : currField) {
            if ("serialVersionUID".equals(curr.getName())) {
                continue;
            }
            temp[length] = curr;
            length++;
        }
        for (Field sup : supField) {
            if ("serialVersionUID".equals(sup.getName())) {
                continue;
            }
            temp[length] = sup;
            length++;
        }
        Field[] all = new Field[length];
        for (int i = 0; i < all.length; i++) {
            all[i] = temp[i];
        }
        return all;
    }
758008
public static ConstructorParameterPair getConstructorParameterPairIgnoreCase(Class clazz, Object[] parameters) throws NoSuchMethodException {
	// set all values
	// Class objectClass=object.getClass();
	if (parameters == null) parameters = new Object[0];

	// set parameter classes
	Class[] parameterClasses = new Class[parameters.length];
	for (int i = 0; i < parameters.length; i++) {
	    parameterClasses[i] = parameters[i].getClass();
	}

	// search right method
	Constructor[] constructor = clazz.getConstructors();
	for (int mode = 0; mode < 2; mode++) {
	    outer: for (int i = 0; i < constructor.length; i++) {
		Constructor c = constructor[i];

		Class[] paramTrg = c.getParameterTypes();
		// Same Parameter count
		if (parameterClasses.length == paramTrg.length) {
		    for (int y = 0; y < parameterClasses.length; y++) {
			if (mode == 0 && parameterClasses[y] != primitiveToWrapperType(paramTrg[y])) {
			    continue outer;
			}
			else if (mode == 1) {
			    Object o = compareClasses(parameters[y], paramTrg[y]);
			    if (o == null) continue outer;

			    parameters[y] = o;
			    parameterClasses[y] = o.getClass();

			}
		    }
		    return new ConstructorParameterPair(c, parameters);
		}

	    }
	}

	// Exeception
	String parameter = "";
	for (int i = 0; i < parameterClasses.length; i++) {
	    if (i != 0) parameter += ", ";
	    parameter += parameterClasses[i].getName();
	}
	throw new NoSuchMethodException("class constructor " + clazz.getName() + "(" + parameter + ") doesn't exist");
    }
220870
private boolean includes(String identifier) {
    if (includes.isEmpty()) return !exclude(identifier);

    String includeMatch = null;
    String excludeMatch = null;
    for (String rule = identifier; rule != null; rule = enclosing(rule)) {
      if (excludes.contains(rule)) {
        excludeMatch = rule;
      }
      if (includes.contains(rule)) {
        includeMatch = rule;
      }
    }
    if (excludeMatch != null) {
      usedExcludes.add(excludeMatch);
      return false;
    }
    if (includeMatch != null) {
      usedIncludes.add(includeMatch);
      return true;
    }
    return false;
  }
872573
public static <T> Constructor<T> bestConstructor(Class<T> clazz, Object[] args) throws AmbiguousConstructorMatchException {
        return bestConstructor(collectConstructors(clazz), args);
    }
216518
private static NoSuchBeingException missingConstructorException(Class<?> clazz, Object... arguments)
  {
    Type[] types = new Type[arguments.length];
    for(int i = 0; i < arguments.length; ++i) {
      types[i] = arguments[i].getClass();
    }
    return new NoSuchBeingException("Missing constructor(%s) for |%s|.", Arrays.toString(types), clazz);
  }
268828
public <T> Clazz<T> FindClazz( Class<T> clazz )
	{
		if( clazzz == null )
			return null;

		for( Clazz<?> c : clazzz.values() )
			if( c.getReflectedClass() == clazz )
			{
				@SuppressWarnings( "unchecked" )
				Clazz<T> result = (Clazz<T>) c;
				return result;
			}

		return null;
	}
1072982
public static List<ElementConfig> getElements(Class clazz) {
      if (!cacheEC.containsKey(clazz)) {
         cacheEC.put(clazz, new ArrayList<>(1));
         Element e = (Element) clazz.getAnnotation(Element.class);
         if (e != null) {
            cacheEC.get(clazz).add(fromAnnotation(e));
         }
         Elements es = (Elements) clazz.getAnnotation(com.vectorprint.report.itext.annotations.Elements.class);
         if (es != null) {
            for (Element s : es.elements()) {
               cacheEC.get(clazz).add(fromAnnotation(s));
            }
         }
      }
      return cacheEC.get(clazz);
   }
971179
@Override
    public @Nonnull ApplicationContextBuilder include(@Nullable String... configurations) {
        if (configurations != null) {
            this.configurationIncludes.addAll(Arrays.asList(configurations));
        }
        return this;
    }
750964
public <T> List<Class<? extends T>> getImplementations(final Class<T> clazz, Predicate<Class<? extends T>> predicate)
	{
		final long started = System.currentTimeMillis();
		try
		{
			if (clazz.isInterface())
				return filter(finder.findImplementations(clazz), predicate);
			else
				return filter(finder.findSubclasses(clazz), predicate);
		}
		finally
		{
			final long finished = System.currentTimeMillis();
			searchTime.addAndGet(finished - started);

			if (log.isTraceEnabled())
				log.trace("getExtendingClasses " +
				          clazz +
				          " with predicate=" +
				          predicate +
				          " returned in " +
				          (finished - started) +
				          " ms");
		}
	}
605138
public static <T> Constructor<T>[] candidateConstructors(Constructor<T>[] constructors, Object[] args) {
        return candidateConstructors(constructors, collectArgTypes(args));
    }
1257976
@SuppressWarnings("unchecked")
	public OptionsBuilder includes(String... includes) {
		return includes != null ? includes(Arrays.asList(includes)) : this;
	}
283827
public Exclude<Scan<T>> getOrCreateExclude()
   {
      Node node = childNode.getOrCreate("exclude");
      Exclude<Scan<T>> exclude = new ExcludeImpl<Scan<T>>(this, "exclude", childNode, node);
      return exclude;
   }
663395
public Include createInclude(Map includeMap) {
        Include include = createInclude();
        populateSetSelector(includeMap, include);
        return include;
    }
986640
public <T> List<Class<? extends T>> getImplementations(final Class<T> clazz)
	{
		return getImplementations(clazz, null);
	}
442680
public void setClazz(Class<? extends ElementBase> clazz) {
        this.clazz = clazz;

        try {
            // Force execution of static initializers
            Class.forName(clazz.getName());
        } catch (ClassNotFoundException e) {
            MiscUtil.toUnchecked(e);
        }
    }
1195263
public static boolean hasPublicNullaryConstructor(Class<?> clazz) {
		Constructor<?>[] constructors = clazz.getConstructors();
		for (Constructor<?> constructor : constructors) {
			if (constructor.getParameterTypes().length == 0 &&
					Modifier.isPublic(constructor.getModifiers())) {
				return true;
			}
		}
		return false;
	}