This method is similar to {@link #getObjectForString(Class, String[])} except that it returns
an array of type objects. Expects the type variable to be an array.
770928
private Object getObjectForString(Class<?> type, String values[]) throws Exception{
    if(values == null || values.length == 0)
      throw new Exception("getObjectForString: values was null or of zero length");
    Object array = Array.newInstance(type.getComponentType(), values.length);
    // Now fill in the values for the empty array we just created.
    for(int i = 0; i < values.length; i++)
      Array.set(array, i, getObjectForString(type, values[i]));
    return array;
  }
377573
public static Function<Object,String[]> arrayOfString(final String methodName, final Object... optionalParameters) {
        return methodForArrayOfString(methodName, optionalParameters);
    }
1239986
public String [] getFieldsArray(){
		Object [] obj = datapoint.keySet().toArray();
		String [] out = new String[obj.length];
		for(int i=0; i<obj.length; i++)
			out[i] = String.valueOf(obj[i]);
		return out;
	}
467583
public String[] getVarTypes()
    {
    TreeSet<String> typeSet = new TreeSet<String>();
    for( Iterator<IVarDef> vars = getVarDefs(); vars.hasNext(); )
      {
      typeSet.add( vars.next().getType());
      }

    String[] types = new String[ typeSet.size()];
    typeSet.toArray( types);
    return types;
    }
1070622
public Object[] toArray() {
    Iterator<E> iter = iterator();
    ArrayList<Object> al = new ArrayList<Object>();
    while (iter.hasNext()) {
      al.add(iter.next());
    }
    return al.toArray();
  }
1007185
public static Class[] convertToTypeArray(Object[] args) {
        if (args == null)
            return null;
        int s = args.length;
        Class[] ans = new Class[s];
        for (int i = 0; i < s; i++) {
            Object o = args[i];
            ans[i] = getClassWithNullAndWrapper(o);
        }
        return ans;
    }
253525
public static String getTypeName(Type type) {
		if(type instanceof Class) {
			Class<?> clazz = (Class<?>) type;
			return clazz.isArray() ? (getTypeName(clazz.getComponentType()) + "[]") : clazz.getName();
		} else {
			return type.toString();
		}
	}
1347114
public static Object[] toArray(List<?> list) {
	Iterator<?> it = list.iterator();
	Class clazz = null;
	while (it.hasNext()) {
	    Object v = it.next();
	    if (v == null) continue;
	    if (clazz == null) clazz = v.getClass();
	    else if (clazz != v.getClass()) return list.toArray();
	}
	if (clazz == Object.class || clazz == null) return list.toArray();

	Object arr = java.lang.reflect.Array.newInstance(clazz, list.size());
	return list.toArray((Object[]) arr);
    }
979063
public final List<ObjectVariable> getObjectVariables() {
    List<ObjectVariable> objectVars = new ArrayList<ObjectVariable>();
    for (int i = 0; i < vars.length; i++) {
      if (vars[i] instanceof ObjectVariable) {
        objectVars.add((ObjectVariable) vars[i]);
      }
    }
    return objectVars;
  }
476677
@NotNull
    public Object[] toArray() {
        return toArray(new IntFunction<Object[]>() {

            @NotNull
            @Override
            public Object[] apply(int value) {
                return new Object[value];
            }
        });
    }
333359
public static String[] toStringArrayEL(Array array) {
	String[] arr = new String[array.size()];
	for (int i = 0; i < arr.length; i++) {
	    arr[i] = Caster.toString(array.get(i + 1, null), null);
	}

	return arr;
    }
1260766
public JClass []getParameterTypes()
  {
    Class []types = _method.getParameterTypes();

    JClass []jTypes = new JClass[types.length];

    for (int i = 0; i < types.length; i++) {
      jTypes[i] = _loader.forName(types[i].getName());
    }

    return jTypes;
  }
337298
@Override
	public Object getObject(final int columnIndex) throws SQLException {
		String columnLabel = getWrapped().getMetaData().getColumnLabel(columnIndex);

		return getObject(columnLabel);
	}
276598
public static Object[] toArray(Object obj)
	{
		if (obj instanceof Object[])
			return (Object[]) obj;
		else
		{
			Object[] returnArray =
			{ obj };
			return returnArray;

		}
	}
91014
public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException {
	// used reflection to make sure this work with Java 5 and 6
	try {
	    return (T) stat.getClass().getMethod("getObject", new Class[] { int.class, Class.class }).invoke(stat, new Object[] { parameterIndex, type });
	}
	catch (Throwable t) {
	    ExceptionUtil.rethrowIfNecessary(t);
	    if (t instanceof InvocationTargetException && ((InvocationTargetException) t).getTargetException() instanceof SQLException)
		throw (SQLException) ((InvocationTargetException) t).getTargetException();
	    throw new PageRuntimeException(Caster.toPageException(t));
	}
    }
706175
@Override
	public Object[] toArray() {
		Object[] result = new Object[size];
		for(int c=0;c<size;c++) result[c] = elementData[c];
		return result;
	}
769750
private Class<?>[] getTypes(Object[] args) {
        if (args == null || args.length == 0) {
            return null;
        }
        List<Class<?>> classList = new ArrayList<Class<?>>();
        for (Object obj : args) {
            classList.add(obj == null ? Object.class : obj.getClass());
        }
        return classList.toArray(new Class[] {});
    }