一、简介

每次面试都被怼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. 基于 webGL 的元素周期表 3D 交互展示

    前言 之前在网上看到别人写的有关元素周期表的文章,深深的勾起了一波回忆,记忆里初中时期背的“氢氦锂铍硼,碳氮氧氟氖,钠镁铝硅磷,硫氯氩钾钙”.“养(氧)龟(硅)铝铁盖(钙),哪(钠)家(钾)没(镁)青 ...

  2. Pythone是什么鬼?

    认识 Python 人生苦短,我用 Python -- Life is short, you need Python 目标 Python 的起源 为什么要用 Python? Python 的特点 Py ...

  3. R语言入门:向量索引

    这节的内容是建立在之前我们对R语言最基本向量赋值的基础之上的,笔者本人学完R当中向量的索引感觉异常舒适,因为这个比Python的索引爽多了,是什么值开始索引就从哪里开始索引,到哪里结束就在哪里结束,而 ...

  4. NIO、多路复用的终极奥义

    1.现在要让有限的系统资源发挥更大的效率,一个最直接的方式就是进行资源复用,比如线程资源复用. 2.线程资源复用的一个最有效的方式就是使用事件驱动模型进行异步调用. 3.Reactor模型就是基于事件 ...

  5. mongo curd

    常用命令 未完待续...

  6. Windows10官方原版系统下载安装制作方法

    Windows10官方原版系统下载安装制作方法 去官网下载系统安装程序 点进去 https://www.microsoft.com/zh-cn/software-download/windows10 ...

  7. NFS服务配置 Linux

    两台机器: NFS服务器:192.168.1.100 (我的是Ubuntu系统) 客户机:192.168.1.123 (保证两台机器互相可以ping通) 需求:在NFS服务器上创建一个共享文件夹/ho ...

  8. R语言矩阵维度“消失”的问题

    矩阵(matrix)是R语言中很基础的一种数据结构,也是R语言使用者经常使用的一种数据结构.矩阵的维度一般为二维(m*n). R语言中矩阵的操作是非常简单易懂的,但是在对R语言做矩阵操作时,有个地方需 ...

  9. mybatis 配置--->确认jar包是否正确

    mybatis 配置之前,首先要确保服务器jar包是否成功 配置jar包如下添加mybaties-3.5.2. jar, maven 的 pom.xml 配置如下,查看配置是否成功见 如上分类 Mav ...

  10. pom.xml配置文件详解(Maven)

    注:博主 Chloneda:个人博客 | 博客园 | Github | Gitee | 知乎 注:本文转载自:https://blog.csdn.net/u012152619/article/deta ...