一、简介

每次面试都被怼spring源码你看过吗?你用spring开发源码你都不看的吗?这样怎么开发?那我就下点决心,趁着现在疫情在家宅,我要看spring源代码。但是发现注释都是英文,勉勉强强能看懂,但是很多地方需要查字典,平均一分钟左右查1-2个单词,令人头痛,所以用Python写了个自动化工具,将Java代码中的多行注释自动机翻。

项目地址在这里,记得来点亮小星星哦

二、效果

/** Generated by english-annotation-buster, Powered by Google Translate.**/
/*
 * Copyright 2002-2016 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * 版权所有2002-2016的原始作者。
 * 根据Apache许可证2.0版("许可证")获得许可;
 * 除非遵守许可,否则不得使用此文件。
 * 您可以在https://www.apache.org/licenses/LICENSE-2.0上获得许可的副本。
 * 除非适用法律要求或以书面形式同意,否则根据"许可"分发的软件将按"现状"分发,没有任何明示或暗示的保证或条件。
 * 有关许可下特定的语言管理权限和限制,请参阅许可。
 *
 */

package org.aopalliance.intercept;

/**
 * Intercepts the construction of a new object.
 *
 * <p>The user should implement the {@link
 * #construct(ConstructorInvocation)} method to modify the original
 * behavior. E.g. the following class implements a singleton
 * interceptor (allows only one unique instance for the intercepted
 * class):
 *
 * <pre class="code">
 * class DebuggingInterceptor implements ConstructorInterceptor {
 *   Object instance=null;
 *
 *   Object construct(ConstructorInvocation i) throws Throwable {
 *     if(instance==null) {
 *       return instance=i.proceed();
 *     } else {
 *       throw new Exception("singleton does not allow multiple instance");
 *     }
 *   }
 * }
 * </pre>
 *
 * @author Rod Johnson
 */
/**
 * 拦截新对象的构造。
 *  <p>用户应实现{@link  #construct(ConstructorInvocation)}方法以修改原始行为。
 * 例如。
 * 以下类实现了单例拦截器(被拦截的类仅允许一个唯一的实例):<pre class = code>类DebuggingInterceptor实现了ConstructorInterceptor {Object instance = null;对象的construct(ConstructorInvocation i)抛出Throwable {if(instance == null){return instance = i.proceed(); } else {抛出新异常("单个不允许多个实例"));
 *  }}} </ pre> @author  Rod Johnson
 */
public interface ConstructorInterceptor extends Interceptor  {

    /**
     * Implement this method to perform extra treatments before and
     * after the construction of a new object. Polite implementations
     * would certainly like to invoke {@link Joinpoint#proceed()}.
     * @param invocation the construction joinpoint
     * @return the newly created object, which is also the result of
     * the call to {@link Joinpoint#proceed()}; might be replaced by
     * the interceptor
     * @throws Throwable if the interceptors or the target object
     * throws an exception
     */
    /**
     * 实施此方法可以在构造新对象之前和之后执行额外的处理。
     * 礼貌的实现当然想调用{@link  Joinpoint#proceed()}。
     *  @param调用构造连接点
     * @return 新创建的对象,这也是对{@link  Joinpoint#proceed()}的调用的结果。
     * 如果拦截器或目标对象引发异常,则可将其替换为拦截器
     * @throws 可抛出
     */
    Object construct(ConstructorInvocation invocation) throws Throwable;

}  

三、希望有需求的各位一起改善

使用方法和相关信息在Github的readme中已经描述了,这里不做过多描述,有需求的小伙伴可以多提一些pr改善下,谢谢各位。

四、立一个flag

花3w天干翻spring-framework。

