private Roi getIJ1DefaultRoi() { final Field field = Types.field(ij.plugin.OverlayCommands.class, "defaultRoi"); final Object obj = ClassUtils.getValue(field, null); return (Roi) obj; }
private String getIJ1CompilerTarget() { final Field field = getCompilerField("target"); if (field == null) return "1.5"; final int t = (Integer) ClassUtils.getValue(field, null); if (t == 0) return "1.4"; if (t == 1) return "1.5"; if (t == 2) return "1.6"; if (t == 3) return "1.7"; return "1.5"; }
private double getIJ1DefaultStrokeWidth() { final Field field = Types.field(RectToolOptions.class, "defaultStrokeWidth"); return (Double) ClassUtils.getValue(field, null); }
private boolean getIJ1CompilerDebugFlag() { final Field field = getCompilerField("generateDebuggingInfo"); if (field == null) return false; return (Boolean) ClassUtils.getValue(field, null); }
private String getIJ1WandMode() { final Field field = Types.field(WandToolOptions.class, "mode"); return (String) ClassUtils.getValue(field, null); }
private double getIJ1WandTolerance() { final Field field = Types.field(WandToolOptions.class, "tolerance"); return (Double) ClassUtils.getValue(field, null); }
/** Helper method of {@link #getName} and {@link #getAliases}. */ private <T> T getFieldValue(final Class<T> fieldType, final String fieldName) { final Class<? extends Op> opType = getType(); final Field nameField = ClassUtils.getField(opType, fieldName); if (nameField == null) return null; if (!fieldType.isAssignableFrom(nameField.getType())) return null; @SuppressWarnings("unchecked") final T value = (T) ClassUtils.getValue(nameField, null); return value; }
@Override public Object getOutput(final String name) { final CommandModuleItem<?> item = info.getOutput(name); return item == null ? null : ClassUtils.getValue(item.getField(), command); }
@Override public Object getOutput(final String name) { final CommandModuleItem<?> item = info.getOutput(name); return item == null ? null : ClassUtils.getValue(item.getField(), command); }
@Override public Object getInput(final String name) { final CommandModuleItem<?> item = info.getInput(name); return item == null ? null : ClassUtils.getValue(item.getField(), command); }
@Override public Object getInput(final String name) { final CommandModuleItem<?> item = info.getInput(name); return item == null ? null : ClassUtils.getValue(item.getField(), command); }
final Service existingService = (Service) ClassUtils.getValue(f, o); if (strict && existingService != null) { throw new IllegalStateException("Context already injected: " + // final Context existingContext = (Context) ClassUtils.getValue(f, o); if (strict && existingContext != null) { throw new IllegalStateException("Context already injected: " + // final Object value = ClassUtils.getValue(f, o); if (value != null) inject(value);
final Service existingService = (Service) ClassUtils.getValue(f, o); if (strict && existingService != null) { throw new IllegalStateException("Context already injected: " + // final Context existingContext = (Context) ClassUtils.getValue(f, o); if (strict && existingContext != null) { throw new IllegalStateException("Context already injected: " + // final Object value = ClassUtils.getValue(f, o); if (value != null) inject(value);
@Override public Object getOutput(final String name) { final Field field = getInfo().getOutputField(name); if (field == null) return super.getInput(name); return ClassUtils.getValue(field, this); }
@Override public Object getInput(final String name) { final Field field = getInfo().getInputField(name); if (field == null) return super.getInput(name); return ClassUtils.getValue(field, this); }
@Override public Object getOutput(final String name) { final Field field = getInfo().getOutputField(name); if (field == null) return super.getInput(name); return ClassUtils.getValue(field, this); }
@Override public Object getInput(final String name) { final Field field = getInfo().getInputField(name); if (field == null) return super.getInput(name); return ClassUtils.getValue(field, this); }