@Override public Constructor<X> run() { try { return DeclaredMemberIndexer.getConstructorForIndex(index, declaringClass); } catch (Exception e) { throw ReflectionLogger.LOG.unableToGetConstructorOnDeserialization(declaringClass, index, e); } } }
/** * @param constructor * @return the index for the given constructor */ public static int getIndexForConstructor(Constructor<?> constructor) { Preconditions.checkNotNull(constructor); return getIndexForMember(constructor, getDeclaredConstructors(constructor.getDeclaringClass())); }
/** * @param field * @return the index for the given field */ public static int getIndexForField(Field field) { Preconditions.checkNotNull(field); return getIndexForMember(field, getDeclaredFields(field.getDeclaringClass())); }
/** * @param method * @return the index for the given method */ public static int getIndexForMethod(Method method) { Preconditions.checkNotNull(method); return getIndexForMember(method, getDeclaredMethods(method.getDeclaringClass())); }
public static String forProducerMethod(EnhancedAnnotatedMethod<?, ?> method, AbstractClassBean<?> declaringBean) { if (declaringBean.getEnhancedAnnotated().isDiscovered()) { return forProducerMethod(declaringBean.getAnnotated().getIdentifier(), DeclaredMemberIndexer.getIndexForMethod(method.getJavaMember())); } return getPrefix(ProducerMethod.class).append(method.getDeclaringType().slim().getIdentifier()).append(AnnotatedTypes.createCallableId(method)).toString(); }
public ProducerMethodIdentifier(EnhancedAnnotatedMethod<?, ?> method, AbstractClassBean<?> declaringBean) { this(declaringBean.getAnnotated().getIdentifier(), DeclaredMemberIndexer.getIndexForMethod(method.getJavaMember())); }
@Override public Method run() { try { return DeclaredMemberIndexer.getMethodForIndex(index, declaringClass); } catch (Exception e) { throw ReflectionLogger.LOG.unableToGetMethodOnDeserialization(declaringClass, index, e); } }
/** * @param index * @param declaringClass * @return the declared method for the given index and declaring class * @throws IndexOutOfBoundsException if the index is out of range */ public static Method getMethodForIndex(int index, Class<?> declaringClass) { return getDeclaredMethods(declaringClass).get(index); }
/** * @param index * @param declaringClass * @return the declared field for the given index and declaring class * @throws IndexOutOfBoundsException if the index is out of range */ public static Field getFieldForIndex(int index, Class<?> declaringClass) { return getDeclaredFields(declaringClass).get(index); }
public MethodHolder(Method method) { super(method); this.index = DeclaredMemberIndexer.getIndexForMethod(method); this.declaringClass = method.getDeclaringClass(); }
public ConstructorHolder(Constructor<X> constructor) { super(constructor); this.declaringClass = constructor.getDeclaringClass(); this.index = DeclaredMemberIndexer.getIndexForConstructor(constructor); }
/** * @param index * @param declaringClass * @return the declared constructor for the given index and declaring class * @throws IndexOutOfBoundsException if the index is out of range */ public static <T> Constructor<T> getConstructorForIndex(int index, Class<T> declaringClass) { return cast(getDeclaredConstructors(declaringClass).get(index)); }
public static String forProducerMethod(EnhancedAnnotatedMethod<?, ?> method, AbstractClassBean<?> declaringBean) { if (declaringBean.getEnhancedAnnotated().isDiscovered()) { return forProducerMethod(declaringBean.getAnnotated().getIdentifier(), DeclaredMemberIndexer.getIndexForMethod(method.getJavaMember())); } return getPrefix(ProducerMethod.class).append(method.getDeclaringType().slim().getIdentifier()).append(AnnotatedTypes.createCallableId(method)).toString(); }
public ProducerMethodIdentifier(EnhancedAnnotatedMethod<?, ?> method, AbstractClassBean<?> declaringBean) { this(declaringBean.getAnnotated().getIdentifier(), DeclaredMemberIndexer.getIndexForMethod(method.getJavaMember())); }
/** * @param method * @return the index for the given method */ public static int getIndexForMethod(Method method) { Preconditions.checkNotNull(method); return getIndexForMember(method, getDeclaredMethods(method.getDeclaringClass())); }
@Override public Method run() { try { return DeclaredMemberIndexer.getMethodForIndex(index, declaringClass); } catch (Exception e) { throw ReflectionLogger.LOG.unableToGetMethodOnDeserialization(declaringClass, index, e); } }
/** * @param index * @param declaringClass * @return the declared method for the given index and declaring class * @throws IndexOutOfBoundsException if the index is out of range */ public static Method getMethodForIndex(int index, Class<?> declaringClass) { return getDeclaredMethods(declaringClass).get(index); }
/** * @param index * @param declaringClass * @return the declared field for the given index and declaring class * @throws IndexOutOfBoundsException if the index is out of range */ public static Field getFieldForIndex(int index, Class<?> declaringClass) { return getDeclaredFields(declaringClass).get(index); }
public MethodHolder(Method method) { super(method); this.index = DeclaredMemberIndexer.getIndexForMethod(method); this.declaringClass = method.getDeclaringClass(); }
public ConstructorHolder(Constructor<X> constructor) { super(constructor); this.declaringClass = constructor.getDeclaringClass(); this.index = DeclaredMemberIndexer.getIndexForConstructor(constructor); }