001/* 002 * Copyright 2002-2012 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.beans.factory.support; 018 019import org.springframework.util.Assert; 020 021/** 022 * Tag collection class used to hold managed array elements, which may 023 * include runtime bean references (to be resolved into bean objects). 024 * 025 * @author Juergen Hoeller 026 * @since 3.0 027 */ 028@SuppressWarnings("serial") 029public class ManagedArray extends ManagedList<Object> { 030 031 /** Resolved element type for runtime creation of the target array */ 032 volatile Class<?> resolvedElementType; 033 034 035 /** 036 * Create a new managed array placeholder. 037 * @param elementTypeName the target element type as a class name 038 * @param size the size of the array 039 */ 040 public ManagedArray(String elementTypeName, int size) { 041 super(size); 042 Assert.notNull(elementTypeName, "elementTypeName must not be null"); 043 setElementTypeName(elementTypeName); 044 } 045 046}