1 18 package org.apache.beehive.netui.compiler.xdoclet.typesystem.impl.type; 19 20 import org.apache.beehive.netui.compiler.typesystem.type.ArrayType; 21 import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; 22 import org.apache.beehive.netui.compiler.xdoclet.typesystem.impl.WrapperFactory; 23 import xjavadoc.Type; 24 25 public class ArrayTypeImpl 26 extends ReferenceTypeImpl 27 implements ArrayType 28 { 29 public ArrayTypeImpl( Type delegate ) 30 { 31 super( delegate ); 32 } 33 34 public TypeInstance getComponentType() 35 { 36 Type componentType = getDelegateType(); 37 int dimension = componentType.getDimension(); 38 assert dimension > 0 : "bad dimension " + dimension + " for array type " + componentType.getType(); 39 return WrapperFactory.get().getTypeInstance( componentType.getType(), dimension - 1 ); 40 } 41 42 public Type getDelegateType() 43 { 44 return ( Type ) super.getDelegate(); 45 } 46 } 47 | Popular Tags |