大佬教程收集整理的这篇文章主要介绍了java – 自动将Spring @RequestMapping注释记录到一个位置?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
Filer.createResource(...)
实际上应该可以开箱即用.
@H_197_1@这是一个基本的实现:
@H_197_1@
public class requestMappingProcessor extends AbstractProcessor{
private final Map extends="" typeelement>="" annotations,final="" roundenvironment="" roundenv){="" for(final="" typeelement="" annotatedelement="" :="" annotations){="" final="" requestmapping="" mapping="annotatedElement.getAnnotation(" requestmapping.class="" );="" if(mapping="" !="null){" addmapping(mapping,annotatedelement,roundenv);="" }="" }="" assemblesitemap();="" return="" false;="" }="" private="" void="" assemblesitemap(){="" writer="" writer="null;" boolean="" threw="false;" try{="" final="" fileobject="" fileobject="filer.createResource(" standardlocation.class_output,"html","sitemap.html"="" );="" writer="fileObject.openWriter();"?> IoUtils.closeQuietly(writer)
// with Guava: Closeables.close(writer,rethrow)
// with plain Java this monstrosity:
try{
if(writer != null){
writer.close();
}
} catch(final IOException E){
if(!threw){
throw new IllegalStateException(E);
}
} finally{
}
}
}
private void addMapping(final requestMapping mapping,final TypeElement AnnotatedElement,final RoundEnvironment roundEnv){
final String[] values = mapping.value();
for(final String value : values){
ma@R_197_11304@ut(
value,AnnotatedElement.getQualifiedName().toString()
);
}
}
}
以上是大佬教程为你收集整理的java – 自动将Spring @RequestMapping注释记录到一个位置?全部内容,希望文章能够帮你解决java – 自动将Spring @RequestMapping注释记录到一个位置?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。