1 /*2 * Copyright 2004 The Apache Software Foundation.3 *4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 *16 * $Header:$17 */18 package org.apache.beehive.netui.compiler.typesystem.impl.declaration;19 20 import org.apache.beehive.netui.compiler.typesystem.declaration.PackageDeclaration;21 import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration;22 import org.apache.beehive.netui.compiler.typesystem.impl.WrapperFactory;23 import org.apache.beehive.netui.compiler.typesystem.impl.DelegatingImpl;24 25 import java.util.Collection ;26 27 public class PackageDeclarationImpl28 extends DelegatingImpl29 implements PackageDeclaration30 {31 private ClassDeclaration[] _classes;32 33 public PackageDeclarationImpl( com.sun.mirror.declaration.PackageDeclaration delegate )34 {35 super( delegate );36 }37 38 public String getQualifiedName()39 {40 return getDelegate().getQualifiedName();41 }42 43 public ClassDeclaration[] getClasses()44 {45 if ( _classes == null )46 {47 Collection <com.sun.mirror.declaration.ClassDeclaration> delegateCollection = getDelegate().getClasses();48 ClassDeclaration[] array = new ClassDeclaration[delegateCollection.size()];49 int j = 0;50 for ( com.sun.mirror.declaration.ClassDeclaration i : delegateCollection )51 {52 array[j++] = WrapperFactory.get().getClassDeclaration( i );53 }54 _classes = array;55 }56 57 return _classes;58 }59 60 protected com.sun.mirror.declaration.PackageDeclaration getDelegate()61 {62 return ( com.sun.mirror.declaration.PackageDeclaration ) super.getDelegate();63 }64 }65