2362N/A * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. 827N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 827N/A * This code is free software; you can redistribute it and/or modify it 827N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 827N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 827N/A * This code is distributed in the hope that it will be useful, but WITHOUT 827N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 827N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 827N/A * version 2 for more details (a copy is included in the LICENSE file that 827N/A * accompanied this code). 827N/A * You should have received a copy of the GNU General Public License version 827N/A * 2 along with this work; if not, write to the Free Software Foundation, 827N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 827N/A * This class is intended to handle <array> element, 827N/A * that is used to array creation. 827N/A * The {@code length} attribute specifies the length of the array. 827N/A * The {@code class} attribute specifies the elements type. 827N/A * The {@link Object} type is used by default. 827N/A * <array length="10"/></pre> 827N/A * is equivalent to {@code new Component[10]} in Java code. 827N/A * The {@code set} and {@code get} methods, 827N/A * as defined in the {@link java.util.List} interface, 827N/A * can be used as if they could be applied to array instances. 827N/A * The {@code index} attribute can thus be used with arrays. 827N/A * <array length="3" class="java.lang.String"> 827N/A * <void index="1"> 827N/A * <string>Hello, world</string> 827N/A * is equivalent to the following Java code:<pre> 827N/A * String[] s = new String[3]; 827N/A * s[1] = "Hello, world";</pre> 827N/A * It is possible to omit the {@code length} attribute and 827N/A * specify the values directly, without using {@code void} tags. 827N/A * The length of the array is equal to the number of values specified. 827N/A * <array id="array" class="int"> 827N/A * <int>123</int> 827N/A * <int>456</int> 827N/A * is equivalent to {@code int[] array = {123, 456}} in Java code. 827N/A * <p>The following atributes are supported: 827N/A * <dd>the type of object for instantiation 827N/A * <dd>the identifier of the variable that is intended to store the result 827N/A * @author Sergey A. Malenkov 827N/A * Parses attributes of the element. 827N/A * The following atributes are supported: 827N/A * <dd>the type of object for instantiation 827N/A * <dd>the identifier of the variable that is intended to store the result 827N/A * @param name the attribute name 827N/A * @param value the attribute value 827N/A * Calculates the value of this element 827N/A * if the lentgh attribute is set. 827N/A * Creates an instance of the array. 827N/A * @param type the base class 827N/A * @param args the array of arguments 827N/A * @return the value of this element