java注释英语自动机翻的更多相关文章

  1. Java常用英语汇总(面试必备)

    Java常用英语汇总(面试必备) abstract (关键字)             抽象 ['.bstr.kt] access                            vt.访问,存 ...

  2. [java] 注释以及javadoc使用简介-汇率换算器的实现-插曲3

    [java] 注释以及javadoc使用简介-汇率换算器的实现-插曲3 // */ // ]]>   [java] 注释以及javadoc使用简介-汇率换算器的实现-插曲3 Table of C ...

  3. java注释规范

    前言:      现在java的出产地sun公司并没有定义一个java注释规范,注释规范目前是每个公司自己有自己的一套规范,主要是为了团队之间的协作. 1.基本规则      1.注释应该使代码更加清 ...

  4. 【转】Eclipse Java注释模板设置详解

    Eclipse Java注释模板设置详解   设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后 ...

  5. JAVA基础英语单词表(下)

    quantity                     / 'kwɔntiti /                    量,数量 query                             ...

  6. java注释 命名 数据类型 基本类型转换 位运算符 逻辑运算符 三目运算符

    一.java注释 1.单行注释  //注释内容 2.多行注释 /*注释内容*/ 3.文档注释(可用javadoc工具生成api文档,不过我还没试过)/**文档注释*/,文档注释可以在使用的时候看见注释 ...

  7. Java语言基础(三) Java注释

    Java注释 Java提供了三种注释的方式: ①单行注释:// ②多行注释:/*  ...  */ ③归档(JavaDoc)注释: /** * 作者:heyiyong * 时间:2013年11月27日 ...

  8. java编程规范之java注释规范

    代码要是没有注释,对读者来说就是一堆乱七八糟的字母,为了提高代码的可读性和可维护性,必须对代码进行必要的注释,这里小编整理了一下java注释规范. (一)技巧 1:注释当前行快捷方式:ctrl+/ 2 ...

  9. Java注释用处

    1.Java注释: import cn.lonecloud.Doc; /** * Created by lonecloud on 2017/8/17. * 测试注释类型 {@link Doc#test ...

随机推荐

  1. [CQOI2015]选数(莫比乌斯反演,杜教筛)

    [CQOI2015]选数(luogu) Description 题目描述 我们知道,从区间 [L,H](L 和 H 为整数)中选取 N 个整数,总共有 (H-L+1)^N 种方案. 小 z 很好奇这样 ...

  2. Java @Deprecated Annotation(注解)

    在本部分的快速指南中,我们将会查看 Java 的 deprecated API 和如何在程序中使用 @Deprecated 注解. @Deprecated Annotation(注解) 作为程序的进化 ...

  3. 「Flink」理解流式处理重要概念

    什么是流式处理呢? 这个问题其实我们大部分时候是没有考虑过的,大多数,我们是把流式处理和实时计算放在一起来说的.我们先来了解下,什么是数据流. 数据流(事件流) 数据流是无边界数据集的抽象 我们之前接 ...

  4. mysql必知必会--联 结 表

    联结 SQL最强大的功能之一就是能在数据检索查询的执行中联结(join) 表.联结是利用SQL的 SELECT 能执行的最重要的操作,很好地理解联结 及其语法是学习SQL的一个极为重要的组成部分 外键 ...

  5. Android5.1 WebView遇坑笔记-Resources$NotFoundException

    Bugly遇到异常 查找原因,分析发现崩溃发生在Android版本21和22上,在网上查找资料发现下面解决方案 使用自定义WebView替换原生自带WebView解决 package com.test ...

  6. Dijkstra算法2

    // 再来一手精髓的Dijkstra // 复杂度O( E*log(V) ) #include <cstdio> #include <iostream> #include &l ...

  7. 抽取vs2010安装包中vc++ runtime

    写于2015-3-21 16:59 由qq空间转过来,格式有点乱     之前遇到一个问题,c++\cli的程序部署在服务器上面,程序运行后没有反应就退出了,日志管理器中记录两个错误信息分别如下:   ...

  8. RAID | 故障处理

    RAID | 故障处理 Unconfigured(good), Spun Up 背景:磁盘替换后在导入外部配置时提示失败,磁盘状态如题. MegaCli -pdgetmissing -a0查看miss ...

  9. go并发版爬虫

    并发版爬虫 代码实现 /crawler/main.go package main import ( "learn/crawler/engine" "learn/crawl ...

  10. 二维数组的生成-new的使用

    相关的思路来自于下面这个博客:https://blog.csdn.net/samuelcoulee/article/details/8674388 我们对于其中的一个方案进行了实现与测试——借助new ...