各位开发中常用哪些注解?

2016 年 10 月 11 日
 andreby
5606 次点击
所在节点    Java
29 条回复
CFO
2016 年 10 月 11 日
我来给你召唤个人 @override
caomaocao
2016 年 10 月 11 日
auin
2016 年 10 月 11 日
misaka19000
2016 年 10 月 11 日
acoder2013
2016 年 10 月 11 日
Lucups
2016 年 10 月 11 日
sudoz
2016 年 10 月 11 日
leopku
2016 年 10 月 11 日
awolfly9
2016 年 10 月 11 日
@TODO... @Debug...
liuhao2050qq
2016 年 10 月 11 日
@login_required 逃。。
macfee
2016 年 10 月 11 日
bwangel
2016 年 10 月 11 日
Pythoner 路过,偷偷召唤一下 @property
yidinghe
2016 年 10 月 11 日
sherlocktheplant
2016 年 10 月 11 日
居然没有 @Inject @Autowired
lzhd24
2016 年 10 月 11 日
acros
2016 年 10 月 11 日
//Hack
//Warning
//TODO
//Temporary Code
//Only For Debug
//WTF?
//Need polish
//Need refactor

// Date - 20xx-xx-xx
BOOM
2016 年 10 月 11 日
@macfee note7 是不是爱死我了
sutra
2016 年 10 月 11 日
$ find . -iname '*.java' | xargs sed -n 's/.*\(@[a-zA-Z0-9]\{1,\}\).*/\1/p' | sort | uniq -c | sort -nr | pbcopy

173 @Override
143 @inheritDoc
127 @Column
63 @Autowired
43 @RequestMapping
41 @param
36 @Generated
35 @RolesAllowed
27 @PathVariable
26 @Service
24 @Nullable
24 @Nonnull
23 @Path
23 @Bean
21 @link
20 @return
18 @StaticMetamodel
18 @Access
16 @Transient
16 @Transactional
16 @ForeignKey
16 @Controller
15 @GET
14 @Entity
13 @Table
12 @XmlTransient
12 @RequestParam
12 @BeanParam
10 @XmlRootElement
9 @ManyToOne
9 @JoinColumn
8 @Version
7 @UniqueConstraint
7 @SuppressWarnings
7 @Produces
7 @PathParam
6 @OneToOne
5 @Test
5 @SortableField
5 @POST
5 @ModelAttribute
5 @Field
5 @ConfigurationProperties
4 @throws
4 @see
4 @MappedSuperclass
4 @JsonIgnoreProperties
4 @Consumes
4 @Configuration
4 @ComponentScan
3 @Scheduled
3 @QueryParam
3 @Query
3 @EnableJpaAuditing
3 @EnableAspectJAutoProxy
3 @Context
3 @Component
2 @Type
2 @Singleton
2 @Provider
2 @Profile
2 @PreAuthorize
2 @PersistenceContext
2 @Parameter
2 @PUT
2 @Id
2 @GenericGenerator
2 @GeneratedValue
2 @EntityScan
2 @EnableScheduling
2 @EnableJpaRepositories
2 @EnableAutoConfiguration
2 @DefaultValue
2 @DateBridge
2 @CacheResult
1 @literal
1 @io
1 @author
1 @SpringBootApplication
1 @Resource
1 @Qualifier
1 @OrderBy
1 @Order
1 @OneToMany
1 @ManyToMany
1 @LastModifiedDate
1 @LastModifiedBy
1 @JoinTable
1 @Indexed
1 @ImportResource
1 @EntityListeners
1 @EnableWebSecurity
1 @EnableJms
1 @EnableGlobalMethodSecurity
1 @EnableCaching
1 @DELETE
1 @CreatedDate
1 @CreatedBy
1 @Analyzer
sutra
2016 年 10 月 11 日
修正一下:利用大写开头排除掉注释里的 @param @return 等,支持下划线

$ find . -iname '*.java' | xargs sed -n 's/.*\(@[A-Z][a-zA-Z0-9_]\{0,\}\).*/\1/p' | sort | uniq -c | sort -nr | pbcopy

173 @Override
127 @Column
63 @Autowired
43 @RequestMapping
36 @Generated
35 @RolesAllowed
27 @PathVariable
26 @Service
24 @Nullable
24 @Nonnull
23 @Path
23 @Bean
18 @StaticMetamodel
18 @Access
16 @Transient
16 @Transactional
16 @ForeignKey
16 @Controller
15 @GET
14 @Entity
13 @Table
12 @XmlTransient
12 @RequestParam
12 @BeanParam
10 @XmlRootElement
9 @ManyToOne
9 @JoinColumn
8 @Version
7 @UniqueConstraint
7 @SuppressWarnings
7 @Produces
7 @PathParam
6 @OneToOne
5 @Test
5 @SortableField
5 @POST
5 @ModelAttribute
5 @Field
5 @ConfigurationProperties
4 @MappedSuperclass
4 @JsonIgnoreProperties
4 @Consumes
4 @Configuration
4 @ComponentScan
3 @Scheduled
3 @QueryParam
3 @Query
3 @EnableJpaAuditing
3 @EnableAspectJAutoProxy
3 @Context
3 @Component
2 @Type
2 @Singleton
2 @Provider
2 @Profile
2 @PreAuthorize
2 @PersistenceContext
2 @Parameter
2 @PUT
2 @Id
2 @GenericGenerator
2 @GeneratedValue
2 @EntityScan
2 @EnableScheduling
2 @EnableJpaRepositories
2 @EnableAutoConfiguration
2 @DefaultValue
2 @DateBridge
2 @CacheResult
1 @SpringBootApplication
1 @Resource
1 @Qualifier
1 @OrderBy
1 @Order
1 @OneToMany
1 @ManyToMany
1 @LastModifiedDate
1 @LastModifiedBy
1 @JoinTable
1 @Indexed
1 @ImportResource
1 @EntityListeners
1 @EnableWebSecurity
1 @EnableJms
1 @EnableGlobalMethodSecurity
1 @EnableCaching
1 @DELETE
1 @CreatedDate
1 @CreatedBy
1 @Analyzer
zhenizhui
2016 年 10 月 11 日
这得 at 多少人出来。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://study.congcong.us/t/311804

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX