juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/HeaderBeanMeta.java [143:167]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	public T construct(String name, Object value) {

		if (constructor == null)
			throw new UnsupportedOperationException("Constructor for type "+type.getName()+" could not be found.");

		if (name == null)
			name = schema.getName();

		Class<?>[] pt = constructor.getParameterTypes();
		Object[] args = new Object[pt.length];
		if (pt.length == 1) {
			args[0] = pt[0] == String.class ? stringify(value) : value;
		} else {
			if (name == null)
				throw new UnsupportedOperationException("Constructor for type "+type.getName()+" requires a name as the first argument.");
			args[0] = name;
			args[1] = pt[1] == String.class ? stringify(value) : value;
		}

		try {
			return constructor.newInstance(args);
		} catch (Exception e) {
			throw asRuntimeException(e);
		}
	}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/part/PartBeanMeta.java [152:176]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	public T construct(String name, Object value) {

		if (constructor == null)
			throw new UnsupportedOperationException("Constructor for type "+type.getName()+" could not be found.");

		if (name == null)
			name = schema.getName();

		Class<?>[] pt = constructor.getParameterTypes();
		Object[] args = new Object[pt.length];
		if (pt.length == 1) {
			args[0] = pt[0] == String.class ? stringify(value) : value;
		} else {
			if (name == null)
				throw new UnsupportedOperationException("Constructor for type "+type.getName()+" requires a name as the first argument.");
			args[0] = name;
			args[1] = pt[1] == String.class ? stringify(value) : value;
		}

		try {
			return constructor.newInstance(args);
		} catch (Exception e) {
			throw asRuntimeException(e);
		}
	}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



