CN103383645B - Code generating method and system - Google Patents
Code generating method and system Download PDFInfo
- Publication number
- CN103383645B CN103383645B CN201310322858.5A CN201310322858A CN103383645B CN 103383645 B CN103383645 B CN 103383645B CN 201310322858 A CN201310322858 A CN 201310322858A CN 103383645 B CN103383645 B CN 103383645B
- Authority
- CN
- China
- Prior art keywords
- file
- generate
- class file
- name
- stringbuilder
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 29
- 230000003068 static effect Effects 0.000 claims abstract description 119
- 230000002688 persistence Effects 0.000 claims abstract description 12
- 230000009471 action Effects 0.000 claims description 30
- 238000012545 processing Methods 0.000 claims description 24
- 238000004321 preservation Methods 0.000 claims description 6
- 238000012795 verification Methods 0.000 claims description 5
- 238000011161 development Methods 0.000 abstract description 16
- 230000008439 repair process Effects 0.000 description 38
- 238000010586 diagram Methods 0.000 description 18
- 230000008569 process Effects 0.000 description 9
- 230000002085 persistent effect Effects 0.000 description 7
- 230000000694 effects Effects 0.000 description 6
- 238000013461 design Methods 0.000 description 5
- 239000008186 active pharmaceutical agent Substances 0.000 description 3
- 238000010438 heat treatment Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 238000012423 maintenance Methods 0.000 description 3
- 239000000370 acceptor Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Landscapes
- Stored Programmes (AREA)
Abstract
本发明公开了一种代码生成方法及系统,所述系统包括:静态表单读取模块、Java服务器页面(JSP)生成模块、数据持久层生成模块、控制器生成模块和配置文件生成模块;所述JSP生成模块生成视图层JSP文件;所述数据持久层生成模块生成简单JAVA对象(POJO)类文件、以及数据访问对象(DAO)类文件;所述控制器生成模块,生成控制器Java类文件;所述配置文件生成模块生成可扩展标记语言(XML)配置文件。采用本发明的技术方案,能够高效地根据不同待开发软件的具体框架生成业务代码,并降低开发成本。
The invention discloses a code generation method and system, the system comprising: a static form reading module, a Java server page (JSP) generation module, a data persistence layer generation module, a controller generation module and a configuration file generation module; The JSP generation module generates a view layer JSP file; the data persistence layer generation module generates a simple JAVA object (POJO) class file and a data access object (DAO) class file; the controller generation module generates a controller Java class file; The configuration file generation module generates an Extensible Markup Language (XML) configuration file. By adopting the technical scheme of the invention, business codes can be efficiently generated according to the specific frameworks of different software to be developed, and the development cost can be reduced.
Description
技术领域technical field
本发明涉及业务代码生成技术,尤其涉及一种代码生成方法及系统。The invention relates to business code generation technology, in particular to a code generation method and system.
背景技术Background technique
当前,使用代码生成工具些协助项目开发,解决开发人员代码不规范的问题,提高开发效率以及软件代码的复用率、降低开发成本成为趋势,但是当前的代码生成工具不能根据不同待开发项目的具体框架生成业务代码,只能生成具有辅助功能的代码,以实现基本的增、删、改、查的业务逻辑;同时,当前代码生成工具进行业务逻辑变更的控制,但是配置或学习现有的规则引擎实现比较复杂,成本较高。At present, it has become a trend to use code generation tools to assist project development, solve the problem of developers' code irregularities, improve development efficiency and software code reuse rate, and reduce development costs. The business code generated by the specific framework can only generate code with auxiliary functions to realize the basic business logic of adding, deleting, modifying, and checking; at the same time, the current code generation tool controls business logic changes, but configuration or learning existing The implementation of the rule engine is more complicated and the cost is higher.
因此,如何高效地根据不同待开发软件的具体框架生成业务代码,并降低开发成本,成为亟待解决的问题。Therefore, how to efficiently generate business codes according to the specific frameworks of different software to be developed and reduce development costs has become an urgent problem to be solved.
发明内容Contents of the invention
有鉴于此,本发明的主要目的在于提供一种代码生成方法及系统,以高效地根据不同待开发项目的具体框架生成业务代码,并降低开发成本。In view of this, the main purpose of the present invention is to provide a code generation method and system to efficiently generate business codes according to the specific frameworks of different projects to be developed and reduce development costs.
为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, technical solution of the present invention is achieved in that way:
本发明提供了一种代码生成系统,该系统包括:The present invention provides a code generation system, which includes:
静态表单读取模块,用于读取静态表单的控件的代码,根据所述静态表单的控件的代码确定所述控件的属性;将所述控件封装为控件对象,根据所述控件对象所对应的属性,将所述控件对象存储至对应的变量集中;The static form reading module is used to read the code of the control of the static form, and determine the attribute of the control according to the code of the control of the static form; the control is encapsulated as a control object, and according to the corresponding attribute, storing the control object in a corresponding variable set;
服务器页面(JSP,JavaServerPages)生成模块,用于根据所述变量集中控件对象的属性,生成对应不同属性变量集的JavaScript代码,根据所述JavaScript代码、以及所述静态表单的控件的代码,生成视图层JSP文件;The server page (JSP, JavaServerPages) generation module is used to generate JavaScript codes corresponding to different attribute variable sets according to the attributes of the control objects in the variable set, and generate a view according to the JavaScript codes and the codes of the controls of the static form layer JSP file;
数据持久层生成模块,用于读取表单数据操作对应的业务数据表,根据所述业务数据表的数据结构,生成分别与所述业务数据表的名称对应的简单JAVA对象简单JAVA对象(POJO,PlainOldJavaObjects)类文件、以及数据访问对象(DAO,DataAccessObject)类文件;The data persistence layer generating module is used to read the business data table corresponding to the form data operation, and according to the data structure of the business data table, generate simple JAVA objects (POJO, POJO, PlainOldJavaObjects) class files, and data access object (DAO, DataAccessObject) class files;
控制器生成模块,用于根据所述变量集中控件对象的属性、以及所述POJO类文件的实例和所述DAO类文件的实例,生成与所述静态表单的名称对应的控制器Java类文件,所述控制器Java类文件包括:处理查看表单请求的控制器Java类文件和处理提交表单请求的控制器Java类文件;A controller generation module, configured to generate a controller Java class file corresponding to the name of the static form according to the attributes of the control object in the variable set, and the instance of the POJO class file and the instance of the DAO class file, Described controller Java class file comprises: the controller Java class file of processing viewing form request and the controller Java class file of processing submission form request;
配置文件生成模块,用于生成可扩展标记语言(XMLExtensibleMarkupLanguage)配置文件,所述XML配置文件中的动作(action)节点的属性与所述静态表单的名称对应。The configuration file generating module is configured to generate an Extensible Markup Language (XMLExtensibleMarkupLanguage) configuration file, the attribute of the action node in the XML configuration file corresponds to the name of the static form.
优选地,所述JSP生成模块,还用于生成名称与所述静态表单的名称对应的空的JSP文件;在所述JSP文件中添加外联级联样式表(CSS,CascadingStyleSheet)文件、静态超文本标记语言(HTML,HypertextMarkupLanguage)标签;将所述静态表单的控件的代码添加到所述JSP文件中的主体(body)标签内;Preferably, the JSP generation module is also used to generate an empty JSP file whose name corresponds to the name of the static form; add an external cascading style sheet (CSS, CascadingStyleSheet) file, a static hyperlink to the JSP file Text markup language (HTML, HypertextMarkupLanguage) tag; add the code of the control of the static form to the main body (body) tag in the JSP file;
确定所述静态表单中读取表单数据的控件的变量,生成与所述读取表单数据的控件的变量对应的标签前端代码、以及为所述读取表单数据的控件的变量赋值的JavaScript代码,并写入所述JSP文件;确定所述静态表单中保存表单数据且要求保存的数据非空的控件的变量,生成验证表单控件合法性的JavaScript代码,并写入所述JSP文件;Determine the variable of the control that reads form data in the static form, generate the tag front-end code corresponding to the variable of the control that reads form data, and the JavaScript code that assigns a value to the variable of the control that reads form data, And write described JSP file; Determine the variable of the non-empty control that saves form data and the data that requires preservation in the described static form, generates the JavaScript code of verification form control legitimacy, and writes described JSP file;
生成防止表单重复提交的JavaScript代码,并写入所述JSP文件。Generate JavaScript codes to prevent repeated form submissions, and write them into the JSP file.
优选地,所述数据持久层生成模块,还用于生成与所述业务数据表的名称对应的空的POJO类文件,获取所述业务数据表的字段类型和字段名称,向所述POJO类文件写入与所述业务数据表的字段类型和字段名称对应的属性;Preferably, the data persistence layer generation module is also used to generate an empty POJO class file corresponding to the name of the business data table, obtain the field type and field name of the business data table, and send the POJO class file Write the attribute corresponding to the field type and field name of the business data table;
生成与所述业务数据表的名称对应的空的DAO类文件,向所述DAO类文件写入与所述业务数据表的字段类型和字段名称对应的属性;Generate an empty DAO class file corresponding to the name of the business data table, write the attribute corresponding to the field type and field name of the business data table to the DAO class file;
实例化第一字符串变量(StringBuilder),生成调用Hibernate接口的增、删、改、查的基本操作的源文件,将所述源文件写入所述第一StringBuilder,并将所述第一StringBuilder写入所述DAO类文件。Instantiate the first string variable (StringBuilder), generate a source file that calls the basic operations of adding, deleting, modifying, and checking the Hibernate interface, write the source file into the first StringBuilder, and write the first StringBuilder Write the DAO class file.
优选地,所述控制器生成模块,还用于生成处理查看表单请求的空的第一控制器Java类文件,所述第一控制器Java类文件的名称与所述静态表单的名称对应;Preferably, the controller generating module is further configured to generate an empty first controller Java class file for processing a request to view a form, and the name of the first controller Java class file corresponds to the name of the static form;
实例化第二StringBuilder,将所述业务数据表对应的DAO类文件的实例以及POJO类文件的实例作为所述第一控制器Java类文件的实例变量,生成对应所述第一控制器Java类文件的实例变量的获取(getter)应用和设置(setter)应用,将所述getter应用和所述setter应用添加到所述第一StringBuilder中;Instantiate the second StringBuilder, use the instance variable of the DAO class file and the POJO class file corresponding to the business data table as the instance variable of the first controller Java class file, and generate the Java class file corresponding to the first controller An acquisition (getter) application and a setting (setter) application of the instance variable, adding the getter application and the setter application to the first StringBuilder;
生成对应所述第一控制器类Java类文件的执行(execute)应用,将所述execute应用添加到所述第一StringBuilder中;Generate an execute application corresponding to the Java class file of the first controller class, and add the execute application to the first StringBuilder;
将所述第一StringBuilder添加到所述第一控制器Java类文件中;Adding the first StringBuilder to the first controller Java class file;
生成处理提交表单请求的空的第二控制器Java类文件,所述第二控制器Java类文件的名称与所述静态表单的名称对应;Generate an empty second controller Java class file for processing the submitted form request, the name of the second controller Java class file corresponds to the name of the static form;
实例化第三StringBuilder,将所述业务数据表对应的DAO类文件的实例以及POJO类文件的实例作为所述第二控制器Java类文件的实例变量,生成对应所述实例变量的getter应用和setter应用,将所述getter应用和所述setter应用添加到所述第三StringBuilder中;Instantiate the third StringBuilder, use the instance variable of the DAO class file and the POJO class file corresponding to the business data table as the instance variable of the second controller Java class file, and generate a getter application and a setter corresponding to the instance variable application, adding the getter application and the setter application to the third StringBuilder;
生成对应所述第二控制器Java类文件的execute应用,将所述execute应用添加到所述第三StringBuilder中;Generate an execute application corresponding to the Java class file of the second controller, and add the execute application to the third StringBuilder;
将所述第三StringBuilder添加到所述第二控制器Java类文件中。Add the third StringBuilder to the second controller Java class file.
优选地,所述配置文件生成模块,还用于生成空的XML配置文件,在所述XML配置文件中生成对应的包(package)节点和与所述静态表单名称对应的action节点,生成空的XML配置文件;Preferably, the configuration file generation module is also used to generate an empty XML configuration file, generate a corresponding package node and an action node corresponding to the static form name in the XML configuration file, and generate an empty XML configuration file;
实例化第四StringBuilder,将所述XML配置文件的声明添加到所述第四StringBuilder中;Instantiate the fourth StringBuilder, and add the statement of the XML configuration file to the fourth StringBuilder;
生成XML配置文件的package节点、以及与所述静态表单的名称对应的action节点,并添加到所述第四StringBuilder中;Generate the package node of the XML configuration file and the action node corresponding to the name of the static form, and add them to the fourth StringBuilder;
将所述第四StringBuilder写入所述空的XML配置文件。Write the fourth StringBuilder into the empty XML configuration file.
本发明还提供了一种代码生成方法,该方法包括:The present invention also provides a code generation method, the method comprising:
读取静态表单的控件的代码,根据所述静态表单的控件的代码确定所述控件的属性;将所述控件封装为控件对象,根据所述控件对象所对应的属性,将所述控件对象存储至对应的变量集中;Read the code of the control of the static form, determine the property of the control according to the code of the control of the static form; encapsulate the control into a control object, and store the control object according to the property corresponding to the control object to the corresponding variable set;
根据所述变量集中控件对象的属性,生成对应不同属性变量集的JavaScript代码,根据所述JavaScript代码、以及所述静态表单的控件的代码,生成视图层JSP文件;Generate JavaScript codes corresponding to different attribute variable sets according to the attributes of the control objects in the variable set, and generate a view layer JSP file according to the JavaScript codes and the codes of the controls of the static form;
读取业务数据表,根据所述业务数据表的数据结构,生成分别与所述业务数据表的名称对应的简单JAVA对象POJO类文件、以及数据访问对象DAO类文件;Read the business data table, according to the data structure of the business data table, generate the simple JAVA object POJO class file and the data access object DAO class file corresponding to the name of the business data table respectively;
根据所述变量集中控件对象的属性、以及所述POJO类文件的实例和所述DAO类文件的实例,生成与所述静态表单的名称对应的控制器Java类文件,所述控制器Java类文件包括:处理查看表单请求的控制器Java类文件和处理提交表单请求的控制器Java类文件;According to the attribute of the control object in the variable set, and the instance of the POJO class file and the instance of the DAO class file, generate a controller Java class file corresponding to the name of the static form, and the controller Java class file Including: the controller Java class file that handles the request to view the form and the controller Java class file that handles the request to submit the form;
生成XML配置文件,所述XML配置文件中的action节点的属性与所述静态表单的名称对应。An XML configuration file is generated, and the attribute of the action node in the XML configuration file corresponds to the name of the static form.
优选地,所述根据所述变量集中控件对象的属性,生成对应不同属性变量集的JavaScript代码,根据所述JavaScript代码、以及所述静态表单的控件的代码,生成视图层JSP文件,包括:Preferably, according to the attributes of the control objects in the variable set, JavaScript codes corresponding to different attribute variable sets are generated, and according to the JavaScript code and the codes of the controls of the static form, a view layer JSP file is generated, including:
生成名称与所述静态表单的名称对应的空的JSP文件;在所述JSP文件中添加外联CSS文件、静态HTML标签;将所述静态表单的控件的代码添加到所述JSP文件中的主体body标签内;Generate an empty JSP file whose name is corresponding to the name of the static form; add an external CSS file and a static HTML tag in the JSP file; add the code of the control of the static form to the main body in the JSP file Inside the body tag;
确定所述静态表单中读取表单数据的控件的变量,生成与所述读取表单数据的控件的变量对应的标签前端代码、以及为所述读取表单数据的控件的变量赋值的JavaScript代码,并写入所述JSP文件;确定所述静态表单中保存表单数据且要求保存的数据非空的控件的变量,生成验证表单控件合法性的JavaScript代码,并写入所述JSP文件;Determine the variable of the control that reads form data in the static form, generate the tag front-end code corresponding to the variable of the control that reads form data, and the JavaScript code that assigns a value to the variable of the control that reads form data, And write described JSP file; Determine the variable of the non-empty control that saves form data and the data that requires preservation in the described static form, generates the JavaScript code of verification form control legitimacy, and writes described JSP file;
生成防止表单重复提交的JavaScript代码,并写入所述JSP文件。Generate JavaScript codes to prevent repeated form submissions, and write them into the JSP file.
优选地,所述读取业务数据表,根据所述业务数据表的数据结构,生成分别与所述业务数据表的名称对应的POJO类文件、以及数据访问对象DAO类文件,包括:Preferably, the reading of the business data table generates, according to the data structure of the business data table, POJO class files and data access object DAO class files respectively corresponding to the names of the business data tables, including:
生成与所述业务数据表的名称对应的空的POJO类文件,获取所述业务数据表的字段类型和字段名称,向所述POJO类文件写入与所述业务数据表的字段类型和字段名称对应的属性;Generate an empty POJO class file corresponding to the name of the business data table, obtain the field type and field name of the business data table, and write the field type and field name of the business data table to the POJO class file corresponding attributes;
生成与所述业务数据表的名称对应的空的DAO类文件,向所述DAO类文件写入与所述业务数据表的字段类型和字段名称对应的属性;Generate an empty DAO class file corresponding to the name of the business data table, write the attribute corresponding to the field type and field name of the business data table to the DAO class file;
实例化第一StringBuilder,生成调用Hibernate接口的增、删、改、查的基本操作的源文件,将所述源文件写入所述第一StringBuilder,并将所述第一StringBuilder写入所述DAO类文件。Instantiate the first StringBuilder, generate the source file for the basic operations of adding, deleting, modifying, and checking the Hibernate interface, write the source file into the first StringBuilder, and write the first StringBuilder into the DAO class files.
优选地,所述根据所述变量集中控件对象的属性、以及所述POJO类文件的实例和所述DAO类文件的实例,生成与所述静态表单的名称对应的控制器Java类文件,包括:Preferably, generating a controller Java class file corresponding to the name of the static form according to the attributes of the control object in the variable set, and the instance of the POJO class file and the instance of the DAO class file, including:
生成处理查看表单请求的空的第一控制器Java类文件,所述第一控制器Java类文件的名称与所述静态表单的名称对应;Generate an empty first controller Java class file for processing viewing form requests, the name of the first controller Java class file corresponds to the name of the static form;
实例化第二StringBuilder,将所述业务数据表对应的DAO类文件的实例以及POJO类文件的实例作为所述第一控制器Java类文件的实例变量,生成对应所述第一控制器Java类文件的实例变量的getter应用和setter应用,将所述getter应用和所述setter应用添加到所述第一StringBuilder中;Instantiate the second StringBuilder, use the instance variable of the DAO class file and the POJO class file corresponding to the business data table as the instance variable of the first controller Java class file, and generate the Java class file corresponding to the first controller The getter application and the setter application of the instance variable, adding the getter application and the setter application to the first StringBuilder;
生成对应所述第一控制器类Java类文件的execute应用,将所述execute应用添加到所述第一StringBuilder中;Generate an execute application corresponding to the first controller class Java class file, and add the execute application to the first StringBuilder;
将所述第一StringBuilder添加到所述第一控制器Java类文件中;Adding the first StringBuilder to the first controller Java class file;
生成处理提交表单请求的空的第二控制器Java类文件,所述第二控制器Java类文件的名称与所述静态表单的名称对应;Generate an empty second controller Java class file for processing the submitted form request, the name of the second controller Java class file corresponds to the name of the static form;
实例化第三StringBuilder,将所述业务数据表对应的DAO类文件的实例以及POJO类文件的实例作为所述第二控制器Java类文件的实例变量,生成对应所述实例变量的getter应用和setter应用,将所述getter应用和所述setter应用添加到所述第三StringBuilder中;Instantiate the third StringBuilder, use the instance variable of the DAO class file and the POJO class file corresponding to the business data table as the instance variable of the second controller Java class file, and generate a getter application and a setter corresponding to the instance variable application, adding the getter application and the setter application to the third StringBuilder;
生成对应所述第二控制器Java类文件的execute应用,将所述execute应用添加到所述第三StringBuilder中;Generate an execute application corresponding to the Java class file of the second controller, and add the execute application to the third StringBuilder;
将所述第三StringBuilder添加到所述第二控制器Java类文件中。Add the third StringBuilder to the second controller Java class file.
优选地,所述生成可扩展标记语言XML配置文件,所述XML配置文件中的动作action节点的属性与所述静态表单的名称对应,包括:Preferably, the generating Extensible Markup Language XML configuration file, the attribute of the action node in the XML configuration file corresponds to the name of the static form, including:
生成空的XML配置文件,在所述XML配置文件中生成对应的package节点和与所述静态表单名称对应的action节点,生成空的XML配置文件;Generate an empty XML configuration file, generate a corresponding package node and an action node corresponding to the static form name in the XML configuration file, and generate an empty XML configuration file;
实例化第四StringBuilder,将所述XML配置文件的声明添加到所述第四StringBuilder中;Instantiate the fourth StringBuilder, and add the statement of the XML configuration file to the fourth StringBuilder;
生成XML配置文件的package节点、以及与所述静态表单的名称对应的action节点,并添加到所述第四StringBuilder中;Generate the package node of the XML configuration file and the action node corresponding to the name of the static form, and add them to the fourth StringBuilder;
将所述第四StringBuilder写入所述空的XML配置文件。Write the fourth StringBuilder into the empty XML configuration file.
本发明所提供的基于模型-视图-控制器(MVC,Model-View-Controller)架构的工作流网页(Web)应用的代码生成的技术方案,通过JSP生成模块生成人工活动页面的前端代码,通过控制器生成模块、数据持久层生成模块和配置文件生成模块生成Web后台代码,提高了开发人员开发工作流Web应用系统的效率,并且提高了代码质量。The technical scheme of the code generation of the workflow web page (Web) application based on the model-view-controller (MVC, Model-View-Controller) architecture provided by the present invention generates the front-end code of the manual activity page through the JSP generation module, The controller generation module, the data persistence layer generation module and the configuration file generation module generate the Web background code, which improves the developer's efficiency in developing the workflow Web application system and improves the code quality.
附图说明Description of drawings
图1a为本发明实施例的代码生成系统的组成结构示意图;Figure 1a is a schematic diagram of the composition and structure of a code generation system according to an embodiment of the present invention;
图1b为本发明实施例的又一代码生成系统的组成结构示意图;FIG. 1b is a schematic diagram of the composition and structure of another code generation system according to an embodiment of the present invention;
图2为本发明实施例的代码生成方法的实现流程示意图;FIG. 2 is a schematic diagram of the implementation flow of a code generation method according to an embodiment of the present invention;
图3为本发明实施例的代码生成系统在工作流系统中的示意图;3 is a schematic diagram of a code generation system in a workflow system according to an embodiment of the present invention;
图4为本发明实施例的代码生成系统在工作流Web开发环境中的应用示意图一;4 is a first schematic diagram of the application of the code generation system in the workflow Web development environment according to the embodiment of the present invention;
图5为本发明实施例的代码生成系统在工作流应用环境中的应用示意图二;FIG. 5 is a second schematic diagram of the application of the code generation system in the workflow application environment according to the embodiment of the present invention;
图6为本发明实施例的读取静态表单的实现流程示意图;6 is a schematic diagram of an implementation flow for reading a static form according to an embodiment of the present invention;
图7为本发明实施例的生成前端JSP视图文件的实现流程示意图;Fig. 7 is the realization flowchart of the generation front-end JSP view file of the embodiment of the present invention;
图8为本发明实施例的生成Hibernate持久层的后端代码文件的实现流程示意图;Fig. 8 is the realization flow diagram of the back-end code file of generation Hibernate persistent layer of the embodiment of the present invention;
图9为本发明实施例的生成Struts2控制层代码文件的实现流程示意图;Fig. 9 is the realization flowchart of the generation Struts2 control layer code file of the embodiment of the present invention;
图10为本发明实施例的生成Struts2XML配置文件的实现流程示意图。FIG. 10 is a schematic diagram of an implementation flow of generating a Struts2XML configuration file according to an embodiment of the present invention.
具体实施方式detailed description
本发明的基本思想是:实际项目开发成本往往集中于业务流程模块的开发、项目开发完成后对漏洞(Bug)的处理、业务变更后代码的修改以及修改后的Bug处理和代码测试。如果在代码生成方面采用基于模板的方式,用户可以根据不同架构进行相应的模板设计;在工作流开发环境中用流程定义语言来设计流程图,对于每个人工任务活动节点通过静态表单设计器设计用于人工交互的静态表单,通过代码生成系统读取并分析静态表单的控件的代码,以生成目标代码。The basic idea of the present invention is: the actual project development cost is often concentrated in the development of business process modules, the processing of loopholes (Bugs) after project development is completed, the modification of codes after business changes, and the modified Bug processing and code testing. If a template-based method is adopted in code generation, users can design corresponding templates according to different architectures; in the workflow development environment, use the process definition language to design flow charts, and design each human task activity node through a static form designer For the static form used for human interaction, the code generation system reads and analyzes the code of the control of the static form to generate the target code.
下面结合附图及具体实施例对本发明再作进一步详细说明。The present invention will be described in further detail below in conjunction with the accompanying drawings and specific embodiments.
图1a为本发明实施例的代码生成系统的组成结构示意图,如图1a所示,包括:Figure 1a is a schematic diagram of the composition and structure of the code generation system of the embodiment of the present invention, as shown in Figure 1a, including:
静态表单读取模块11,用于读取静态表单的控件的代码,根据所述静态表单的控件的代码确定所述控件的属性;将所述控件封装为控件对象,根据所述控件对象所对应的属性,将所述控件对象存储至对应的变量集中;The static form reading module 11 is used to read the code of the control of the static form, and determine the attribute of the control according to the code of the control of the static form; attribute, store the control object in the corresponding variable set;
JSP生成模块12,用于根据所述变量集中控件对象的属性,生成对应不同属性变量集的JavaScript代码,根据所述JavaScript代码、以及所述静态表单的控件的代码,生成视图层JSP文件;The JSP generation module 12 is used to generate JavaScript codes corresponding to different attribute variable sets according to the attributes of the control object in the variable set, and generate a view layer JSP file according to the JavaScript code and the code of the control of the static form;
数据持久层生成模块13,用于读取表单数据操作对应的业务数据表,根据所述业务数据表的数据结构,生成分别与所述业务数据表的名称对应的POJO类文件、以及DAO类文件;The data persistence layer generating module 13 is used to read the business data table corresponding to the form data operation, and generate POJO class files and DAO class files respectively corresponding to the names of the business data table according to the data structure of the business data table ;
控制器生成模块14,用于根据所述变量集中控件对象的属性、以及所述POJO类文件的实例和所述DAO类文件的实例,生成与所述静态表单的名称对应的控制器Java类文件,所述控制器Java类文件包括:处理查看表单请求的控制器Java类文件和处理提交表单请求的控制器Java类文件;The controller generation module 14 is used to generate the controller Java class file corresponding to the name of the static form according to the attributes of the control object in the variable set, and the instance of the POJO class file and the instance of the DAO class file , the controller Java class file includes: a controller Java class file for processing a form request and a controller Java class file for processing a form request;
配置文件生成模块15,用于生成XML配置文件,所述XML配置文件中的动作action节点的属性与所述静态表单的名称对应。The configuration file generating module 15 is configured to generate an XML configuration file, the attribute of the action node in the XML configuration file corresponds to the name of the static form.
优选地,所述JSP生成模块,还用于生成名称与所述静态表单的名称对应的空的JSP文件;在所述JSP文件中添加外联CSS文件、静态HTML标签;将所述静态表单的控件的代码添加到所述JSP文件中的body标签内;Preferably, the JSP generation module is also used to generate an empty JSP file whose name is corresponding to the name of the static form; add an external CSS file and a static HTML tag in the JSP file; The code of the control is added to the body tag in the JSP file;
确定所述静态表单中读取表单数据的控件的变量,生成与所述读取表单数据的控件的变量对应的标签前端代码、以及为所述读取表单数据的控件的变量赋值的JavaScript代码,并写入所述JSP文件;确定所述静态表单中保存表单数据且要求保存的数据非空的控件的变量,生成验证表单控件合法性的JavaScript代码,并写入所述JSP文件;Determine the variable of the control that reads form data in the static form, generate the tag front-end code corresponding to the variable of the control that reads form data, and the JavaScript code that assigns a value to the variable of the control that reads form data, And write described JSP file; Determine the variable of the non-empty control that saves form data and the data that requires preservation in the described static form, generates the JavaScript code of verification form control legitimacy, and writes described JSP file;
生成防止表单数据重复提交的JavaScript代码、以及对所述静态表单的合法性进行验证的JavaScript代码,并写入所述JSP文件。Generating JavaScript codes for preventing repeated submission of form data and JavaScript codes for verifying the validity of the static form, and writing them into the JSP file.
优选地,所述数据持久层生成模块,还用于生成与所述业务数据表的名称对应的空的POJO类文件,获取所述业务数据表的字段类型和字段名称,向所述POJO类文件写入与所述业务数据表的字段类型和字段名称对应的属性;Preferably, the data persistence layer generation module is also used to generate an empty POJO class file corresponding to the name of the business data table, obtain the field type and field name of the business data table, and send the POJO class file Write the attribute corresponding to the field type and field name of the business data table;
生成与所述业务数据表的名称对应的空的DAO类文件,向所述DAO类文件写入与所述业务数据表的字段类型和字段名称对应的属性;Generate an empty DAO class file corresponding to the name of the business data table, write the attribute corresponding to the field type and field name of the business data table to the DAO class file;
实例化第一字符串变量(StringBuilder),生成调用Hibernate接口的增、删、改、查的基本操作的源文件,将所述源文件写入所述第一StringBuilder,并将所述第一StringBuilder写入所述DAO类文件。Instantiate the first string variable (StringBuilder), generate a source file that calls the basic operations of adding, deleting, modifying, and checking the Hibernate interface, write the source file into the first StringBuilder, and write the first StringBuilder Write the DAO class file.
优选地,所述控制器生成模块,还用于生成处理查看表单请求的空的第一控制器Java类文件,所述第一控制器Java类文件的名称与所述静态表单的名称对应;Preferably, the controller generating module is further configured to generate an empty first controller Java class file for processing a request to view a form, and the name of the first controller Java class file corresponds to the name of the static form;
实例化第二StringBuilder,将所述业务数据表对应的DAO类文件的实例以及POJO类文件的实例作为所述第一控制器Java类文件的实例变量,生成对应所述第一控制器Java类文件的实例变量的获取(getter)应用和设置(setter)应用,将所述getter应用和所述setter应用添加到所述第一StringBuilder中;Instantiate the second StringBuilder, use the instance variable of the DAO class file and the POJO class file corresponding to the business data table as the instance variable of the first controller Java class file, and generate the Java class file corresponding to the first controller An acquisition (getter) application and a setting (setter) application of the instance variable, adding the getter application and the setter application to the first StringBuilder;
生成对应所述第一控制器类Java类文件的执行(execute)应用,将所述execute应用添加到所述第一StringBuilder中;Generate an execute application corresponding to the Java class file of the first controller class, and add the execute application to the first StringBuilder;
将所述第一StringBuilder添加到所述第一控制器Java类文件中;Adding the first StringBuilder to the first controller Java class file;
生成处理提交表单请求的空的第二控制器Java类文件,所述第二控制器Java类文件的名称与所述静态表单的名称对应;Generate an empty second controller Java class file for processing the submitted form request, the name of the second controller Java class file corresponds to the name of the static form;
实例化第三StringBuilder,将所述业务数据表对应的DAO类文件的实例以及POJO类文件的实例作为所述第二控制器Java类文件的实例变量,生成对应所述实例变量的getter应用和setter应用,将所述getter应用和所述setter应用添加到所述第三StringBuilder中;Instantiate the third StringBuilder, use the instance variable of the DAO class file and the POJO class file corresponding to the business data table as the instance variable of the second controller Java class file, and generate a getter application and a setter corresponding to the instance variable application, adding the getter application and the setter application to the third StringBuilder;
生成对应所述第二控制器Java类文件的execute应用,将所述execute应用添加到所述第三StringBuilder中;Generate an execute application corresponding to the Java class file of the second controller, and add the execute application to the third StringBuilder;
将所述第三StringBuilder添加到所述第二控制器Java类文件中。Add the third StringBuilder to the second controller Java class file.
所述配置文件生成模块,还用于生成空的XML配置文件,在所述XML配置文件中生成对应的package节点和与所述静态表单名称对应的action节点,生成空的XML配置文件;The configuration file generation module is also used to generate an empty XML configuration file, and generates a corresponding package node and an action node corresponding to the static form name in the XML configuration file to generate an empty XML configuration file;
实例化第四StringBuilder,将所述XML配置文件的声明添加到所述第四StringBuilder中;Instantiate the fourth StringBuilder, and add the statement of the XML configuration file to the fourth StringBuilder;
生成XML配置文件的package节点、以及与所述静态表单的名称对应的action节点,并添加到所述第四StringBuilder中;Generate the package node of the XML configuration file and the action node corresponding to the name of the static form, and add them to the fourth StringBuilder;
将所述第四StringBuilder写入所述XML配置文件。Write the fourth StringBuilder into the XML configuration file.
图1b为本发明实施例的又一代码生成系统的组成结构示意图,如图1b所示,除包括上述静态表单读取模块11、JSP生成模块12、数据持久层生成模块13、控制器生成模块14和配置文件生成模块15之外,该系统还可以包括:Fig. 1b is a schematic diagram of the composition structure of another code generating system according to the embodiment of the present invention, as shown in Fig. 1b, except including the above-mentioned static form reading module 11, JSP generating module 12, data persistence layer generating module 13, and controller generating module 14 and configuration file generating module 15, the system can also include:
工作流引擎16,用于调度JSP生成模块12生成视图层JSP文件,即Web应用系统人工活动页面的前端代码;调度数据持久层生成模块13、控制器生成模块14和配置文件生成模块15对应生成POJO类文件和DAO类文件、控制器Java类文件、以及XML配置文件,即Web应用系统人工活动页面的Web后台代码。The workflow engine 16 is used to schedule the JSP generation module 12 to generate the view layer JSP file, that is, the front-end code of the manual activity page of the Web application system; the scheduling data persistence layer generation module 13, the controller generation module 14 and the configuration file generation module 15 are correspondingly generated POJO class files and DAO class files, controller Java class files, and XML configuration files, that is, the Web background code of the manual activity page of the Web application system.
图2为本发明实施例的代码生成方法的实现流程示意图,如图2所示,包括:Fig. 2 is a schematic diagram of the implementation flow of the code generation method of the embodiment of the present invention, as shown in Fig. 2, including:
步骤201:读取静态表单的控件的代码,根据所述静态表单的控件的代码确定所述控件的属性;将所述控件封装为控件对象,根据所述控件对象所对应的属性,将所述控件对象存储至对应的变量集中;Step 201: Read the code of the control of the static form, determine the property of the control according to the code of the control of the static form; encapsulate the control into a control object, and convert the control object according to the property corresponding to the control object The control object is stored in the corresponding variable set;
步骤202:根据所述变量集中控件对象的属性,生成对应不同属性变量集的JavaScript代码,根据所述JavaScript代码、以及所述静态表单的控件的代码,生成视图层JSP文件;Step 202: According to the attributes of the control objects in the variable set, generate JavaScript codes corresponding to different attribute variable sets, and generate a view layer JSP file according to the JavaScript codes and the codes of the controls of the static form;
在步骤202的一个优选实施方式中,生成名称与所述静态表单的名称对应的空的JSP文件;在所述JSP文件中添加外联CSS文件、静态HTML标签;将所述静态表单的控件的代码添加到所述JSP文件中的主体body标签内;In a preferred implementation of step 202, generate the empty JSP file whose name is corresponding to the name of the static form; Add the external CSS file and the static HTML tag in the JSP file; The code is added to the main body tag in the JSP file;
确定所述静态表单中读取表单数据的控件的变量,生成与所述读取表单数据的控件的变量对应的标签前端代码、以及为所述读取表单数据的控件的变量赋值的JavaScript代码,并写入所述JSP文件;确定所述静态表单中保存表单数据且要求保存的数据非空的控件的变量,生成验证表单控件合法性的JavaScript代码,并写入所述JSP文件;Determine the variable of the control that reads form data in the static form, generate the tag front-end code corresponding to the variable of the control that reads form data, and the JavaScript code that assigns a value to the variable of the control that reads form data, And write described JSP file; Determine the variable of the non-empty control that saves form data and the data that requires preservation in the described static form, generates the JavaScript code of verification form control legitimacy, and writes described JSP file;
生成防止表单重复提交的JavaScript代码,并写入所述JSP文件。Generate JavaScript codes to prevent repeated form submissions, and write them into the JSP file.
步骤203:读取业务数据表,根据所述业务数据表的数据结构,生成分别与所述业务数据表的名称对应的简单JAVA对象POJO类文件、以及数据访问对象DAO类文件;Step 203: read the business data table, and generate simple JAVA object POJO class files and data access object DAO class files respectively corresponding to the names of the business data table according to the data structure of the business data table;
在步骤203的一个优选实施方式中,生成与所述业务数据表的名称对应的空的POJO类文件,获取所述业务数据表的字段类型和字段名称,向所述POJO类文件写入与所述业务数据表的字段类型和字段名称对应的属性;In a preferred implementation of step 203, an empty POJO class file corresponding to the name of the business data table is generated, the field type and field name of the business data table are obtained, and the POJO class file is written to the POJO class file. The attributes corresponding to the field types and field names of the business data table;
生成与所述业务数据表的名称对应的空的DAO类文件,向所述DAO类文件写入与所述业务数据表的字段类型和字段名称对应的属性;Generate an empty DAO class file corresponding to the name of the business data table, write the attribute corresponding to the field type and field name of the business data table to the DAO class file;
实例化第一StringBuilder,生成调用开放源代码的对象关系映射框架Hibernate接口的增、删、改、查的基本操作的源文件,将所述源文件写入所述第一StringBuilder,并将所述第一StringBuilder写入所述DAO类文件。Instantiate the first StringBuilder, generate the source file of the basic operation of adding, deleting, changing, and checking the object-relational mapping framework Hibernate interface of the open source code, write the source file into the first StringBuilder, and write the The first StringBuilder is written to the DAO class file.
步骤204:根据所述变量集中控件对象的属性、以及所述POJO类文件的实例和所述DAO类文件的实例,生成与所述静态表单的名称对应的控制器Java类文件,所述控制器Java类文件包括:处理查看业务数据表请求的控制器Java类文件和处理提交业务数据表请求的控制器Java类文件;Step 204: Generate a controller Java class file corresponding to the name of the static form according to the attributes of the control object in the variable set, and the instance of the POJO class file and the instance of the DAO class file, the controller The Java class file includes: a controller Java class file for processing a request to view a business data table and a controller Java class file for processing a request for submitting a business data table;
在步骤204的一个优选实施方式中,生成处理查看表单请求的空的第一控制器Java类文件,所述第一控制器Java类文件的名称与所述静态表单的名称对应;In a preferred implementation of step 204, generate an empty first controller Java class file for processing the form request, the name of the first controller Java class file corresponds to the name of the static form;
实例化第二StringBuilder,将所述业务数据表对应的DAO类文件的实例以及POJO类文件的实例作为所述第一控制器Java类文件的实例变量,生成对应所述第一控制器Java类文件的实例变量的getter应用和setter应用,将所述getter应用和所述setter应用添加到所述第一StringBuilder中;Instantiate the second StringBuilder, use the instance variable of the DAO class file and the POJO class file corresponding to the business data table as the instance variable of the first controller Java class file, and generate the Java class file corresponding to the first controller The getter application and the setter application of the instance variable, adding the getter application and the setter application to the first StringBuilder;
生成对应所述第一控制器类Java类文件的execute应用,将所述execute应用添加到所述第一StringBuilder中;Generate an execute application corresponding to the first controller class Java class file, and add the execute application to the first StringBuilder;
将所述第一StringBuilder添加到所述第一控制器Java类文件中;Adding the first StringBuilder to the first controller Java class file;
生成处理提交表单请求的空的第二控制器Java类文件,所述第二控制器Java类文件的名称与所述静态表单的名称对应;Generate an empty second controller Java class file for processing the submitted form request, the name of the second controller Java class file corresponds to the name of the static form;
实例化第三StringBuilder,将所述业务数据表对应的DAO类文件的实例以及POJO类文件的实例作为所述第二控制器Java类文件的实例变量,生成对应所述实例变量的getter应用和setter应用,将所述getter应用和所述setter应用添加到所述第三StringBuilder中;Instantiate the third StringBuilder, use the instance variable of the DAO class file and the POJO class file corresponding to the business data table as the instance variable of the second controller Java class file, and generate a getter application and a setter corresponding to the instance variable application, adding the getter application and the setter application to the third StringBuilder;
生成对应所述第二控制器Java类文件的execute应用,将所述execute应用添加到所述第三StringBuilder中;Generate an execute application corresponding to the Java class file of the second controller, and add the execute application to the third StringBuilder;
将所述第三StringBuilder添加到所述第二控制器Java类文件中。Add the third StringBuilder to the second controller Java class file.
步骤205:生成XML配置文件,所述XML配置文件中的action节点的属性与所述静态表单的名称对应。Step 205: Generate an XML configuration file, the attribute of the action node in the XML configuration file corresponds to the name of the static form.
在步骤205的一个优选实施方式中,生成空的XML配置文件,在所述XML配置文件中生成对应的package节点和与所述静态表单名称对应的action节点。生成空的XML配置文件;In a preferred implementation manner of step 205, an empty XML configuration file is generated, and a corresponding package node and an action node corresponding to the name of the static form are generated in the XML configuration file. Generate an empty XML configuration file;
实例化第四StringBuilder,将所述XML配置文件的声明添加到所述第四StringBuilder中;Instantiate the fourth StringBuilder, and add the statement of the XML configuration file to the fourth StringBuilder;
生成XML配置文件的package节点、以及与所述静态表单的名称对应的action节点,并添加到所述第四StringBuilder中;Generate the package node of the XML configuration file and the action node corresponding to the name of the static form, and add them to the fourth StringBuilder;
将所述第四StringBuilder写入所述XML配置文件。Write the fourth StringBuilder into the XML configuration file.
下面以报修系统为例并结合图3~图5,对本发明实施例的代码生成方法及系统作进一步的说明。The code generation method and system of the embodiment of the present invention will be further described below by taking the maintenance reporting system as an example and referring to FIGS. 3 to 5 .
图3为本发明实施例的代码生成系统在工作流系统中的位置示意图,如图3所示,用户通过报修流程控制台来操作管理报修工作流网页Web应用系统,流程开发人员通过静态表单设计器设计报修系统中所需的静态表单,代码生成系统将报修系统静态表单的控件的属性作为输入,并输出报修系统中人工任务节点运行所需的目标代码的文件,最后将目标代码的文件保存到服务器指定的位置。Figure 3 is a schematic diagram of the location of the code generation system in the workflow system according to the embodiment of the present invention. The code generation system takes the properties of the controls of the static form of the repair system as input, and outputs the file of the target code required for the operation of the manual task node in the repair system, and finally saves the file of the target code to the location specified by the server.
图4为本发明实施例的代码生成系统在工作流Web开发环境中的应用示意图一,如图4所示,报修系统流程开发人员通过工作流开发环境向导建立工程,然后通过流程设计器可视化地设计报修系统人工任务节点所需的静态表单和报修系统流程定义文件。具体为:在工作台中双击人工任务节点,选择该节点对应的静态表单,调用代码生成系统来生成报修系统中该人工任务节点对应的目标代码,包括JSP视图文件以及POJO类文件、DAO类文件、控制器文件和XML配置文件。Fig. 4 is a schematic diagram of the application of the code generation system in the workflow Web development environment according to the embodiment of the present invention. As shown in Fig. Design the static form and process definition file of the repair system required by the human task node of the repair system. Specifically: Double-click the manual task node in the workbench, select the static form corresponding to the node, and call the code generation system to generate the target code corresponding to the manual task node in the repair system, including JSP view files, POJO class files, DAO class files, Controller files and XML configuration files.
图5为本发明实施例的代码生成系统在工作流应用环境中的应用示意图二,如图5所示,在报修系统应用过程中,当流程运行到报修人工活动节点时,用户向报修系统服务器发起读取静态表单的请求后,代码生成系统的控制器生成模块14读取保存在报修业务数据表中的业务数据,并根据数据处理的结果向用户返回生成的前端JSP视图文件,该前端JSP视图文件向用户展示业务数据后,用户可以向该静态表单获取报修业务数据的控件中填写报修业务数据,并提交到报修系统的后台服务器,代码生成系统的数据持久层生成模块13将报修业务数据持久化到业务数据库中,并调用工作流引擎16提供的结束人工任务节点的应用程序接口(API,ApplicationProgramInterface),使报修流程继续流转。Fig. 5 is the second application diagram of the code generation system in the workflow application environment according to the embodiment of the present invention. After initiating the request to read the static form, the controller generation module 14 of the code generation system reads the business data stored in the repair service data table, and returns the generated front-end JSP view file to the user according to the result of data processing. The front-end JSP After the view file shows the business data to the user, the user can fill in the repair business data in the control of the static form to obtain the repair business data, and submit it to the background server of the repair system, and the data persistence layer generation module 13 of the code generation system will generate the repair business data Persist in the business database, and call the application program interface (API, ApplicationProgramInterface) provided by the workflow engine 16 to end the manual task node, so that the repair process continues to flow.
下面暖气报修系统中的网站报修申请人工活动节点为例,对本发明实施例的代码生成方法作进一步详细说明。In the following, the manual activity node of website repair application in the heating repair repair system is taken as an example, and the code generation method of the embodiment of the present invention is further described in detail.
为发起网站报修申请人工活动节点可视化地设计用于人机交互的静态表单,将静态表单命名为newApply,静态表单包括7个控件,分别为报修人姓名(属性name="userName",type="readnotNull",table="user",field="userName")、报修人固定电话(属性name="telephone",type="read",table="user",field="telephone")、报修人家庭住址(属性为name="address",type="readnotNull",table="user",field="address")、报修人移动电话(属性为name="mobile",type="readnotNull",table="user",field="mobile")、报修人小区所在锅炉房(属性为name="ceilName",type="read",table="user",field="ceilName")、报修类型(属性为name="repairType",type="insert",table="repair",field="repairType")、报修内容控件(属性为name="repairDetail",type="insert",table="repair",field="repairDetail")。In order to initiate a website repair application manual activity node, a static form for human-computer interaction is visually designed, and the static form is named newApply. The static form includes 7 controls, which are the name of the repair person (attribute name="userName", type=" readnotNull", table="user", field="userName"), caller's fixed phone (attribute name="telephone", type="read", table="user", field="telephone"), caller's family Address (attribute name="address", type="readnotNull", table="user", field="address"), repairer's mobile phone (attribute name="mobile", type="readnotNull", table= "user", field="mobile"), the boiler room where the repairer's community is located (the attribute is name="ceilName", type="read", table="user", field="ceilName"), the type of repair report (the attribute is name="repairType", type="insert", table="repair", field="repairType"), repair content control (attribute name="repairDetail", type="insert", table="repair", field = "repairDetail").
双击流程图中的网站报修申请人工任务节点,为该人工任务节点选择网站报修申请表单,点击确定后调用代码生成系统,图6为本发明实施例的读取静态表单的实现流程示意图,如图6所示,包括以下步骤:Double-click the website repair application manual task node in the flow chart, select the website repair application form for the manual task node, and click OK to call the code generation system. Figure 6 is a schematic diagram of the implementation process of reading the static form in the embodiment of the present invention, as shown 6, including the following steps:
步骤601:循环读取报修申请静态表单中的控件;Step 601: cyclically read the controls in the static form of repair application;
步骤602~步骤603:判断表单中的控件的类型,根据表单控件的自定义type属性对不同的表单控件进行分类;Steps 602 to 603: determine the type of controls in the form, and classify different form controls according to the custom type attribute of the form controls;
type="read"表示读取业务数据表数据的表单控件,业务数据表数据包括报修人固定电话、报修人家庭住址、报修人移动电话和报修小区所在锅炉房;type="insert"表示获取用户业务数据并写入数据库的表单控件,包括报修类型和报修内容2个表单控件;type="notNull"表示非空类型控件,包括报修人姓名、家庭住址和移动电话。type属性值可以用空格分开以表示多个值,如报修人姓名控件既是读取业务数据表数据类型的控件又是非空类型的控件,则对应的type="readnotNull"。type="read" indicates the form control for reading the data in the business data table. The data in the business data table includes the fixed telephone number of the repair applicant, the home address of the repair applicant, the mobile phone of the repair applicant, and the boiler room where the repair community is located; type="insert" indicates the acquisition of users Business data is written into the database form control, including two form controls of repair type and repair content; type="notNull" indicates a non-null type control, including the name of the repairer, home address and mobile phone. The value of the type attribute can be separated by spaces to represent multiple values. For example, if the repairer name control is both a control for reading the data type of the business data table and a control of a non-null type, then the corresponding type="readnotNull".
步骤604:将不同类型的表单控件对应的对象保存到相应的控件对象变量集中;Step 604: Save objects corresponding to different types of form controls into corresponding control object variable sets;
将表单的控件封装为对象,对象的属性为对应的控件的属性,如对象userName包括type、name、table和field属性,将不同类型的控件保存到相应的控件对象变量集合中,具体地,将读取业务数据表数据的表单控件对应的对象存储到读取类型的变量集readSet中,非空类型的控件对应的对象存储到非空类型的变量集notNullSet中,获取用户业务数据的控件对应的对象存储到写入类型的变量集insertSet中。Encapsulate the control of the form as an object, and the properties of the object are the properties of the corresponding control. For example, the object userName includes type, name, table and field properties, and save different types of controls into the corresponding control object variable collection. Specifically, the The object corresponding to the form control that reads the business data table data is stored in the variable set readSet of the read type, the object corresponding to the control of the non-null type is stored in the variable set notNullSet of the non-null type, and the control corresponding to the user business data is obtained The object is stored in the variable set insertSet of the write type.
图7为本发明实施例的生成前端JSP视图文件的实现流程示意图,如图7所示,包括以下步骤:Fig. 7 is a schematic diagram of the implementation process of generating a front-end JSP view file according to an embodiment of the present invention, as shown in Fig. 7, comprising the following steps:
步骤701:生成JSP空文件;Step 701: generate a JSP empty file;
对应人工任务节点的JSP空文件名称为newApply.JSP,文件名称对应静态表单名称newApply。The JSP empty file name corresponding to the human task node is newApply.JSP, and the file name corresponds to the static form name newApply.
步骤702:向JSP文件写入静态部分和超文本标记语言(HTML,HyperTextMarkupLanguage)标签;Step 702: writing static part and hypertext markup language (HTML, HyperTextMarkupLanguage) tags to the JSP file;
向newApply.JSP中写入静态部分,包括JSP头部声明<%pagelanguage="java"contentType="text/html;charset=UTF-8"pageEncoding="UTF-8"%>和HTML标签<html><head><meta><body>。Write the static part to newApply.JSP, including JSP head declaration <%pagelanguage="java"contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%> and HTML tag <html> <head><meta><body>.
步骤703:读取静态表单的代码并将添加到JSP文件中的<body>标签内;Step 703: read the code of the static form and add it to the <body> tag in the JSP file;
步骤704:遍历并保存读取类型的变量集中的读取业务数据表数据的表单控件变量;Step 704: traverse and save the form control variables for reading business data table data in the variable set of the read type;
遍历保存读取业务数据表数据类型的表单控件变量,为这些表单控件变量生成Struts2标签前端代码以及给表单控件变量赋值的JavaScript代码,如varuserName=document.getElementById('userName');userName.value='<s:propertyvalue="user.userName"/>'。Traverse the form control variables that save and read the data type of the business data table, and generate Struts2 tag front-end code and JavaScript code for assigning values to the form control variables for these form control variables, such as varuserName=document.getElementById('userName'); userName.value= '<s:propertyvalue="user. userName"/>'.
步骤705:生成验证表单控件合法性的Javascript代码;Step 705: Generate Javascript code for verifying the legitimacy of the form control;
遍历并保存写入类型变量集中的获取用户业务数据的表单控件变量,对于其中的非空类型的表单控件变量,例如报修人姓名、家庭住址、移动电话,生成验证表单控件合法性的Javascript代码。Traverse and save the form control variables that obtain user business data in the write type variable set, and generate Javascript code to verify the legitimacy of the form control for non-empty form control variables, such as the name of the repairer, home address, and mobile phone.
步骤706:生成防止表单重复提交的JavaScript代码;Step 706: Generate JavaScript codes to prevent repeated form submission;
步骤707:生成对静态表单进行合法性验证的JavaScript代码;Step 707: Generate JavaScript code for validating the static form;
步骤707:将上述生成的代码写入空的JSP文件中,得到生成完整的前端JSP视图文件,将其存放于指定路径/web/content/JSP。Step 707: Write the above generated code into an empty JSP file to obtain a complete front-end JSP view file, and store it in the specified path /web/content/JSP.
图8为本发明实施例的生成Hibernate持久层的后端代码文件的实现流程示意图,如图8所示,包括以下步骤:Fig. 8 is the realization flowchart of the back-end code file that generates the Hibernate persistent layer of the embodiment of the present invention, as shown in Fig. 8, comprises the following steps:
步骤801:遍历所有的业务数据表;Step 801: traverse all business data tables;
通过Jdbc获取暖气报修系统所有的业务数据表如user、repair,并遍历所有的业务数据表。Obtain all business data tables of the heating repair system such as user and repair through Jdbc, and traverse all business data tables.
步骤802:获取业务数据表的数据结构;Step 802: Obtain the data structure of the business data table;
包括业务数据表的名称、字段类型和字段名称等信息。Including information such as the name of the business data table, field type, and field name.
步骤803:生成与业务数据表同名的POJO持久化类文件;Step 803: Generate a POJO persistent class file with the same name as the business data table;
包括User和Repair。Including User and Repair.
步骤804:遍历业务数据表的所有字段;Step 804: traverse all fields of the business data table;
步骤805:将字段对应的成员变量写入POJO持久化类文件;Step 805: Write the member variable corresponding to the field into the POJO persistent class file;
步骤806:生成与业务数据表中的字段名称和类型对应的Java类型的属性变量,将这些属性写入POJO类文件中。Step 806: Generate Java-type attribute variables corresponding to field names and types in the business data table, and write these attributes into the POJO class file.
步骤807:生成POJO类文件和DAO类文件。Step 807: Generate POJO class files and DAO class files.
生成的文件存储到指定路径/src/com/model/。The generated files are stored to the specified path /src/com/model/.
根据业务数据表的名称生成空的数据访问对象Java类(DAO),如UserDAO、RepairDAO,实例化空的Java可变字符串类源码变量StringBuilder,用于保存DAO类源码,将业务数据表user,repair对应的POJO类User,Repair分别作为该DAO类UserDAO,RepairDAO的属性user,repair,生成调用Hibernate接口的增删改查的基本操作的源码,并将这些源码添加到源码变量中,将保存DAO类源码的StringBuilder变量数据写入到空的DAO文件中,生成最终DAO类文件,将生成的文件放于指定的路径/src/com/DAO/。Generate an empty data access object Java class (DAO) according to the name of the business data table, such as UserDAO, RepairDAO, and instantiate an empty Java variable string class source code variable StringBuilder, which is used to save the DAO class source code, and store the business data table user, The POJO class User and Repair corresponding to repair are respectively used as the attributes user and repair of the DAO class UserDAO and RepairDAO to generate the source code for the basic operation of adding, deleting, modifying and checking the Hibernate interface, and add these source codes to the source code variable to save the DAO class. Write the StringBuilder variable data of the source code into an empty DAO file, generate the final DAO class file, and put the generated file in the specified path /src/com/DAO/.
图9为本发明实施例的生成Struts2控制层代码文件的实现流程示意图,如图9所示,包括以下步骤:Fig. 9 is the realization flowchart of the generation Struts2 control layer code file of the embodiment of the present invention, as shown in Fig. 9, comprises the following steps:
步骤901:获取暖气报修系统所有的业务数据表user、repair,循环遍历所有的业务数据表;Step 901: Obtain all business data tables user and repair of the heating repair reporting system, and loop through all business data tables;
步骤902:生成第一个Struts2控制器空Java类文件;Step 902: generating the first Struts2 controller empty Java class file;
生成用于处理用户的查看业务表单请求的第一个Struts2控制器空Java类文件,文件的名称对应静态表单的名称,如ApplyFirstAction。Generate the first empty Java class file of the Struts2 controller for processing the user's request to view the business form, and the name of the file corresponds to the name of the static form, such as ApplyFirstAction.
步骤903:实例化第一个Struts2控制器类文件源码的可变StringBuilder;Step 903: instantiate the variable StringBuilder of the source code of the first Struts2 controller class file;
实例化用于保存第一个Struts2控制器类文件的可变字符串源码变量StringBuilder。Instantiate the variable string source code variable StringBuilder used to save the first Struts2 controller class file.
步骤904:生成实例变量的getter和setter应用,并添加到StringBuilder中;Step 904: Generate getter and setter applications of instance variables and add them to StringBuilder;
将业务表对应的DAO持久化类实例以及POJO类实例作为控制器类的实例变量,如类ApplyFirst中包含User和UserDao类型的变量属性,生成这些控件变量的getter和setter应用,并将其添加到字符变量StringBuilder中。Use the DAO persistent class instance and POJO class instance corresponding to the business table as the instance variable of the controller class. For example, the class ApplyFirst contains variable attributes of User and UserDao types, generate getter and setter applications for these control variables, and add them to Character variable StringBuilder.
步骤905:生成第一个Struts2控制器类的execute应用,并添加到StringBuilder中;Step 905: Generate the execute application of the first Struts2 controller class and add it to StringBuilder;
生成第一个Struts2控制器类的execute应用,在方法内部调用DAO类实例的查询接口,如user=userDao.get(),并调用工作流引擎的API,将方法体添加到StringBuilder变量中。Generate the execute application of the first Struts2 controller class, call the query interface of the DAO class instance inside the method, such as user=userDao.get(), and call the API of the workflow engine, and add the method body to the StringBuilder variable.
步骤906:生成最终的第一个Struts2action文件,并置于指定的路径/src/com/action/;Step 906: Generate the final first Struts2action file and place it in the specified path /src/com/action/;
将第一个Struts2action的源码变量写入到第一个sturts2action的空文件中,生成最终的第一个Struts2action文件,并将文件置于指定的路径/src/com/action/。Write the source code variable of the first Struts2action into the empty file of the first sturts2action, generate the final first Struts2action file, and place the file in the specified path /src/com/action/.
步骤907:生成第二个Struts2控制器空Java类文件;Step 907: Generate a second Struts2 controller empty Java class file;
生成第二个Struts2控制器空Java类文件,文件的名称根据表单的名称,如ApplySecondAction。Generate an empty Java class file for the second Struts2 controller. The name of the file is based on the name of the form, such as ApplySecondAction.
步骤908:实例化保存第二个Struts2控制器类文件源码的可变StringBuilder;Step 908: Instantiate the variable StringBuilder that saves the source code of the second Struts2 controller class file;
步骤909:生成实例变量的getter和setter应用,并添加到StringBuilder中;Step 909: Generate getter and setter applications of instance variables and add them to StringBuilder;
将业务表对应的DAO持久化类实例以及POJO类实例作为控制器类的实例变量,生成这些实例变量的getter和setter应用,并将其添加到StringBuilder中。Use the DAO persistent class instance and POJO class instance corresponding to the business table as the instance variable of the controller class, generate getter and setter applications of these instance variables, and add them to StringBuilder.
步骤910:生成第二个Struts2控制器类的execute应用,并添加到StringBuilder;Step 910: Generate the execute application of the second Struts2 controller class and add it to StringBuilder;
生成第二个Struts2控制器类的execute应用,在应用内部调用DAO类实例的持久化接口如repairDao.add(repair),并调用工作流引擎的API,将应用体添加到StringBuilder。Generate the execute application of the second Struts2 controller class, call the persistent interface of the DAO class instance such as repairDao.add(repair) inside the application, and call the API of the workflow engine to add the application body to StringBuilder.
步骤911:生成最终的第二个Struts2action文件。Step 911: Generate the final second Struts2action file.
将第二个Struts2action的源码变量写入到第二个struts2action的空文件中,生成最终的第二个Struts2action文件,并将文件置于指定的路径/src/com/action。Write the source code variable of the second Struts2action into the empty file of the second struts2action to generate the final second Struts2action file, and place the file in the specified path /src/com/action.
图10为本发明实施例的生成Struts2XML配置文件的实现流程示意图,如图10所示,包括以下步骤:Fig. 10 is a schematic diagram of the implementation process of generating a Struts2XML configuration file according to an embodiment of the present invention, as shown in Fig. 10 , comprising the following steps:
步骤1001:生成空的Struts2XML配置文件;Step 1001: generating an empty Struts2XML configuration file;
文件名称为struts.XML。The file name is struts.XML.
步骤1002:实例化可变StringBuilder;Step 1002: instantiate variable StringBuilder;
用于保存Struts2XML配置文件的源码。Source code for saving Struts2XML configuration files.
步骤1003:将XML配置文件的声明添加到StringBuilder中;Step 1003: Add the declaration of the XML configuration file to StringBuilder;
步骤1004:生成XML配置文件的package节点,添加到StringBuilder中;Step 1004: Generate the package node of the XML configuration file and add it to StringBuilder;
步骤1005:根据静态表单生成action节点;Step 1005: generate an action node according to the static form;
action节点的属性name和class根据静态表单的名称,如<actionname="applyFirst"class="com.action.ApplyFistAction>"以及<actionname="applySecond"class="ApplySecondAction">;The attribute name and class of the action node are based on the name of the static form, such as <actionname="applyFirst"class="com.action.ApplyFistAction>" and <actionname="applySecond"class="ApplySecondAction">;
将源码变量中的数据写入XML空配置文件中,生成最终XML配置文件,并将其置于指定的路径。Write the data in the source variable into the empty XML configuration file, generate the final XML configuration file, and place it in the specified path.
步骤1004:生成action节点并赋予属性值;Step 1004: generating an action node and assigning attribute values;
根据静态表单生成action节点,action节点的属性name和class根据静态表单的名称,如<actionname="applyFirst"class="com.action.ApplyFistAction>"以及<actionname="applySecond"class="ApplySecondAction">。Action nodes are generated according to the static form, and the attribute name and class of the action node are based on the name of the static form, such as <actionname="applyFirst"class="com.action.ApplyFistAction>" and <actionname="applySecond"class="ApplySecondAction"> .
将源码变量中的数据写入XML空配置文件中,生成最终XML配置文件,并将其置于指定的路径。Write the data in the source variable into the empty XML configuration file, generate the final XML configuration file, and place it in the specified path.
根据上述生成的目标文件,部署流程定义,发起流程实例进行人机交互。According to the target file generated above, deploy the process definition and initiate the process instance for human-computer interaction.
其余人工任务节点受理员审核申请、值班经理派遣维修员、值班经理上传维修结果、受理员电话回访的代码生成过程同理,都会生成该人工任务节点对应的前端JSP视图文件、后台控制器StrutsAction文件、POJO文件、DAO文件以及向struts.xml配置文件中添加人工任务节点对应的actiondom节点。The code generation process of other manual task node acceptors reviewing applications, on-duty managers dispatching maintenance personnel, on-duty manager uploading maintenance results, and accepting personnel's telephone return visits will all generate front-end JSP view files and background controller StrutsAction files corresponding to the manual task nodes. , POJO file, DAO file, and add the actiondom node corresponding to the human task node to the struts.xml configuration file.
本发明实施例记载的代码生成系统可以采用目前流行的开发工具Eclipse插件形式进行安装部署,用户只需要把插件复制到对应的开发工具的目录,在对应的项目中选中进行代码的辅助生成,从而缩短了开发人员的开发周期,提高了开发效率;The code generation system recorded in the embodiment of the present invention can be installed and deployed in the form of a popular development tool Eclipse plug-in. The user only needs to copy the plug-in to the directory of the corresponding development tool, and select it in the corresponding project to perform auxiliary code generation. Shorten the development cycle of developers and improve development efficiency;
并且,本发明实施例记载的代码生成系统在针对业务逻辑的代码生成方面作出了创新,例如,开发人员只需要可视化的通过表单设计器来设计静态表单,并设置好表单控件的各种自定义属性,就可以生成符合相关业务逻辑的代码。代码生成系统生成的所有的代码都是基于模板的,模板可以按照公司的不同需求进行配置,从而对代码的自动生成实现了可定制化,在代码可用性、代码生成质量以及代码生成效率上都得到了极大的提高。Moreover, the code generation system recorded in the embodiments of the present invention has made innovations in code generation for business logic. For example, developers only need to visually design static forms through the form designer and set various custom forms for form controls. attribute, you can generate code that conforms to the relevant business logic. All codes generated by the code generation system are based on templates. Templates can be configured according to the different needs of the company, so that the automatic generation of codes can be customized, and the code availability, code generation quality and code generation efficiency are all obtained. greatly improved.
以上所述,仅为本发明的较佳实施例而已,并非用来限定本发明的保护范围。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310322858.5A CN103383645B (en) | 2013-07-29 | 2013-07-29 | Code generating method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310322858.5A CN103383645B (en) | 2013-07-29 | 2013-07-29 | Code generating method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103383645A CN103383645A (en) | 2013-11-06 |
CN103383645B true CN103383645B (en) | 2016-05-11 |
Family
ID=49491445
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310322858.5A Expired - Fee Related CN103383645B (en) | 2013-07-29 | 2013-07-29 | Code generating method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103383645B (en) |
Families Citing this family (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103744680B (en) * | 2014-01-16 | 2017-02-15 | 北京邮电大学 | Method and device for business process processing |
CN104461513B (en) * | 2014-11-21 | 2018-01-09 | 山东航天信息有限公司 | A kind of method and device for generating form interface |
CN104932904A (en) * | 2015-07-14 | 2015-09-23 | 福建农林大学 | Configurable database programming mode aiming at intelligent smart home |
US10810362B2 (en) * | 2015-07-17 | 2020-10-20 | Sap Se | Page-based incident correlation for network applications |
CN105068812B (en) * | 2015-08-19 | 2018-07-13 | 深圳联友科技有限公司 | A kind of list generation method and device |
CN106775788B (en) * | 2015-11-19 | 2019-08-20 | 中国科学院声学研究所 | A Method of Automatically Generating and Running JavaScript Files |
CN106886390B (en) * | 2015-12-15 | 2021-06-18 | 大唐软件技术股份有限公司 | Java object generating and converting method and Java object generating and converting device |
CN105824619A (en) * | 2016-03-10 | 2016-08-03 | 四川交通职业技术学院 | Code generator integrated based on Spring MVC framework, Apache Shiro framework and MyBatis framework |
CN107633008A (en) * | 2017-08-10 | 2018-01-26 | 阿里巴巴集团控股有限公司 | Web project data processing method, device, server and system |
CN107977236B (en) * | 2017-12-21 | 2020-11-13 | 上海智臻智能网络科技股份有限公司 | Question-answering system generation method, terminal device, storage medium and question-answering system |
CN108427554B (en) * | 2018-05-14 | 2023-09-08 | 华南理工大学 | A table-driven cloud model software automatic construction method and system |
CN109558125A (en) * | 2018-12-17 | 2019-04-02 | 太原市高远时代科技有限公司 | A kind of implementation method improving general information management software development efficiency |
CN109739546A (en) * | 2018-12-26 | 2019-05-10 | 深圳乐信软件技术有限公司 | Attribute parameter acquisition method, device, storage medium and server |
CN110045982A (en) * | 2019-03-28 | 2019-07-23 | 宋子杰 | A kind of embedded system configuration method based on source code polymerization |
CN110069246A (en) * | 2019-03-28 | 2019-07-30 | 北京众智益成科技有限公司 | The plateform system and its application that a kind of Java Web application is quickly developed |
CN110175022B (en) * | 2019-04-25 | 2023-10-13 | 平安科技(深圳)有限公司 | Method and device for automatically generating POJO class, storage medium and computer equipment |
CN110659027A (en) * | 2019-09-20 | 2020-01-07 | 京东方科技集团股份有限公司 | Code generation method and device and electronic equipment |
CN111666072A (en) * | 2020-06-09 | 2020-09-15 | 南京及物智能技术有限公司 | Software code and document robot method |
CN112052012B (en) * | 2020-08-31 | 2022-11-11 | 烽火通信科技股份有限公司 | XSLT and XSD-based code automatic generation method and equipment |
CN112416363B (en) * | 2020-12-09 | 2024-03-19 | 锐捷网络股份有限公司 | Method and device for generating front-end and back-end CRUD codes |
CN114035782A (en) * | 2021-10-22 | 2022-02-11 | 交通运输部南海航海保障中心广州通信中心 | Automatic code generation method and system based on form design and storage medium |
CN115080020A (en) * | 2022-05-09 | 2022-09-20 | 厦门游动网络科技有限公司 | Method, system, equipment and medium for batch generation of advertisement landing page codes |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101697120A (en) * | 2009-11-05 | 2010-04-21 | 河南辉煌科技股份有限公司 | Relational database based generation method of J2EE code |
CN102609503A (en) * | 2012-02-02 | 2012-07-25 | 福建榕基软件股份有限公司 | Method and device for generating static webpages |
CN102841791A (en) * | 2012-07-12 | 2012-12-26 | 上海高洁信息科技股份有限公司 | Method and system for generating online form |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030146937A1 (en) * | 2001-09-11 | 2003-08-07 | Lee Seung Woo | Multi-level data management system |
-
2013
- 2013-07-29 CN CN201310322858.5A patent/CN103383645B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101697120A (en) * | 2009-11-05 | 2010-04-21 | 河南辉煌科技股份有限公司 | Relational database based generation method of J2EE code |
CN102609503A (en) * | 2012-02-02 | 2012-07-25 | 福建榕基软件股份有限公司 | Method and device for generating static webpages |
CN102841791A (en) * | 2012-07-12 | 2012-12-26 | 上海高洁信息科技股份有限公司 | Method and system for generating online form |
Also Published As
Publication number | Publication date |
---|---|
CN103383645A (en) | 2013-11-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103383645B (en) | Code generating method and system | |
US7174286B2 (en) | Systems and methods for defining a simulated interactive web page | |
Brambilla et al. | Interaction flow modeling language: Model-driven UI engineering of web and mobile apps with IFML | |
CN109062567B (en) | B/S structure-based information management system rapid development platform | |
US9846849B2 (en) | System and method for providing an editor for use with a business process design environment | |
US20060026506A1 (en) | Test display module for testing application logic independent of specific user interface platforms | |
CN102426519A (en) | BPEL template and service multiplexing method and system based on associated data | |
US8661356B2 (en) | Time application having an intergrated check engine | |
US11886810B2 (en) | System and method for electronic document interaction with external resources | |
CN103744680A (en) | Method and device for business process processing | |
CN109783065A (en) | Generate the method and system of dialog mode user interface | |
US20230086854A1 (en) | Dynamically controlling case model structure using case fragments | |
CN108074074A (en) | Integration device and integration method thereof | |
Tesoriero et al. | Transformation architecture for multi-layered webapp source code generation | |
Inayatullah et al. | Model-based scaffolding code generation for cross-platform applications | |
CN117215556A (en) | Modularized page rapid construction method, system, equipment and medium | |
Sindhgatta et al. | An extensible framework for tracing model evolution in SOA solution design | |
CN115168779B (en) | Form flow processing method and device, computer equipment and storage medium | |
US12216992B2 (en) | System and method for electronic document interaction with external resources | |
Paternò et al. | Support for authoring service front-ends | |
Hermida et al. | XANUI: a textual platform-independent model for rich user interfaces | |
CN116909563A (en) | Page generation method, terminal device and storage medium | |
Aschenbrenner et al. | Fujaba goes web 2.0 | |
KR100949596B1 (en) | Modeling Methodology of Information Technology Architecture Using Internet | |
CN117111935A (en) | Industrial software low-code platform and metadata architecture thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160511 |