一、简介

每次面试都被怼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. U盘制作macOS Sierra的启动盘

    1.macOS Sierra的几种安装方式 *开机时按住command+option+r 进行联网在线安装.PS:在网速好的情况还行,但是如果网络差的时候,它会让你崩溃的. *使用光盘进行安装. *今 ...

  2. nCompass-网络流量基础知识

    nCompass-网络流量基础知识 1.  流量分析基础知识 1.1  常见的流量分析方式: SNMP: 网管平台通过主动式获取设备接口流量信息. Flow:网络设备将穿越的数据流信息精简压缩打包. ...

  3. 大白话工厂方法模式(Factory Method)

    目录 简单工厂模式缺陷 简单工厂模式改造 工厂方法模式定义 工厂方法模式结构 工厂方法模式分析 参考文献 简单工厂模式缺陷 大白话简单工厂模式(Simple Factory Pattern)中通过买车 ...

  4. jquery带下拉列表的购物车组件封装

    按照国际惯例先放效果图 安静的时候它长这样 等待加载时它长这样(功能是设置的按需加载,网速慢或者加载数据大时会出现) 加载之后购物车没有商品时这样 有商品长这样 接下来放代码: cart.html & ...

  5. Java基础之一、入门知识

    资料来源于<明解 Java>日本作者 写的很详细 1:命令---java 类名 该命令不是去执行类名.class文件(文件名和类名有可能不一致),切记是表示执行具体的类: 2:“字符”+数 ...

  6. js对象模型1

  7. 到2029年MRAM收入将增长170倍

    一份新市场报告预计,从2018年到2029年,独立MRAM和STT-MRAM的收入将增长170倍,达到近40亿美元的收入.下一代内存技术的增长将主要由取代效率较低的内存技术(例如NOR闪存和SRAM) ...

  8. 【python基础语法】函数的作用域和内置函数和关键字(第7天课堂笔记)

    一.函数的作用域: 1.全局变量 2.局部变量 3.global 二.内置函数 1.常见的内置函数 print : 输出 input : 输入 type : 查看数据类型 id : 获取数据的内存地址 ...

  9. C语言 运算符

    C语言 运算符 运算符优先级别 优先级 运算符 名称或含义 使用形式 结合方向 说明 1 [] 数组下标 数组名[常量表达式] 左到右 -- () 圆括号 (表达式)/函数名(形参表) -- . 成员 ...

  10. Spring中@Value用法

    Spring中可以通过@Value注解,将properties配置文件中的属性值注入到java成员变量,配置和使用方法如下(大部分转自csdn,也有自己实验部分): 一.配置 首先,@value需要参 ...