KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > compiler > typesystem > impl > declaration > ExecutableDeclarationImpl


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 at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * 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 and
14  * 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.ExecutableDeclaration;
21 import org.apache.beehive.netui.compiler.typesystem.declaration.ParameterDeclaration;
22 import org.apache.beehive.netui.compiler.typesystem.impl.WrapperFactory;
23
24 import java.util.Collection JavaDoc;
25
26 public class ExecutableDeclarationImpl
27         extends MemberDeclarationImpl
28         implements ExecutableDeclaration
29 {
30     private ParameterDeclaration[] _parameters;
31     
32     public ExecutableDeclarationImpl( com.sun.mirror.declaration.ExecutableDeclaration delegate )
33     {
34         super( delegate );
35     }
36     
37     public boolean isVarArgs()
38     {
39         return getDelegate().isVarArgs();
40     }
41
42     /*
43     public TypeParameterDeclaration[] getFormalTypeParameters()
44     {
45     }
46     */

47
48     public ParameterDeclaration[] getParameters()
49     {
50         if ( _parameters == null )
51         {
52             Collection JavaDoc<com.sun.mirror.declaration.ParameterDeclaration> delegateCollection = getDelegate().getParameters();
53             ParameterDeclaration[] array = new ParameterDeclaration[delegateCollection.size()];
54             int j = 0;
55             for ( com.sun.mirror.declaration.ParameterDeclaration i : delegateCollection )
56             {
57                 array[j++] = WrapperFactory.get().getParameterDeclaration( i );
58             }
59             _parameters = array;
60         }
61
62         return _parameters;
63     }
64
65     /*
66     public ReferenceType[] getThrownTypes()
67     {
68     }
69     */

70     
71     protected com.sun.mirror.declaration.ExecutableDeclaration getDelegate()
72     {
73         return ( com.sun.mirror.declaration.ExecutableDeclaration ) super.getDelegate();
74     }
75 }
76
Popular Tags