/** * Look for an argument value that either corresponds to the given index * in the constructor argument list or generically matches by type. * @param index the index in the constructor argument list * @param requiredType the parameter type to match * @param requiredName the parameter name to match * @return the ValueHolder for the argument, or {@code null} if none set */ @Nullable public ValueHolder getArgumentValue(int index, Class<?> requiredType, String requiredName) { return getArgumentValue(index, requiredType, requiredName, null); }
/** * Look for an argument value that either corresponds to the given index * in the constructor argument list or generically matches by type. * @param index the index in the constructor argument list * @param requiredType the parameter type to match * @return the ValueHolder for the argument, or {@code null} if none set */ @Nullable public ValueHolder getArgumentValue(int index, Class<?> requiredType) { return getArgumentValue(index, requiredType, null, null); }
/** * Look for an argument value that either corresponds to the given index * in the constructor argument list or generically matches by type. * @param index the index in the constructor argument list * @param requiredType the parameter type to match * @param requiredName the parameter name to match * @return the ValueHolder for the argument, or {@code null} if none set */ @Nullable public ValueHolder getArgumentValue(int index, Class<?> requiredType, String requiredName) { return getArgumentValue(index, requiredType, requiredName, null); }
/** * Look for an argument value that either corresponds to the given index * in the constructor argument list or generically matches by type. * @param index the index in the constructor argument list * @param requiredType the parameter type to match * @return the ValueHolder for the argument, or {@code null} if none set */ @Nullable public ValueHolder getArgumentValue(int index, Class<?> requiredType) { return getArgumentValue(index, requiredType, null, null); }
@SuppressWarnings({"unchecked"}) public static List<BeanMetadataElement> findFilterChain(ParserContext parserContext, String explicitRef) { String filterChainRef = explicitRef; if (!StringUtils.hasText(filterChainRef)) { filterChainRef = findDefaultFilterChainBeanId(parserContext); } return (List<BeanMetadataElement>) parserContext.getRegistry().getBeanDefinition(filterChainRef).getConstructorArgumentValues().getArgumentValue(1,List.class).getValue(); }
@SuppressWarnings({"unchecked"}) public static List<BeanMetadataElement> findFilterChain(ParserContext parserContext, String explicitRef) { String filterChainRef = explicitRef; if (!StringUtils.hasText(filterChainRef)) { filterChainRef = findDefaultFilterChainBeanId(parserContext); } return (List<BeanMetadataElement>) parserContext.getRegistry().getBeanDefinition(filterChainRef).getConstructorArgumentValues().getArgumentValue(1,List.class).getValue(); }
.getArgumentValue(1, RuntimeBeanReference.class).getValue();
Object[] args = new Object[paramTypes.length]; for (int i = 0; i < args.length; i++) { ConstructorArgumentValues.ValueHolder valueHolder = cav.getArgumentValue( i, paramTypes[i], (paramNames != null ? paramNames[i] : null), usedValueHolders); if (valueHolder == null) {
valueHolder = resolvedValues.getArgumentValue(paramIndex, paramType, paramName, usedValueHolders);
Object[] args = new Object[paramTypes.length]; for (int i = 0; i < args.length; i++) { ConstructorArgumentValues.ValueHolder valueHolder = cav.getArgumentValue( i, paramTypes[i], (paramNames != null ? paramNames[i] : null), usedValueHolders); if (valueHolder == null) {
@Test public void beanDefinitionMerging() { RootBeanDefinition bd = new RootBeanDefinition(TestBean.class); bd.getConstructorArgumentValues().addGenericArgumentValue("test"); bd.getConstructorArgumentValues().addIndexedArgumentValue(1, new Integer(5)); bd.getPropertyValues().add("name", "myName"); bd.getPropertyValues().add("age", "99"); bd.setQualifiedElement(getClass()); GenericBeanDefinition childBd = new GenericBeanDefinition(); childBd.setParentName("bd"); RootBeanDefinition mergedBd = new RootBeanDefinition(bd); mergedBd.overrideFrom(childBd); assertEquals(2, mergedBd.getConstructorArgumentValues().getArgumentCount()); assertEquals(2, mergedBd.getPropertyValues().size()); assertEquals(bd, mergedBd); mergedBd.getConstructorArgumentValues().getArgumentValue(1, null).setValue(new Integer(9)); assertEquals(new Integer(5), bd.getConstructorArgumentValues().getArgumentValue(1, null).getValue()); assertEquals(getClass(), bd.getQualifiedElement()); }
/** * Look for an argument value that either corresponds to the given index * in the constructor argument list or generically matches by type. * @param index the index in the constructor argument list * @param requiredType the type to match * @return the ValueHolder for the argument, or <code>null</code> if none set */ public ValueHolder getArgumentValue(int index, Class requiredType) { return getArgumentValue(index, requiredType, null, null); }
/** * Look for an argument value that either corresponds to the given index * in the constructor argument list or generically matches by type. * @param index the index in the constructor argument list * @param requiredType the type to match * @param requiredName the name to match * @return the ValueHolder for the argument, or <code>null</code> if none set */ public ValueHolder getArgumentValue(int index, Class requiredType, String requiredName) { return getArgumentValue(index, requiredType, requiredName, null); }
valueHolder = resolvedValues.getArgumentValue(paramIndex, paramType, paramName, usedValueHolders);
@Override protected Class<?> determineTargetType(String beanName, RootBeanDefinition mbd, Class<?>... typesToMatch) { if (mbd.getBeanClass().equals(ConstantFactoryBean.class)) { Object value = mbd.getConstructorArgumentValues().getArgumentValue(0, Object.class).getValue(); if (value != null) { return value.getClass(); } } return super.determineTargetType(beanName, mbd, typesToMatch); }
ValueHolder argumentValue = bfppd.getConstructorArgumentValues().getArgumentValue(0, Map.class); if (argumentValue == null) { candidates = new ManagedMap<>();
.getArgumentValue(1, RuntimeBeanReference.class).getValue();
getBeanDefinition(IntegrationContextUtils.AUTO_CREATE_CHANNEL_CANDIDATES_BEAN_NAME); ConstructorArgumentValues caValues = channelRegistry.getConstructorArgumentValues(); ValueHolder vh = caValues.getArgumentValue(0, Collection.class); if (vh == null) { //although it should never happen if it does we can fix it caValues.addIndexedArgumentValue(0, new ManagedSet<String>()); (Collection<String>) caValues.getArgumentValue(0, Collection.class).getValue(); // NOSONAR see comment above
/** * Look for an argument value that either corresponds to the given index * in the constructor argument list or generically matches by type. * @param index the index in the constructor argument list * @param requiredType the type to match * @return the ValueHolder for the argument, or <code>null</code> if none set */ public ValueHolder getArgumentValue(int index, Class requiredType) { return getArgumentValue(index, requiredType, null); }
resolvedValues.getArgumentValue(paramIndex, paramType, paramName, usedValueHolders);