private static org.fest.reflect.field.Invoker<Integer> getPriorityField(Params params) { return Reflection.field("priority").ofType(int.class).in(params); }
public Object createRunner( @Nonnull Class<?> runnerType ) { return Reflection.constructor().in( runnerType ).newInstance(); }
@Nonnull public static JAnnotationUse param( @Nonnull JAnnotationUse annotation, @Nonnull String key, @Nonnull JFieldVar ref ) { Reflection.method( METHOD_ADD_VALUE ).withParameterTypes( String.class, JAnnotationValue.class ) .in( annotation ).invoke( key, new JAnnotationFieldReference( ref ) ); return annotation; } }
private static org.fest.reflect.field.Invoker<Long> getDelayUntilNsField(JobHolder jobHolder) { return Reflection.field("delayUntilNs").ofType(long.class).in(jobHolder); }
public void run( @Nonnull GeneratorConfiguration configuration, @Nonnull Object runner ) { Reflection.method( GENERATE_METHOD_NAME ).withParameterTypes( GeneratorConfiguration.class ).in( runner ).invoke( configuration ); }
private static org.fest.reflect.field.Invoker<Long> getDeadlineMsField(Params params) { return Reflection.field("deadlineMs").ofType(long.class).in(params); }
private static String classNameFromVmExitErrorTest(Test test) { try { return method("getClassName").withReturnType(String.class).in(test).invoke(); } catch (Exception e) { return UNKNOWN; } }
private static org.fest.reflect.field.Invoker<Integer> getNetworkTypeField(Params params) { return Reflection.field("requiredNetworkType").ofType(int.class).in(params); }
private static String classNameFromVmExitErrorTest(Test test) { try { return method("getClassName").withReturnType(String.class).in(test).invoke(); } catch (Exception e) { return UNKNOWN; } }
private static org.fest.reflect.field.Invoker<Long> getDelayMsField(Params params) { return Reflection.field("delayMs").ofType(long.class).in(params); }
/** * Starts the application. * * @throws org.fest.reflect.exception.ReflectionError if the "main" method cannot be invoked. */ public void start() { method("main").withParameterTypes(String[].class).in(applicationType).invoke(new Object[] { args }); } }
private static org.fest.reflect.field.Invoker<Boolean> getCancelOnDeadlineDeadlineField(Params params) { return Reflection.field("cancelOnDeadline").ofType(Boolean.class).in(params); }
@Nullable private static RepaintManager currentRepaintManager() { try { Object repaintManager = method("appContextGet").withReturnType(Object.class).withParameterTypes(Object.class) .in(SwingUtilities.class).invoke(RepaintManager.class); if (repaintManager instanceof RepaintManager) { return (RepaintManager) repaintManager; } } catch (RuntimeException e) { return null; } return null; }
private static org.fest.reflect.field.Invoker<String> getGroupIdField(Params params) { return Reflection.field("groupId").ofType(String.class).in(params); }
private void setRunning(MessageQueue mq) { Reflection.field("running").ofType(AtomicBoolean.class).in(mq).get().set(true); }
public JAnnotationFieldReference( @Nonnull JFieldVar ns ) { this.ns = ns; this.owner = Reflection.field( FIELD_OWNER ).ofType( JDefinedClass.class ).in( ns ).get(); }
@Override @Nullable public Component focusOwner() { return field("focusOwner").ofType(Component.class).in(KeyboardFocusManager.class).get(); } }
@Provides public WebApplication webApp( @NotNull GuiceContainer guiceContainer ) { WebApplication copy = webApplicationReference; if ( copy == null ) { WebComponent component = Reflection.field( "webComponent" ).ofType( WebComponent.class ).in( guiceContainer ).get(); copy = Reflection.field( "application" ).ofType( WebApplication.class ).in( component ).get(); webApplicationReference = copy; } return copy; }
private boolean isCanceled() { try { int state = Preconditions.checkNotNull(field("state").ofType(int.class).in(task).get()); return state == CANCELED; } catch (RuntimeException e) { handleException(e); } return false; }
private float[] getCurrentPosition(final ColorPicker colorPicker) { final float mAngle = field("mAngle") .ofType(float.class) .in(colorPicker) .get(); return getPosition(colorPicker, mAngle); }