1mod compilation_unit;
2mod documentation_comment;
3mod import;
4mod module;
5mod package;
6mod top_level;
7
8use std::{
9 borrow::Cow,
10 fmt::{Display, Formatter, Result as FmtResult},
11};
12pub use {
13 compilation_unit::*, documentation_comment::*, import::*, module::*, package::*, top_level::*,
14};
15
16#[derive(Debug)]
17pub struct ClassDeclaration<'a> {
18 pub name: Cow<'a, str>,
19 pub documentation: Option<DocumentationComment<'a>>,
22 }
24
25impl<'a> Display for ClassDeclaration<'a> {
26 fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
27 if let Some(ref d) = self.documentation {
28 Display::fmt(d, f)?;
29 }
30 write!(f, "class {}", self.name)
31 }
32}
33
34#[derive(Debug)]
35pub struct EnumDeclaration<'a> {
36 pub name: Cow<'a, str>,
37 pub documentation: Option<DocumentationComment<'a>>,
41 }
43
44impl<'a> Display for EnumDeclaration<'a> {
45 fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
46 if let Some(ref d) = self.documentation {
47 Display::fmt(d, f)?;
48 }
49 write!(f, "enum {}", self.name)
50 }
51}
52
53#[derive(Debug)]
54pub struct InterfaceDeclaration<'a> {
55 pub name: Cow<'a, str>,
56 pub documentation: Option<DocumentationComment<'a>>,
59 }
61
62impl<'a> Display for InterfaceDeclaration<'a> {
63 fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
64 if let Some(ref d) = self.documentation {
65 Display::fmt(d, f)?;
66 }
67 write!(f, "interface {}", self.name)
68 }
69}
70
71#[derive(Debug)]
72pub struct AnnotationDeclaration<'a> {
73 pub name: Cow<'a, str>,
74 pub documentation: Option<DocumentationComment<'a>>,
76 }
78
79impl<'a> Display for AnnotationDeclaration<'a> {
80 fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
81 if let Some(ref d) = self.documentation {
82 Display::fmt(d, f)?;
83 }
84 write!(f, "@interface {}", self.name)
85 }
86}
87
88pub trait BasicType {
89 }
91
92pub trait ReferenceType {
93 }
95
96pub trait TypeArgument {
97 }
99
100pub trait TypeParameter {
101 }
103
104#[derive(Debug, PartialEq)]
105pub struct Annotation<'a> {
106 pub name: Cow<'a, str>,
107 }
109
110impl<'a> Display for Annotation<'a> {
111 fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
112 write!(f, "@{}", self.name)
113 }
114}
115
116pub trait ElementValuePair {
117 }
119
120pub trait ElementArrayValue {
121 }
123
124pub trait MethodDeclaration {
126 }
128
129pub trait FieldDeclaration {
131 }
133
134pub trait ConstructorDeclaration {
135 }
137
138pub trait ConstantDeclaration: FieldDeclaration {}
139
140pub trait ArrayInitializer {
141 }
143
144pub trait VariableDeclaration {
145 }
147
148pub trait LocalVariableDeclaration: VariableDeclaration {}
149
150pub trait VariableDeclarator {
151 }
153
154pub trait FormalParameter {
155 }
157
158pub trait InferredFormalParameter {
159 }
161
162pub trait IfStatement {
163 }
165
166pub trait WhileStatement {
167 }
169
170pub trait DoStatement {
171 }
173
174pub trait ForStatement {
175 }
177
178pub trait AssertStatement {
179 }
181
182pub trait BreakStatement {
183 }
185
186pub trait ContinueStatement {
187 }
189
190pub trait ReturnStatement {
191 }
193
194pub trait ThrowStatement {
195 }
197
198pub trait SynchronizedStatement {
199 }
201
202pub trait TryStatement {
203 }
205
206pub trait SwitchStatement {
207 }
209
210pub trait BlockStatement {
211 }
213
214pub trait StatementExpression {
215 }
217
218pub trait TryResource {
219 }
221
222pub trait CatchClause {
223 }
225
226pub trait CatchClauseParameter {
227 }
229
230pub trait SwitchStatementCase {
231 }
233
234pub trait ForControl {
235 }
237
238pub trait EnhancedForControl {
239 }
241
242pub trait Expression {}
243
244pub trait Assignment: Expression {
245 }
247
248pub trait TernaryExpression: Expression {
249 }
251
252pub trait BinaryOperation: Expression {
253 }
255
256pub trait Cast: Expression {
257 }
259
260pub trait MethodReference: Expression {
261 }
263
264pub trait LambdaExpression: Expression {
265 }
267
268pub trait Primary: Expression {
269 }
271
272pub trait Literal: Primary {
273 }
275
276pub trait This: Primary {}
277
278pub trait MemberReference: Primary {
279 }
281
282pub trait Invocation: Primary {
283 }
285
286pub trait ExplicitConstructorInvocation: Invocation {}
287
288pub trait SuperConstructorInvocation: Invocation {}
289
290pub trait MethodInvocation: Invocation {
291 }
293
294pub trait SuperMethodInvocation: Invocation {
295 }
297
298pub trait SuperMemberReference: Primary {
299 }
301
302pub trait ArraySelector: Expression {
303 }
305
306pub trait ClassReference: Primary {
307 }
309
310pub trait VoidClassReference: ClassReference {}
311
312pub trait Creator: Primary {
313 }
315
316pub trait ArrayCreator: Creator {
317 }
319
320pub trait ClassCreator: Creator {
321 }
323
324pub trait InnerClassCreator: Creator {
325 }
327
328pub trait EnumBody {
329 }
331
332pub trait EnumConstantDeclaration {
333 }
335
336pub trait AnnotationMethod {
337 fn name(&self) {}
339}