1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.sw4j.tool.annotation.jpa.test.mock.annotation.processing;
18
19 import java.util.HashMap;
20 import java.util.Locale;
21 import java.util.Map;
22 import javax.annotation.processing.Filer;
23 import javax.annotation.processing.Messager;
24 import javax.annotation.processing.ProcessingEnvironment;
25 import javax.lang.model.SourceVersion;
26 import javax.lang.model.util.Elements;
27 import javax.lang.model.util.Types;
28
29
30
31
32
33
34 public class ProcessingEnvironmentMock implements ProcessingEnvironment {
35
36 private final Map<String, String> options;
37
38 private final Messager messager;
39
40 private final Types types;
41
42 public ProcessingEnvironmentMock() {
43 this(new HashMap<String, String>(), new MessagerMock(), null);
44 }
45
46 public ProcessingEnvironmentMock(final Messager messager, final Types types) {
47 this(new HashMap<String, String>(), messager, types);
48 }
49
50 public ProcessingEnvironmentMock(final Map<String, String> options, final Messager messager) {
51 this(options, messager, null);
52 }
53
54 public ProcessingEnvironmentMock(final Map<String, String> options, final Messager messager, final Types types) {
55 this.options = options;
56 this.messager = messager;
57 this.types = types;
58 }
59
60 @Override
61 public Map<String, String> getOptions() {
62 return this.options;
63 }
64
65 @Override
66 public Messager getMessager() {
67 return messager;
68 }
69
70 @Override
71 public Filer getFiler() {
72 throw new UnsupportedOperationException("Not supported yet.");
73 }
74
75 @Override
76 public Elements getElementUtils() {
77 throw new UnsupportedOperationException("Not supported yet.");
78 }
79
80 @Override
81 public Types getTypeUtils() {
82 return this.types;
83 }
84
85 @Override
86 public SourceVersion getSourceVersion() {
87 throw new UnsupportedOperationException("Not supported yet.");
88 }
89
90 @Override
91 public Locale getLocale() {
92 throw new UnsupportedOperationException("Not supported yet.");
93 }
94
95 }