code: private static Datatype getDatatype(Long index, Datatype[] datatypes,
  			boolean useNullAsDefaultDatatype) throws EXIException {
  		if (index == null && useNullAsDefaultDatatype) {
  			return BuiltIn.getDefaultDatatype();
  		}
  		if (index == null || index >= datatypes.length || index < 0) {
  			throw new EXIException("Can't find datatype of index: " + index);
  		}
  		return datatypes[index.intValue()];
  	}
docs: Get the datatype instance from an index in the datatypes array, or get
  the built-in default datatype if the {@code index} is null and
  {@code useNullAsDefaultDatatype} is true.
  
  @param index
  The index of the datatype.
  @param datatypes
  The array of datatypes.
  @param useNullAsDefaultDatatype
  Tells is it should return null for the built-in default
  parameter.
  @return The datatype instance.
  @throws EXIException
  if the index is out of bounds from the datatypes array.