bugfix
[javainspect.git] / src / main / java / eu / svjatoslav / inspector / java / methods / Annotation.java
1 package eu.svjatoslav.inspector.java.methods;
2
3 import eu.svjatoslav.commons.string.tokenizer.InvalidSyntaxException;
4 import eu.svjatoslav.commons.string.tokenizer.Tokenizer;
5 import eu.svjatoslav.commons.string.tokenizer.TokenizerMatch;
6
7 public class Annotation {
8
9         private String name;
10
11         public Annotation(final Tokenizer tokenizer) throws InvalidSyntaxException {
12
13                 name = tokenizer.getNextToken().token;
14
15                 if (!tokenizer.probeNextToken("("))
16                         return;
17
18                 int depth = 1;
19
20                 while (true) {
21                         final TokenizerMatch token = tokenizer.getNextToken();
22
23                         if (token == null)
24                                 return;
25
26                         if ("(".equals(token.token))
27                                 depth++;
28                         if (")".equals(token.token))
29                                 depth--;
30
31                         if (depth == 0)
32                                 return;
33                 }
34
35         }
36
37 }