public static <T> InvokableAnnotatedMethod<T> of(AnnotatedMethod<T> delegate) { return new InvokableAnnotatedMethod<T>(delegate); }
private boolean isMoreSpecific(InvokableAnnotatedMethod<?> candidate, InvokableAnnotatedMethod<?> mostSpecific) { for (int i = 0; i < candidate.getJavaMember().getGenericParameterTypes().length; i++) { if (Types.isMoreSpecific(candidate.getJavaMember().getGenericParameterTypes()[i], mostSpecific.getJavaMember().getGenericParameterTypes()[i])) { return true; } } return false; }
public InvokableAnnotatedMethod(AnnotatedMethod<T> annotatedMethod) { this.annotatedMethod = annotatedMethod; this.methods = Collections.<Class<?>, Method>singletonMap(annotatedMethod.getJavaMember().getDeclaringClass(), annotatedMethod.getJavaMember()); SecurityActions.ensureAccessible(annotatedMethod.getJavaMember()); }
private Object doInvoke(WeldDecorator<?> weldDecorator, Object decoratorInstance, Method method, Object[] args) throws Throwable { if (!method.isAnnotationPresent(Inject.class)) { InvokableAnnotatedMethod<?> decoratorMethod = weldDecorator.getDecoratorMethod(method); if (decoratorMethod != null) { try { return decoratorMethod.invokeOnInstance(decoratorInstance, args); } catch (InvocationTargetException e) { throw e.getCause(); } } } SecurityActions.ensureAccessible(method); return Reflections.invokeAndUnwrap(getTargetInstance(), method, args); } }
public static <T> InvokableAnnotatedMethod<T> of(AnnotatedMethod<T> delegate) { return new InvokableAnnotatedMethod<T>(delegate); }
private boolean isMoreSpecific(InvokableAnnotatedMethod<?> candidate, InvokableAnnotatedMethod<?> mostSpecific) { for (int i = 0; i < candidate.getJavaMember().getGenericParameterTypes().length; i++) { if (Types.isMoreSpecific(candidate.getJavaMember().getGenericParameterTypes()[i], mostSpecific.getJavaMember().getGenericParameterTypes()[i])) { return true; } } return false; }
public InvokableAnnotatedMethod(AnnotatedMethod<T> annotatedMethod) { this.annotatedMethod = annotatedMethod; this.methods = Collections.<Class<?>, Method>singletonMap(annotatedMethod.getJavaMember().getDeclaringClass(), annotatedMethod.getJavaMember()); SecurityActions.ensureAccessible(annotatedMethod.getJavaMember()); // TODO: make sure this instance does not leak }
private Object doInvoke(WeldDecorator<?> weldDecorator, Object decoratorInstance, Method method, Object[] args) throws Throwable { if (!method.isAnnotationPresent(Inject.class)) { InvokableAnnotatedMethod<?> decoratorMethod = weldDecorator.getDecoratorMethod(method); if (decoratorMethod != null) { try { return decoratorMethod.invokeOnInstance(decoratorInstance, args); } catch (InvocationTargetException e) { throw e.getCause(); } } } SecurityActions.ensureAccessible(method); return Reflections.invokeAndUnwrap(getTargetInstance(), method, args); } }
public static <T> InvokableAnnotatedMethod<T> of(AnnotatedMethod<T> delegate) { return new InvokableAnnotatedMethod<T>(delegate); }
private boolean isMoreSpecific(InvokableAnnotatedMethod<?> candidate, InvokableAnnotatedMethod<?> mostSpecific) { for (int i = 0; i < candidate.getJavaMember().getGenericParameterTypes().length; i++) { if (Types.isMoreSpecific(candidate.getJavaMember().getGenericParameterTypes()[i], mostSpecific.getJavaMember().getGenericParameterTypes()[i])) { return true; } } return false; }
public InvokableAnnotatedMethod(AnnotatedMethod<T> annotatedMethod) { this.annotatedMethod = annotatedMethod; this.methods = Collections.<Class<?>, Method>singletonMap(annotatedMethod.getJavaMember().getDeclaringClass(), annotatedMethod.getJavaMember()); SecurityActions.ensureAccessible(annotatedMethod.getJavaMember()); }
public static <T> InvokableAnnotatedMethod<T> of(AnnotatedMethod<T> delegate) { return new InvokableAnnotatedMethod<T>(delegate); }
private boolean isMoreSpecific(InvokableAnnotatedMethod<?> candidate, InvokableAnnotatedMethod<?> mostSpecific) { for (int i = 0; i < candidate.getJavaMember().getGenericParameterTypes().length; i++) { if (Types.isMoreSpecific(candidate.getJavaMember().getGenericParameterTypes()[i], mostSpecific.getJavaMember().getGenericParameterTypes()[i])) { return true; } } return false; }
public InvokableAnnotatedMethod(AnnotatedMethod<T> annotatedMethod) { this.annotatedMethod = annotatedMethod; this.methods = Collections.<Class<?>, Method>singletonMap(annotatedMethod.getJavaMember().getDeclaringClass(), annotatedMethod.getJavaMember()); SecurityActions.ensureAccessible(annotatedMethod.getJavaMember()); }
public static <T> InvokableAnnotatedMethod<T> of(AnnotatedMethod<T> delegate) { return new InvokableAnnotatedMethod<T>(delegate); }
private boolean isMoreSpecific(InvokableAnnotatedMethod<?> candidate, InvokableAnnotatedMethod<?> mostSpecific) { for (int i = 0; i < candidate.getJavaMember().getGenericParameterTypes().length; i++) { if (Types.isMoreSpecific(candidate.getJavaMember().getGenericParameterTypes()[i], mostSpecific.getJavaMember().getGenericParameterTypes()[i])) { return true; } } return false; }
public InvokableAnnotatedMethod(AnnotatedMethod<T> annotatedMethod) { this.annotatedMethod = annotatedMethod; this.methods = Collections.<Class<?>, Method>singletonMap(annotatedMethod.getJavaMember().getDeclaringClass(), annotatedMethod.getJavaMember()); SecurityActions.ensureAccessible(annotatedMethod.getJavaMember()); }
public static <T> InvokableAnnotatedMethod<T> of(AnnotatedMethod<T> delegate) { return new InvokableAnnotatedMethod<T>(delegate); }
private boolean isMoreSpecific(InvokableAnnotatedMethod<?> candidate, InvokableAnnotatedMethod<?> mostSpecific) { for (int i = 0; i < candidate.getJavaMember().getGenericParameterTypes().length; i++) { if (Types.isMoreSpecific(candidate.getJavaMember().getGenericParameterTypes()[i], mostSpecific.getJavaMember().getGenericParameterTypes()[i])) { return true; } } return false; }
public InvokableAnnotatedMethod(AnnotatedMethod<T> annotatedMethod) { this.annotatedMethod = annotatedMethod; this.methods = Collections.<Class<?>, Method>singletonMap(annotatedMethod.getJavaMember().getDeclaringClass(), annotatedMethod.getJavaMember()); SecurityActions.ensureAccessible(annotatedMethod.getJavaMember()); }