field.setAccessible(true); } catch (AccessControlException ex) { continue;
field.setAccessible(true); } catch (AccessControlException ex) { continue;
private void setField (Field field, Task<E> task, Object value) { field.setAccessible(true); Object valueObject = castValue(field, value); if (valueObject == null) throwAttributeTypeException(getCurrentTask().name, field.getName(), field.getType().getSimpleName()); try { field.set(task, valueObject); } catch (ReflectionException e) { throw new GdxRuntimeException(e); } }
private void setField (Field field, Task<E> task, Object value) { field.setAccessible(true); Object valueObject = castValue(field, value); try { field.set(task, valueObject); } catch (ReflectionException e) { throw new GdxRuntimeException(e); } }
currentField.setAccessible(true);
/** Injects actors from group into target's fields annotated with {@link InjectActor} using reflection. */ public static void injectActorFields(Object target, Group group) { Class<?> handledClass = target.getClass(); while (handledClass != null && !handledClass.equals(Object.class)) { for (final Field field : ClassReflection.getDeclaredFields(handledClass)) { if (field != null && field.isAnnotationPresent(InjectActor.class)) { try { InjectActor annotation = field.getDeclaredAnnotation(InjectActor.class).getAnnotation(InjectActor.class); String actorName = annotation.value(); if (actorName.length() == 0) { actorName = field.getName(); } Actor actor = group.findActor(actorName); if (actor == null && actorName.equals(group.getName())) { actor = group; } if (actor == null) { Gdx.app.error(TAG_INJECT_FIELDS, "Can't find actor with name: " + actorName + " in group: " + group + " to inject into: " + target); } else { field.setAccessible(true); field.set(target, actor); } } catch (final ReflectionException exception) { Gdx.app.error(TAG_INJECT_FIELDS, "Unable to set value into field: " + field + " of object: " + target, exception); } } } handledClass = handledClass.getSuperclass(); } }
field.setAccessible(true); } catch (AccessControlException ex) { continue;
while (currentClass != null && !currentClass.equals(Object.class)) { for (Field field : ClassReflection.getDeclaredFields(currentClass)) { field.setAccessible(true); Annotation annotation = field .getDeclaredAnnotation(org.mini2Dx.core.serialization.annotation.Field.class);
field.setAccessible(true); Annotation annotation = field .getDeclaredAnnotation(org.mini2Dx.core.serialization.annotation.Field.class);
field.setAccessible(true); Annotation annotation = field .getDeclaredAnnotation(org.mini2Dx.core.serialization.annotation.Field.class);