1 package org.apache.maven.jxr.pacman;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.ArrayList;
23 import java.util.List;
24 import java.util.Vector;
25
26
27
28
29
30
31
32 public abstract class JavaFile
33 {
34
35 private Vector imports = new Vector();
36
37 private ArrayList classTypes = new ArrayList();
38
39 private PackageType packageType = new PackageType();
40
41 private String filename = null;
42
43 private String encoding = null;
44
45
46
47
48 public ImportType[] getImportTypes()
49 {
50
51 ImportType[] it = new ImportType[this.imports.size()];
52 this.imports.copyInto( it );
53 return it;
54 }
55
56
57
58
59 public ClassType getClassType()
60 {
61 if ( classTypes.isEmpty() )
62 {
63 return null;
64 }
65 else
66 {
67
68 return (ClassType) this.classTypes.get( 0 );
69 }
70 }
71
72
73
74
75 public List getClassTypes()
76 {
77 return this.classTypes;
78 }
79
80
81
82
83 public PackageType getPackageType()
84 {
85 return this.packageType;
86 }
87
88
89
90
91
92 public void addClassType( ClassType classType )
93 {
94 this.classTypes.add( classType );
95 }
96
97
98
99
100 public void addImportType( ImportType importType )
101 {
102 this.imports.addElement( importType );
103 }
104
105
106
107
108 public void setClassType( ClassType classType )
109 {
110
111 this.classTypes.clear();
112 this.classTypes.add( classType );
113 }
114
115
116
117
118 public void setPackageType( PackageType packageType )
119 {
120 this.packageType = packageType;
121 }
122
123
124
125
126
127 public String getFilename()
128 {
129 return this.filename;
130 }
131
132
133
134
135 public void setFilename( String filename )
136 {
137 this.filename = filename;
138 }
139
140
141
142
143
144 public String getEncoding()
145 {
146 return this.encoding;
147 }
148
149
150
151
152 public void setEncoding( String encoding )
153 {
154 this.encoding = encoding;
155 }
156 }