@Override public ObjectCreator<T> invoke() { ObjectCreator[] methodParameters = calculateParametersForMethod(method, locator, resources, tracker); Invokable<T> core = new MethodInvoker<T>(instance, method, methodParameters); Invokable<T> wrapped = logger == null ? core : new LoggingInvokableWrapper<T>(logger, description, core); return new ConstructionPlan(tracker, description, wrapped); } });
@Override public ServiceBindingOptions scope(String scope) { assert InternalUtils.isNonBlank(scope); lock.check(); this.scope = scope; return this; }
@Override public AnnotationProvider getMethodAnnotationProvider(final String methodName, final Class... argumentTypes) { return toAnnotationProvider(findMethod(getServiceInterface(), methodName, argumentTypes)); }
@Override public ObjectCreator<T> invoke() { validateConstructorForAutobuild(constructor); ObjectCreator[] constructorParameters = calculateParameters(locator, resources, constructor.getParameterTypes(), constructor.getGenericParameterTypes(), constructor.getParameterAnnotations(), tracker); Invokable<T> core = new ConstructorInvoker<T>(constructor, constructorParameters); Invokable<T> wrapped = logger == null ? core : new LoggingInvokableWrapper<T>(logger, description, core); ConstructionPlan<T> plan = new ConstructionPlan(tracker, description, wrapped); extendPlanForInjectedFields(plan, tracker, locator, resources, constructor.getDeclaringClass()); extendPlanForPostInjectionMethods(plan, tracker, locator, resources, constructor.getDeclaringClass()); return plan; } });
@Override public AnnotationProvider getClassAnnotationProvider() { return toAnnotationProvider(getServiceInterface()); }
/** * Converts a method to a user presentable string consisting of the containing class name, the method name, and the * short form of the parameter list (the class name of each parameter type, shorn of the package name portion). * * @param method * @return short string representation */ public static String asString(Method method) { return InternalCommonsUtils.asString(method); }
/** * Capitalizes the string, and inserts a space before each upper case character (or sequence of upper case * characters). Thus "userId" becomes "User Id", etc. Also, converts underscore into space (and capitalizes the * following word), thus "user_id" also becomes "User Id". */ public static String toUserPresentable(String id) { return InternalCommonsUtils.toUserPresentable(id); }
private void addDependencies() { for (Orderable<T> orderable : orderables) { addDependencies(orderable); } }
@Override public String toString() { return "classpath:" + getPath(); }
/** * Strips leading "_" and "$" and trailing "_" from the name. */ public static String stripMemberName(String memberName) { return InternalCommonsUtils.stripMemberName(memberName); }
/** * Capitalizes a string, converting the first character to uppercase. */ public static String capitalize(String input) { return InternalCommonsUtils.capitalize(input); }
@Override public AnnotationProvider map(final Method element) { return toAnnotationProvider(element); } };
@Override public ServiceBindingOptions withId(String id) { assert InternalUtils.isNonBlank(id); lock.check(); serviceId = id; return this; }
@Override public ObjectCreator<T> invoke() { ObjectCreator[] methodParameters = calculateParametersForMethod(method, locator, resources, tracker); Invokable<T> core = new MethodInvoker<T>(instance, method, methodParameters); Invokable<T> wrapped = logger == null ? core : new LoggingInvokableWrapper<T>(logger, description, core); return new ConstructionPlan(tracker, description, wrapped); } });
@Override public AnnotationProvider getMethodAnnotationProvider(final String methodName, final Class... argumentTypes) { return toAnnotationProvider(findMethod(getServiceInterface(), methodName, argumentTypes)); }
@Override public AnnotationProvider getClassAnnotationProvider() { return toAnnotationProvider(getServiceInterface()); }
@Override public ServiceBindingOptions scope(String scope) { assert InternalUtils.isNonBlank(scope); lock.check(); this.scope = scope; return this; }
@Override public ServiceBindingOptions withId(String id) { assert InternalUtils.isNonBlank(id); lock.check(); serviceId = id; return this; }