老板要求把整个 java包 deprecate掉. 这个以前没弄过. 我想要做的是: 把包下的所有 class, interface deprecate掉; 在package.html里加说明.还有别的要注意的么, 或者还有别的方式? 谢谢
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
You could use sed to mark all classes in the current directory and below (tested in Cygwin). Navigate to the desired folder and run: for file in $(find . -name *.java); do sed -i 's/\(public class\)/@Deprecated\n\1/g' $file; done
To also mark interfaces just add it like this: for file in $(find . -name *.java); do sed -i 's/\(\(public class\|interface\)\)/@Deprecated\n\1/g' $file; done
EDIT
you can do this in Eclipse with the Search/Replace tool. Just mark the resources where you want to perform the operations, then press Ctrl + h. Fill it out like this:
Then, press Replace, and fill it out like this: