public static void data(Object... namesValues) {
if (namesValues.length % 2 != 0) {
throw new IllegalArgumentException(String.format(ERROR_ARGUMENTS_LENGTH, namesValues.length));
}
OmniPartialViewContext context = OmniPartialViewContext.getCurrentInstance();
for (int i = 0; i < namesValues.length; i+= 2) {
if (!(namesValues[i] instanceof String)) {
String type = (namesValues[i]) != null ? namesValues[i].getClass().getName() : "null";
throw new IllegalArgumentException(String.format(ERROR_ARGUMENT_TYPE, type, namesValues[i]));
}
context.addArgument((String) namesValues[i], namesValues[i + 1]);
}
}