一、简介

每次面试都被怼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. git rm -r --cached解决已提交的文件在.gitignore中加入忽略后无效的问题。

    有时候,发现有不该提交的文件已经提交后,仅仅在.gitignore中加入忽略是不行的.这个时候需要执行: git rm -r --cached 文件/文件夹名字 去掉已经托管的文件,然后重新提交: g ...

  2. 学习笔记——python(继承)

    学习笔记(Python继承) 有几种叫法(父类-子类.基类-派生类)先拿代码演示一下: class father: def work(self): print("work>>&g ...

  3. BIO&NIO

    在BIO中只有一个核心对象--Stream,它是单向的数据传输通道,即每个Stream要么是输入要么是输出的,不可兼得.开发人员是面向Stream进行编程的. 在NIO中有三个核心对象--Seleto ...

  4. 通过HTML和CSS1:1还原风暴英雄官方网站

    <!--HTML代码--> <!DOCTYPE html> <html lang="en"> <head> <meta cha ...

  5. 1.3.6 详解build.gradle文件——Android第一行代码(第二版)笔记

    不同于Eclipse,Android Studio是采用Gradle来构建项目的.Gradle是一个非常先进的项目构建工具,它使用了一种基于Groovy的领域特定语言(DSL)来声明项目设置. 首先看 ...

  6. maven导入sqlserver驱动jar包依赖包到本地仓库

    maven导入sqlserver驱动jar包依赖包到本地仓库 maven项目使用sqlserver的依赖,先下载一个sqlserver的驱动,网址:https://www.microsoft.com/ ...

  7. IIS网站部署配置

    1.配置Session State

  8. Policy-based Approach(基于策略的方法)

    step 1:Neural Network as Actor step 2:goodness of function(训练一些Actor) 是一个序列,包含T个状态s.行为a.奖励s.代表某一次的开始 ...

  9. 在pycharm中如何设置代码对齐竖线

    方法:启动pycharm软件,打开一个文件,点 file 菜单,选择 settings,在弹出的setting菜单中依次选择editor-->general-->appearance,然后 ...

  10. SQL server 游标用法

    declare @EmpCode varchar(50), @EmpName varchar(50), @EmpAddress varchar(200);declare curEmployee cur ...