APT(注释处理工具) [英] APT (Annotation Processing Tool)

查看:176
本文介绍了APT(注释处理工具)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试图找到简单的例子来理解容易命令的用法,但我无法找到这个有用的资源。

I was trying to find simple example to understand the usage of apt command, but I couldn't find a helpful resource for this.

我已经提到这个入门注释处理工具但我得到一个高层次的理解。而且我想写一个code测试贴切命令。有人可以张贴一个简单的例子,或更好的链路是指?

I have referred this Getting Started with the Annotation Processing Tool but I do get a high level understanding. Moreover I want to write a code to test apt command. Can somebody post a simple example or better link to refer?

推荐答案

下面是创建一个注的例子注释和相关的处理器:

Here's an example of creating a Note annotation and associated processor:

APT:编译时的注解处理与Java

更新。从Java 1.7的:

的JSR 269,也被称为语言模型的API,有两个基本部分组成:一个API模型Java编程语言,以及用于写入注解处理器的API。此功能是通过新的选项,javac命令访问;通过包括JSR 269的支持,现在的javac类似行为的恰当命令JDK 5。

JSR 269, also known as the Language Model API, has two basic pieces: an API that models the Java programming language, and an API for writing annotation processors. This functionality is accessed through new options to the javac command; by including JSR 269 support, javac now acts analogously to the apt command in JDK 5.

这篇关于APT(注释处理工具)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