KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > js > JavaInnerClass


1 /*
2  * Copyright 2003, 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  */

17 package org.apache.ws.jaxme.js;
18
19
20 /** <p>Implements an inner class.</p>
21  *
22  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
23  */

24 public class JavaInnerClass extends JavaSource {
25   /** <p>Creates a new JavaInnerClass with the given protection.</p>
26    *
27    * @param pPackage The package name; null or empty string indicates
28    * the root package
29    * @param pName The class or interface name
30    * @param pProtection null, "public", "protected" or "private"
31    */

32   JavaInnerClass(JavaSource pOuterClass, JavaQName pName, Protection pProtection) {
33     super(pOuterClass.getFactory(), pName, pProtection);
34     outerClass = pOuterClass;
35   }
36
37   JavaSource outerClass;
38   /** <p>Returns the outer JavaSource instance.</p>
39    */

40   public JavaSource getOuterClass() {
41     return outerClass;
42   }
43
44   /** <p>Throws an exception, as inner classes don't have import
45    * statements.</p>
46    */

47   public void addImport(String JavaDoc s) {
48     throw new IllegalArgumentException JavaDoc("Inner classes must not use the import statement");
49   }
50
51   /** <p>Returns whether this inner class is static.</p>
52    */

53   public boolean getStatic() {
54     return super.getStatic();
55   }
56
57   /** <p>Sets whether this inner class is static.</p>
58    */

59   public void setStatic(boolean pStatic) {
60     super.setStatic(pStatic);
61   }
62
63   /** <p>Returns, whether this is an inner class.</p>
64     */

65   public boolean isInnerClass() {
66       return true;
67   }
68 }
69
Popular Tags