注釈ツール

InterceptorUtilsツール:

パブリック クラスInterceptorUtils { 

    プライベート 静的ロガーロガー=のgetLogger(InterceptorUtils。クラス)。

    プライベートInterceptorUtils(){ 
    } 

    パブリック 静的 <AはAnnotation> 拡張 A getAnnotation(オブジェクトハンドラクラス<A> annotationClass){
         場合(!(ハンドラのinstanceof HandlerMethod)){
             リターン ヌルを
        } 

        HandlerMethod handlerMethod = (HandlerMethod)ハンドラ。
        結果; 
        もし(!(結果= AnnotationUtils.findAnnotation(handlerMethod.getMethod()、annotationClass))= NULL ){ 
            logger.trace( "メソッドレベルで見出さ[{}]注釈:{}" 
                    annotationClass.getSimpleName()、handlerMethod。 getMethod()メソッド)。
        } {
             もし、((結果= AnnotationUtils.findAnnotation(handlerMethod.getBeanType()、annotationClass))!= NULL ){ 
                logger.trace( "見つかりました[{}]タイプレベルで注釈:{}" 
                        annotationClass.getSimpleName( )、handlerMethod.getBeanType())。
            } 
        } 
        リターン結果; 
    } 

}

 

おすすめ

転載: www.cnblogs.com/koushr/p/11908131.html