/** * Add the provided property accessors. Each accessor name * will be the class simple name. * @param propertyAccessors the accessors. * @return this registrar. * @since 4.3.8 */ public SpelPropertyAccessorRegistrar add(PropertyAccessor... propertyAccessors) { Assert.notEmpty(propertyAccessors, "'propertyAccessors' must not be empty"); for (PropertyAccessor propertyAccessor : propertyAccessors) { this.propertyAccessors.put(obtainAccessorKey(propertyAccessor), propertyAccessor); } return this; }
/** * Provide a {@link SpelPropertyAccessorRegistrar} supplied * with the {@link JsonPropertyAccessor} and {@link TuplePropertyAccessor}. * This bean is used to customize an * {@link org.springframework.integration.config.IntegrationEvaluationContextFactoryBean}. * for additional {@link org.springframework.expression.PropertyAccessor}s. * @return the SpelPropertyAccessorRegistrar bean * @see org.springframework.integration.config.IntegrationEvaluationContextFactoryBean */ @Bean public static SpelPropertyAccessorRegistrar spelPropertyAccessorRegistrar() { return new SpelPropertyAccessorRegistrar() .add(Introspector.decapitalize(JsonPropertyAccessor.class.getSimpleName()), new JsonPropertyAccessor()) .add(Introspector.decapitalize(TuplePropertyAccessor.class.getSimpleName()), new TuplePropertyAccessor()); }
SpelPropertyAccessorRegistrar propertyAccessorRegistrar = this.applicationContext.getBean(SpelPropertyAccessorRegistrar.class); for (Entry<String, PropertyAccessor> entry : propertyAccessorRegistrar.getPropertyAccessors() .entrySet()) { if (!getPropertyAccessors().containsKey(entry.getKey())) {
@Bean public SpelPropertyAccessorRegistrar spelPropertyAccessorRegistrar() { return new SpelPropertyAccessorRegistrar(new JsonPropertyAccessor(), new EnvironmentAccessor()); }
SpelPropertyAccessorRegistrar propertyAccessorRegistrar = this.applicationContext.getBean(SpelPropertyAccessorRegistrar.class); for (Entry<String, PropertyAccessor> entry : propertyAccessorRegistrar.getPropertyAccessors() .entrySet()) { if (!getPropertyAccessors().containsKey(entry.getKey())) {
/** * Create an instance with the provided property accessors. Each accessor name * will be the class simple name. * @param propertyAccessors the accessors. * @since 4.3.8 */ public SpelPropertyAccessorRegistrar(PropertyAccessor... propertyAccessors) { Assert.notEmpty(propertyAccessors, "'propertyAccessors' must not be empty"); for (PropertyAccessor propertyAccessor : propertyAccessors) { this.propertyAccessors.put(obtainAccessorKey(propertyAccessor), propertyAccessor); } }
/** * Create an instance with the provided property accessors. Each accessor name * will be the class simple name. * @param propertyAccessors the accessors. * @since 4.3.8 */ public SpelPropertyAccessorRegistrar(PropertyAccessor... propertyAccessors) { Assert.notEmpty(propertyAccessors, "'propertyAccessors' must not be empty"); for (PropertyAccessor propertyAccessor : propertyAccessors) { this.propertyAccessors.put(obtainAccessorKey(propertyAccessor), propertyAccessor); } }
/** * Add the provided property accessors. Each accessor name * will be the class simple name. * @param propertyAccessors the accessors. * @return this registrar. * @since 4.3.8 */ public SpelPropertyAccessorRegistrar add(PropertyAccessor... propertyAccessors) { Assert.notEmpty(propertyAccessors, "'propertyAccessors' must not be empty"); for (PropertyAccessor propertyAccessor : propertyAccessors) { this.propertyAccessors.put(obtainAccessorKey(propertyAccessor), propertyAccessor); } return this; }