File tree Expand file tree Collapse file tree 5 files changed +39
-40
lines changed Expand file tree Collapse file tree 5 files changed +39
-40
lines changed Original file line number Diff line number Diff line change 11inspecting field brandName
2- @ MyColumnBase(name="BRAND_NAME")
2+ interface MyColumnBase
33inspecting field companyName
4- @ MyColumnBase(name="COMPANY_NAME")
4+ interface MyColumnBase
55inspecting method brandName
66inspecting method companyName
77inspecting constructor MyTable
Original file line number Diff line number Diff line change @@ -8,29 +8,3 @@ class MyTable(
88 @ MyColumn (name= " COMPANY_NAME" )
99 val companyName : String ,
1010)
11-
12- object Test :
13- def main (args : Array [String ]): Unit =
14- val clasz = classOf [MyTable ]
15-
16- for (m <- clasz.getDeclaredFields.sortBy(_.getName)) {
17- m.setAccessible(true )
18- println(s " inspecting field ${m.getName}" )
19- for a <- m.getAnnotations().sortBy(_.toString) do
20- println(a)
21- }
22-
23- for (m <- clasz.getDeclaredMethods.sortBy(_.getName)) {
24- m.setAccessible(true )
25- println(s " inspecting method ${m.getName}" )
26- for a <- m.getAnnotations().sortBy(_.toString) do
27- println(a)
28- }
29-
30- for c <- clasz.getDeclaredConstructors.sortBy(_.getName) do
31- c.setAccessible(true )
32- println(s " inspecting constructor ${c.getName}" )
33- for p <- c.getParameters.sortBy(_.getName) do
34- println(s " inspecting param ${p.getName}" )
35- for a <- p.getAnnotations.sortBy(_.toString) do
36- println(s " annotation $a" )
Original file line number Diff line number Diff line change 1+ object Test :
2+ def main (args : Array [String ]): Unit =
3+ val cls = classOf [MyTable ]
4+
5+ for (m <- cls.getDeclaredFields.sortBy(_.getName)) {
6+ m.setAccessible(true )
7+ println(s " inspecting field ${m.getName}" )
8+ for a <- m.getAnnotations().sortBy(_.annotationType.toString) do
9+ println(a.annotationType)
10+ }
11+
12+ for (m <- cls.getDeclaredMethods.sortBy(_.getName)) {
13+ m.setAccessible(true )
14+ println(s " inspecting method ${m.getName}" )
15+ for a <- m.getAnnotations().sortBy(_.annotationType.toString) do
16+ println(a.annotationType)
17+ }
18+
19+ for c <- cls.getDeclaredConstructors.sortBy(_.getName) do
20+ c.setAccessible(true )
21+ println(s " inspecting constructor ${c.getName}" )
22+ for p <- c.getParameters.sortBy(_.getName) do
23+ println(s " inspecting param ${p.getName}" )
24+ for a <- p.getAnnotations.sortBy(_.annotationType.toString) do
25+ println(a.annotationType)
Original file line number Diff line number Diff line change 11inspecting field value
2- @ JsonProperty(value="REAL_VALUE")
2+ interface JsonProperty
33inspecting method getValue
4- @ JsonProperty(value="REAL_VALUE")
4+ interface JsonProperty
55inspecting method setValue
66inspecting method value
77inspecting method value_$eq
Original file line number Diff line number Diff line change 11object Test :
22 def main (args : Array [String ]): Unit =
3- val clasz = classOf [TestBeanProperty ]
3+ val cls = classOf [TestBeanProperty ]
44
5- for (m <- clasz .getDeclaredFields.sortBy(_.getName)) {
5+ for (m <- cls .getDeclaredFields.sortBy(_.getName)) {
66 m.setAccessible(true )
77 println(s " inspecting field ${m.getName}" )
8- for a <- m.getAnnotations().sortBy(_.toString) do
9- println(a)
8+ for a <- m.getAnnotations().sortBy(_.annotationType. toString) do
9+ println(a.annotationType )
1010 }
1111
12- for (m <- clasz .getDeclaredMethods.sortBy(_.getName)) {
12+ for (m <- cls .getDeclaredMethods.sortBy(_.getName)) {
1313 m.setAccessible(true )
1414 println(s " inspecting method ${m.getName}" )
15- for a <- m.getAnnotations().sortBy(_.toString) do
16- println(a)
15+ for a <- m.getAnnotations().sortBy(_.annotationType. toString) do
16+ println(a.annotationType )
1717 }
1818
19- for c <- clasz .getDeclaredConstructors.sortBy(_.getName) do
19+ for c <- cls .getDeclaredConstructors.sortBy(_.getName) do
2020 c.setAccessible(true )
2121 println(s " inspecting constructor ${c.getName}" )
2222 for p <- c.getParameters.sortBy(_.getName) do
2323 println(s " inspecting param ${p.getName}" )
24- for a <- p.getAnnotations.sortBy(_.toString) do
25- println(s " annotation $a " )
24+ for a <- p.getAnnotations.sortBy(_.annotationType. toString) do
25+ println(a.annotationType )
You can’t perform that action at this time.
0 commit comments