KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > compiler > xdoclet > 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.xdoclet.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.xdoclet.typesystem.impl.WrapperFactory;
23
24 import java.util.Collection JavaDoc;
25 import java.util.Iterator JavaDoc;
26
27 import xjavadoc.XExecutableMember;
28 import xjavadoc.XParameter;
29
30 public class ExecutableDeclarationImpl
31         extends MemberDeclarationImpl
32         implements ExecutableDeclaration
33 {
34     private ParameterDeclaration[] _parameters;
35     
36     public ExecutableDeclarationImpl( XExecutableMember delegate )
37     {
38         super( delegate );
39     }
40     
41     public ParameterDeclaration[] getParameters()
42     {
43         if ( _parameters == null )
44         {
45             Collection JavaDoc delegateCollection = getDelegateXExecutableMember().getParameters();
46             ParameterDeclaration[] array = new ParameterDeclaration[delegateCollection.size()];
47             int j = 0;
48             for ( Iterator JavaDoc i = delegateCollection.iterator(); i.hasNext(); )
49             {
50                 array[j++] = WrapperFactory.get().getParameterDeclaration( ( XParameter ) i.next() );
51             }
52             _parameters = array;
53         }
54
55         return _parameters;
56     }
57
58     protected XExecutableMember getDelegateXExecutableMember()
59     {
60         return ( XExecutableMember ) super.getDelegate();
61     }
62 }
63
Popular Tags