org.scijava.plugin.Parameter Java Examples

The following examples show how to use org.scijava.plugin.Parameter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultTableIOPluginTest.java    From imagej-server with Apache License 2.0 5 votes vote down vote up
private void setValues(final Object instance, final String[] fieldNames,
	final Object[] values) throws SecurityException
{
	final Class<?> cls = instance.getClass();
	final List<Field> fields = ClassUtils.getAnnotatedFields(cls,
		Parameter.class);
	final HashMap<String, Field> fieldMap = new HashMap<>();
	for (final Field field : fields) {
		fieldMap.put(field.getName(), field);
	}
	for (int i = 0; i < fieldNames.length; i++) {
		ClassUtils.setValue(fieldMap.get(fieldNames[i]), instance, values[i]);
	}
}