Skip to content

Commit 34703ac

Browse files
authored
Merge pull request #265 from domaframework/polish-annotation-processing
Polish annotation processing
2 parents fbbd482 + 55e2b4d commit 34703ac

File tree

944 files changed

+12631
-14202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

944 files changed

+12631
-14202
lines changed

src/main/java/org/seasar/doma/internal/apt/AbstractGenerator.java

Lines changed: 0 additions & 177 deletions
This file was deleted.

src/main/java/org/seasar/doma/internal/apt/AbstractProcessor.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

src/main/java/org/seasar/doma/internal/apt/AptException.java

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package org.seasar.doma.internal.apt;
22

3-
import javax.annotation.processing.ProcessingEnvironment;
43
import javax.lang.model.element.AnnotationMirror;
54
import javax.lang.model.element.AnnotationValue;
65
import javax.lang.model.element.Element;
76
import javax.tools.Diagnostic.Kind;
87
import org.seasar.doma.DomaException;
9-
import org.seasar.doma.message.Message;
108
import org.seasar.doma.message.MessageResource;
119

1210
public class AptException extends DomaException {
@@ -21,42 +19,34 @@ public class AptException extends DomaException {
2119

2220
protected AnnotationValue annotationValue;
2321

24-
public AptException(
25-
MessageResource messageResource, ProcessingEnvironment env, Element element, Object[] args) {
26-
this(messageResource, env, Kind.ERROR, element, null, null, null, args);
22+
public AptException(MessageResource messageResource, Element element, Object[] args) {
23+
this(messageResource, Kind.ERROR, element, null, null, null, args);
2724
}
2825

2926
public AptException(
30-
MessageResource messageResource,
31-
ProcessingEnvironment env,
32-
Element element,
33-
Throwable cause,
34-
Object[] args) {
35-
this(messageResource, env, Kind.ERROR, element, null, null, cause, args);
27+
MessageResource messageResource, Element element, Throwable cause, Object[] args) {
28+
this(messageResource, Kind.ERROR, element, null, null, cause, args);
3629
}
3730

3831
public AptException(
3932
MessageResource messageResource,
40-
ProcessingEnvironment env,
4133
Element element,
4234
AnnotationMirror annotationMirror,
4335
Object[] args) {
44-
this(messageResource, env, Kind.ERROR, element, annotationMirror, null, null, args);
36+
this(messageResource, Kind.ERROR, element, annotationMirror, null, null, args);
4537
}
4638

4739
public AptException(
4840
MessageResource messageResource,
49-
ProcessingEnvironment env,
5041
Element element,
5142
AnnotationMirror annotationMirror,
5243
AnnotationValue annotationValue,
5344
Object[] args) {
54-
this(messageResource, env, Kind.ERROR, element, annotationMirror, annotationValue, null, args);
45+
this(messageResource, Kind.ERROR, element, annotationMirror, annotationValue, null, args);
5546
}
5647

5748
private AptException(
5849
MessageResource messageResource,
59-
ProcessingEnvironment env,
6050
Kind kind,
6151
Element element,
6252
AnnotationMirror annotationMirror,
@@ -68,9 +58,6 @@ private AptException(
6858
this.element = element;
6959
this.annotationMirror = annotationMirror;
7060
this.annotationValue = annotationValue;
71-
if (Options.isDebugEnabled(env)) {
72-
Notifier.debug(env, Message.DOMA4074, new Object[] {messageResource, cause});
73-
}
7461
}
7562

7663
public Kind getKind() {

src/main/java/org/seasar/doma/internal/apt/AptTypeHandleException.java

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package org.seasar.doma.internal.apt;
2+
3+
import javax.annotation.processing.ProcessingEnvironment;
4+
import org.seasar.doma.internal.apt.annot.Annotations;
5+
import org.seasar.doma.internal.apt.cttype.CtTypes;
6+
import org.seasar.doma.internal.apt.decl.Declarations;
7+
import org.seasar.doma.internal.apt.generator.ClassNames;
8+
9+
public class Context {
10+
11+
private final ProcessingEnvironment env;
12+
13+
public Context(ProcessingEnvironment env) {
14+
this.env = env;
15+
}
16+
17+
public ProcessingEnvironment getEnv() {
18+
return env;
19+
}
20+
21+
public Elements getElements() {
22+
return new Elements(this);
23+
}
24+
25+
public Types getTypes() {
26+
return new Types(this);
27+
}
28+
29+
public Options getOptions() {
30+
return new Options(this);
31+
}
32+
33+
public Notifier getNotifier() {
34+
return new Notifier(this);
35+
}
36+
37+
public Resources getResources() {
38+
return new Resources(this);
39+
}
40+
41+
public Annotations getAnnotations() {
42+
return new Annotations(this);
43+
}
44+
45+
public Declarations getDeclarations() {
46+
return new Declarations(this);
47+
}
48+
49+
public CtTypes getCtTypes() {
50+
return new CtTypes(this);
51+
}
52+
53+
public ClassNames getClassNames() {
54+
return new ClassNames(this);
55+
}
56+
}

0 commit comments

Comments
 (0)