public <T> T readEntry(final String key, final String stringDefault, final Type ipCls, final Class<? extends ConfigResolver.Converter> converterType, final String parameterizedBy, final boolean projectStageAware, final boolean evaluate) { final ConfigResolver.TypedResolver<T> resolver = asResolver( key, stringDefault, ipCls, converterType, parameterizedBy, projectStageAware, evaluate); return resolver.getValue(); }
/** * <p>Inspects the given InjectionPoint and search for a {@link ConfigProperty} * annotation or an Annotation with a {@link ConfigProperty} meta-Annotation. * The name and defaultValue information will be used to resolve the * configured value.</p> * * @param injectionPoint current injection point * @return the configured value for the given InjectionPoint */ protected String getStringPropertyValue(InjectionPoint injectionPoint) { ConfigProperty configProperty = getAnnotation(injectionPoint, ConfigProperty.class); if (configProperty == null) { throw new IllegalStateException("producer method called without @ConfigProperty being present!"); } return getPropertyValue(injectionPoint, String.class); }
protected <T> T getPropertyValue(InjectionPoint injectionPoint, Class<T> ipCls) { return getUntypedPropertyValue(injectionPoint, ipCls); }
protected <T> T getUntypedPropertyValue(InjectionPoint injectionPoint, Type ipCls) { ConfigProperty configProperty = getAnnotation(injectionPoint, ConfigProperty.class); if (configProperty == null) { throw new IllegalStateException("producer method called without @ConfigProperty being present!"); } return readEntry(configProperty.name(), configProperty.defaultValue(), ipCls, configProperty.converter(), configProperty.parameterizedBy(), configProperty.projectStageAware(), configProperty.evaluateVariables()); }
protected <T> T getUntypedPropertyValue(InjectionPoint injectionPoint, Type ipCls) { ConfigProperty configProperty = getAnnotation(injectionPoint, ConfigProperty.class); if (configProperty == null) { throw new IllegalStateException("producer method called without @ConfigProperty being present!"); } return readEntry(configProperty.name(), configProperty.defaultValue(), ipCls, configProperty.converter(), configProperty.parameterizedBy(), configProperty.projectStageAware(), configProperty.evaluateVariables()); }
/** * <p>Inspects the given InjectionPoint and search for a {@link ConfigProperty} * annotation or an Annotation with a {@link ConfigProperty} meta-Annotation. * The name and defaultValue information will be used to resolve the * configured value.</p> * * @param injectionPoint current injection point * @return the configured value for the given InjectionPoint */ protected String getStringPropertyValue(InjectionPoint injectionPoint) { ConfigProperty configProperty = getAnnotation(injectionPoint, ConfigProperty.class); if (configProperty == null) { throw new IllegalStateException("producer method called without @ConfigProperty being present!"); } return getPropertyValue(injectionPoint, String.class); }
public <T> T readEntry(final String key, final String stringDefault, final Type ipCls, final Class<? extends ConfigResolver.Converter> converterType, final String parameterizedBy, final boolean projectStageAware, final boolean evaluate) { final ConfigResolver.TypedResolver<T> resolver = asResolver( key, stringDefault, ipCls, converterType, parameterizedBy, projectStageAware, evaluate); return resolver.getValue(); }
protected <T> T getPropertyValue(InjectionPoint injectionPoint, Class<T> ipCls) { return getUntypedPropertyValue(injectionPoint, ipCls); }
/** * <p>Inspects the given InjectionPoint and search for a {@link ConfigProperty} * annotation or an Annotation with a {@link ConfigProperty} meta-Annotation. * The name and defaultValue information will be used to resolve the * configured value.</p> * * @param injectionPoint current injection point * @return the configured value for the given InjectionPoint */ protected String getStringPropertyValue(InjectionPoint injectionPoint) { ConfigProperty configProperty = getAnnotation(injectionPoint, ConfigProperty.class); if (configProperty == null) { throw new IllegalStateException("producer method called without @ConfigProperty being present!"); } String configuredValue; String defaultValue = configProperty.defaultValue(); configuredValue = getPropertyValue(configProperty.name(), defaultValue); return configuredValue; }
ConfigResolver.TypedResolver<?> typedResolver = delegate.asResolver( prefix + annotation.name(), list || set ? ConfigProperty.NULL : defaultValue, returnType, converter, annotation.parameterizedBy(),
@Produces @ConfigProperty(name = "ignored") public Object create(final InjectionPoint ip) { return super.getUntypedPropertyValue(ip, ip.getType()); } }