CN115562642A - Code generating method based on database and Mustache template engine - Google Patents

Code generating method based on database and Mustache template engine Download PDF

Info

Publication number
CN115562642A
CN115562642A CN202211334666.1A CN202211334666A CN115562642A CN 115562642 A CN115562642 A CN 115562642A CN 202211334666 A CN202211334666 A CN 202211334666A CN 115562642 A CN115562642 A CN 115562642A
Authority
CN
China
Prior art keywords
template
character
database
code
token
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.)
Pending
Application number
CN202211334666.1A
Other languages
Chinese (zh)
Inventor
马梦诗
褚帆
冀建东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Electronic Commerce Co Ltd
Original Assignee
Tianyi Electronic Commerce Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tianyi Electronic Commerce Co Ltd filed Critical Tianyi Electronic Commerce Co Ltd
Priority to CN202211334666.1A priority Critical patent/CN115562642A/en
Publication of CN115562642A publication Critical patent/CN115562642A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a code generating method based on a database and a Mustache template engine, which comprises a database data reading module, a template file creating module, a Mustache template engine analyzing module and a file output module, and is not only suitable for system engineering design, but also suitable for generating a specified template by using storage information of the database and outputting the specified template into an effective file; the method has the advantages that the project structure is not changed when the codes are generated, the manual spelling errors and the large working pressure of developers are reduced for the developers, the problems which possibly occur frequently in the test work are reduced, the development period of the software is greatly shortened, and the product competitiveness is improved.

Description

Code generating method based on database and Mustache template engine
Technical Field
The invention relates to the field of IT data development, in particular to a code generating method based on a database and a Mustache template engine.
Background
With the rapid development of science and technology and the increasing improvement of social life rhythm, the use degree and the requirements of users on common software are increased, so that enterprises are promoted to continuously update iterative products to optimize the user experience effect.
In the process of project development, business personnel spend most of the time from database design, interface design, service design, data layer design and object entity class design repeatedly editing similar contents when developing codes of business logic, and a large amount of repeated and complex processes are increased.
At present, several generation tools exist in the market, but the automatic generation of the corresponding codes can be realized only by aiming at a specific architecture and a specific scene, a method for automatically generating code files for the development of the whole front-end and back-end process codes does not exist, and the innovation and the expansion of the code generation method become more important in order to better solve the method or the system for automatically generating the code files based on the mass project architecture.
Frequent iteration, rapid version presentation and continuously increased pressure on development members of a project group, and the mode in the prior art needs a large workload of developers and long version online time, so that the method and the system for efficiently generating the code file have great significance in the process of project development.
Disclosure of Invention
The technical problem to be solved by the invention is to overcome the defects of the prior art and provide a code generating method based on a database and a Mustache template engine.
The invention provides the following technical scheme:
the invention provides a code generating method based on a database and a Mustache template engine, which comprises four functional modules, namely a database data reading module, a template file creating module, a Mustache template engine analyzing module and a file output module, and comprises the following steps:
s1, a user creates required database table structure information in advance according to business needs;
s2, creating template code files for requirements according to a project structure, wherein the template code files comprise a database persistent layer related mapping code template mapper.xml, a persistent layer processing code template mapper.java, an entity class BO code template entity.java and a business logic layer processing code template service.java, which are related to a back end, and page files related to a front end comprise front-end page code files such as html, vue and js;
s3, reading configuration files through JdbcTemplate, connecting database reading table structure information, and storing the configuration files in a data structure;
s4, analyzing the contents of the replacement template through a Mustache template engine to generate a required code, and outputting the generated code to a corresponding path;
and S5, compiling, running and releasing the code for creating the update to the server.
As a preferred technical solution of the present invention, the description database in step S1 is not limited to the commonly used mysql, oracle, pgsql, etc., and the database table structure designs the corresponding fields according to the content of the service requirement.
As a preferred embodiment of the present invention, the template scheme described in step S2 is based on any framework, and generates a required project code file according to its project requirement and project structure, including:
s2.1: xml mainly comprises related requirement methods such as adding, deleting, modifying and checking corresponding to xml constraint, and the needed table name and field are replaced by { { XXX } }'; java is a Class object structure containing a method corresponding to mapper.xml, and the introduced Jar packet structure and related BO contents are replaced by "{ { XXX } }";
s2.2: the method comprises the steps that a business logic layer in a project structure processes design and creation of a code template, wherein the template service is java, a Class object structure comprises a corresponding method called by an external interface, corresponding participation parameter and an entity DTO are replaced by a template character string '{ { XXX } }';
s2.3: the method comprises the steps of designing and creating an entity class code template in an item structure, wherein a template entity BO code file corresponds to a database table structure field in a one-to-one mode through a {/idColumn } }, { [ IDColumn } } cycle;
s2.4: and (3) designing and creating a front-end file template in the project structure, replacing field contents in the pitch < div > by using "{ { XXX } } for page template files default. Html or page.vue, and replacing related contents by using" { { first Up } } "for front-end logic JS files api. JS.
As an optimal technical scheme of the invention, step S3 describes that a configuration file is read through JdbcTemplate to connect with a database to read table structure information, the JdbcTemplate encapsulates the JDBC database interactive operation, the JdbcTemplate mainly encapsulates a loading drive creating database data source driving ManagerDataSource of JDBC, and the injection JDBC drive step injects driving ClassName for the driving ManagerDataSource attribute; comprises the following steps:
s3.1: creating a JdbcTemplate object by a new JdbcTemplate () method, wherein the introduced designed connection pool information comprises the table name information designed in the step S1 and the link address of the database: "jdbc: mysql:// 127.0.0.1;
s3.2: compiling a query table structure information statement "SELECT COLUMN _ name ', COLUMN _ comment', data _ type ', COLUMN _ KEY', EXTRA best format _ schema, COLUMNs WHERE table _ name = 'XXX' and table _ schema = 'XXX';
s3.3: and executing the operation of inquiring the statement database by using the existing JdbcTemplate object through a query method, and storing field lists including column names, detailed descriptions, physical types, java attribute names, primary keys and the like in a relevant storage List set List according to detailed information of a table structure inquired according to table constraints to prepare for the use of the subsequent step S4.
As a preferred technical scheme of the invention, the Mustache template engine core described in S4 replaces the marked content in the template file described in S2 with the data content in the data table stored in the data structure; the method is characterized in that a template is converted into a token nested array, tokens and data are combined to generate character strings, the character strings are split according to different types and then packaged into an array, and the detail steps of the stored character strings corresponding to Mustache engine identification information are as follows:
s4.1: disassembling the template character strings and classifying; when the generation code is selected, the program will read the created templates in S2 in sequence, and the columns wrapped by "{" and "} } are definitely used as a string of template character strings where the key variables are used or traversal and if judgment is used in the template character strings: "< ul > { # name } } < li > < dl > < dt > { # age } } { # hobbys } } < dd > { } } } } </dd > {/hobbys } } dt > </dl > </li > </ul", the common character strings are all on the left of the "{", so the common character string can be found by searching the position of the "{", and then the interception is carried out; finding the position of "}", then intercepting and circulating until no character string can be intercepted, and thus the intercepted template character string becomes "< ul > { {", "xxx" and "} < li > -;
s4.2: converting the character string template into a token array; the scanner receives the template content as the construction parameter, and depends on two scanner methods scan and scanUntil inside the Mustache, wherein the scan method is used for enabling the pointer to skip the specified mark, and the scanUntil method is used for searching the specified mark in a character traversal manner; circularly recursion token array, acquiring character strings in front of the start separator, storing the character strings into the token array in a text mode, skipping the start separator, acquiring character strings between the start separator and the end separator, storing the character strings into the token array in a # mode if the start character is "#", storing the character strings into the token array in a/' mode if the start character is "/", skipping the end separator, obtaining the character string array after tiling grouping, and returning the character string to the token array;
s4.3: grouping and assembling tokens arrays; pushing the token character string array returned by S4.2 by applying the thought (first-in last-out/last-in first-out) of a data structure stack when meeting the "#" character, and popping when meeting the "/" character, wherein the contents between the "#" character and the "/" character are sub-elements of the character; when the "#" character is encountered, pushing the current token (the token is the attribute of a single character string after the token circulation) into the stack entry array, setting a result collector as the subset of the token which is just stacked, when the "/" character is encountered, removing the newest token in the stack array, setting the result collector as the subset of the top token in the stack array, or a final structure set, if the "#" character and the "/" character are not encountered, directly adding the current token into the result set, and returning the assembled token result set array;
s4.4: rendering the template character string into a code file according to tokens; circulating tokens, and matching a 'text' character with a common character string to directly splice; if the attribute of the 'name' character child parent object accesses the object attribute, the existing lookup method is used for dynamically accessing the deep attribute on the object in the form of character strings to obtain analyzed character string splicing processing, if the attribute is in the form of '#' character, the character strings are generated and then spliced by circularly analyzing tokens character string templates, and finally the character strings after splicing processing are rendered code files.
As a preferred technical scheme of the invention, in the step S5, the written character strings of the tool class are output to the file through the FileUtils file, the character strings analyzed by the mustache template engine analysis module are generated into corresponding code files, and the compiling project is deployed to the server.
Compared with the prior art, the invention has the following beneficial effects:
1. the automatic generation of the corresponding code file can be realized without aiming at a specific architecture;
2. front-end codes and rear-end codes can be generated through parsing of a Mustache template engine, and the file types are not limited;
3. the method has the advantages that the method is automatically deployed to the path address, so that one-key and intelligentization of code release is realized, the deployment is simplified, and the efficiency is improved;
4. the code generation method of the scheme is a set of independent method, and tools such as additional Jar packages and the like do not need to be added in the project; different from the common code generation method of introducing external Jar packages into project integration in the market at present, the method is completely decoupled from the demand project, does not influence each other and does not influence the original structure;
5. the method is not only suitable for system engineering design, but also can generate the data content into a specified template and output the template into an effective file according to the storage information of the database; the method has the advantages that the project structure is not changed when the codes are generated, the manual spelling errors and the large working pressure of developers are reduced for the developers, the problems which possibly occur frequently in the test work are reduced, the development period of the software is greatly shortened, and the product competitiveness is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart of the operation of the present invention;
FIG. 2 is a configuration database table structure information page display diagram according to the present invention;
fig. 3 is a flow chart of the overall structure of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it should be understood that they are presented herein only to illustrate and explain the present invention and not to limit the present invention. Wherein like reference numerals refer to like parts throughout.
Example 1
As shown in fig. 1-3, the method and system for automatically generating a code file based on a database table of the present invention is adapted to the development of a common front-end and back-end code framework, and as shown in fig. 3, includes the following steps:
s1: a user creates required database business table structure information in advance according to business needs; the database is not limited to Mysql, oracle, pgsql, etc., and the Mysql database is used in this example.
S2: the method comprises the steps of designing a code template scheme for a service table according to a project structure, wherein the code template scheme comprises a database persistent layer related mapping code template mapper.xml, a persistent layer processing code template mapper.java, an entity class BO code template entity.java, dto.java, a service logic layer processing code template service.java and service Impl.java, which are related to a back end, and page files related to a front end comprise front end page code files including but not limited to a front end form page display code template default.html, page.vue, a page logic code template api.js and the like.
S2.1: xml mainly comprises related requirement methods such as addition, deletion, modification and the like corresponding to the restraint of xml, and required table names are replaced by fields such as "{ { tableName } }" and return values by "{ { firstUp } }" and the like; java is a Class object structure containing a method corresponding to mapper.xml, and the introduced Jar packet structure and related BO contents are replaced with "{ { firstDown } }";
s2.2: java is a corresponding method for a Class object structure including external interface calling, and corresponding entries and entries are referred to and entity DTO is filled with template character strings "{ { firstUp } }", "{ { firstDown } }";
s2.3: designing and creating an entity class code template in a project structure, wherein a BO code file of an entity class of java passes through a code module
"{{/idColumn}}{{^idColumn}}
private{{javaType}}{{prop}};
{{/idColumn}}{{/columns}}";
Circulating fields corresponding to the database table structures one by one;
s2.4: and (3) designing and creating a front-end file template in the project structure, and replacing variable values in the table with "{ { prop } }" for page template files default. Listed as an "input" tag: the field contents in "< inputfields =" form-control input-sm "id =" update _ { { prop } } name = "{ { prop } }" placeholder = "{ { label } }" type = "text" data-bv-checkpoint unscafee letters = "true" required = "required"/>, the front-end logical JS file api.
S3: and reading the configuration file through the JdbcTemplate to connect the database to read the table structure information.
S3.1: creating a JdbcTemplate object by a new JdbcTemplate () method, wherein the introduced designed connection pool information comprises the table name information designed in the step S1 and the link address of the database: "jdbc: mysql:// 127.0.0.1;
s3.2: the query table structure information statement "SELECT COLUMN _ name ', COLUMN _ comment', data _ type ', COLUMN _ KEY', outer conversion _ schema. and table _ schema =? "
S3.3: and executing the operation of querying the statement database by using the conventional Jdbctemplate object through a query method, and inquiring out the detailed information of the table structure according to the table constraint, wherein the field List in the service table, including the column name, the detailed description, the physical type, the Java attribute name, the primary key and the like, is stored in the relevant storage List set List to prepare for the use of the subsequent step S4.
S4: and replacing the template content by the Mustache template to generate a required code, and outputting the generated code to a corresponding path for updating and releasing.
S4.1: and (5) disassembling the template character strings and classifying. When the generation code is selected, the program will read the created templates in S2 in sequence, and the columns wrapped by "{" and "} } are definitely used as a string of form" template string where the key variables are used in the template string or traversal and if judgment are used: "< form class =" form-horizontal bv-form "id =" insert-form "method =" post "{ # columns } } divclass =" form-group "> < label class =" col-lg-2 control-label "> < font colour =" red "> < label > { (label } } label > < label =" col-lg-2 control-label "> < label colour =" red "> < label > { (label } } label > < div class =" col-lg-8"> < input class =" form-control input-sm "=" update _ { { prop } } "name =" { { prop } } plan { } place = "{ { label } }" type = "text" data-bv-checkpoint unscented letters = "true" required = "required"/> < div > </div > {/columns } } form > ", the common character string is on the left of the" { { "so that the common character string can be found by looking up the position of the" { { "and then intercepted. Finding the position of '}' and then intercepting and circulating until no character string can be intercepted, so that the intercepted template character string becomes a required page code;
s4.2: the string template is converted into a tokens array. The scanner receives the template content and makes the parameter of its structure, rely on two scanner methods scan and scanUtil inside Mustache, the role of the scan method is to make the pointer jump over the appointed mark, the role of the scanUtil method is to search for the appointed mark through a character traversal, the cyclic recursion method obtains the character string between the beginning separator and the ending separator and the character string before and after the separator to be reassembled with relevant characters such as "#", "/", etc., and return the character string;
s4.3: groups are assembled into token arrays. When the "#" character is encountered, pushing the current token into the stack array, setting a result collector as a subset of the token which is just stacked, when the "/" character is encountered, removing the newest stack in the stack array, setting the result collector as the subset of the top token in the stack array or a final structure set, if the "#" character and the "/" character are not encountered, directly adding the current token into the result set, and returning to the assembled token array;
s4.4: and rendering the template character strings into a code file according to tokens. And (5) circulating tokens, and directly splicing common character strings. If the attribute of the child parent object access object dynamically accesses the deep attribute of the object in the form of character strings by using a lookup method, analyzing the cycle in the character string template to obtain the finally generated character strings, and finally rendering the character strings into a code file.
S5: and outputting the code file to a specified directory, and reissuing the code for compiling and deploying.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (6)

1. The code generating method based on the database and the Mustache template engine comprises a database data reading module, a template file creating module, a Mustache template engine analyzing module and a file output module, and is characterized by comprising the following steps of:
s1, a user creates required database table structure information in advance according to business needs;
s2, creating template code files for requirements according to a project structure, wherein the template code files comprise a database persistent layer related mapping code template mapper.xml, a persistent layer processing code template mapper.java, an entity class BO code template entity.java and a business logic layer processing code template service.java, which are related to a back end, and page files related to a front end comprise front-end page code files such as html, vue and js;
s3, reading configuration files through JdbcTemplate, connecting database reading table structure information, and storing the configuration files in a data structure;
s4, analyzing the contents of the replacement template through a Mustache template engine to generate a required code, and outputting the generated code to a corresponding path;
and S5, compiling, running and releasing the code for creating the update to the server.
2. The method for generating codes based on the database and the Mustache template engine according to claim 1, wherein the description database in step S1 is not limited to commonly used mysql, oracle, pgsql, etc., and the database table structure designs corresponding fields according to the content of the service requirement.
3. The method for generating codes based on the database and the Mustache template engine according to claim 1, wherein the template scheme described in step S2 is based on any framework, and generates the required project code file according to the project requirement and the project structure, and includes:
s2.1: xml mainly comprises related requirement methods such as adding, deleting, modifying and checking corresponding to xml constraint, and the like, and required table names and fields are replaced by { { XXX } }'; java is a Class object structure containing a method corresponding to mapper.xml, and the introduced Jar packet structure and related BO contents are replaced by "{ { XXX } }";
s2.2: the method comprises the steps that a business logic layer in a project structure processes design and creation of a code template, wherein the template service is java, a Class object structure comprises a corresponding method called by an external interface, corresponding participation parameter and an entity DTO are replaced by a template character string '{ { XXX } }';
s2.3: designing and creating an entity class code template in a project structure, wherein a template entity class BO code file is in one-to-one correspondence with a database table structure field through a {/idColumn } } and { ^ idColumn } } cycle;
s2.4: and (3) designing and creating a front-end file template in the project structure, replacing field contents in the pitch < div > by using "{ { XXX } } for page template files default. Html or page.vue, and replacing related contents by using" { { first Up } } "for front-end logic JS files api. JS.
4. The database and Mustache template engine-based code generation method according to claim 1, wherein step S3 describes that the configuration file is read through jdbcttemplate to connect with database read table structure information, the jdbcttemplate encapsulates JDBC database interaction operations, a JDBC loading driver is mainly encapsulated to create a database data source driver manager database source, and the JDBC driving step injects a driver class name for the JDBC attribute; comprises the following steps:
s3.1: creating a JdbcTemplate object by a new JdbcTemplate () method, wherein the introduced designed connection pool information comprises the table name information designed in the step S1 and the link address of the database: "jdbc: mysql:// 127.0.0.1;
s3.2: compiling a query table structure information statement "SELECT COLUMN _ name ', COLUMN _ comment', data _ type ', COLUMN _ KEY', extract FROM information _ schema, COLUMNs WHERE table _ name = 'XXX' and table _ schema = 'XXX';
s3.3: and executing the operation of inquiring the statement database by using the existing JdbcTemplate object through a query method, and storing field lists including column names, detailed descriptions, physical types, java attribute names, primary keys and the like in a relevant storage List set List according to detailed information of a table structure inquired according to table constraints to prepare for the use of the subsequent step S4.
5. The method for generating codes based on the database and the Mustache template engine according to claim 1, wherein the Mustache template engine core described in S4 replaces the data content of the data table stored in the data structure with the mark content in the template file described in S2; the method is characterized in that a template is converted into a token nested array, then the tokens and data are combined to generate character strings, then the character strings are split according to different types and packaged into an array, and the detail steps of the stored character strings corresponding to Mustache engine identification information are as follows:
s4.1: disassembling the template character strings and classifying; when the generation code is selected, the program will read the created templates in S2 in sequence, and the columns wrapped by "{" and "} } are definitely used as a string of template character strings where the key variables are used or traversal and if judgment is used in the template character strings: "< ul > { # name } } < li > < dl > < dt > { # age } } { # hobbys } } < dd > { } } } } </dd > {/hobbys } } dt > </dl > </li > </ul", the common character strings are all on the left of the "{", so the common character string can be found by searching the position of the "{", and then the interception is carried out; finding the position of "}", and then intercepting a loop until no character string can be intercepted, so that the intercepted template character string becomes "< ul > { {", "xxx" and "} < li >. Once";
s4.2: converting the character string template into a token array; the scanner receives the template content as the constructed parameter, and depends on two scanner methods, namely scan and scan Until, inside the Mustache, wherein the scan method is used for enabling the pointer to skip the specified mark, and the scan Util method is used for traversing one character to search the specified mark; circularly recursion token array, acquiring character strings in front of the start separator, storing the character strings into the token array in a text mode, skipping the start separator, acquiring character strings between the start separator and the end separator, storing the character strings into the token array in a # mode if the start character is "#", storing the character strings into the token array in a/' mode if the start character is "/", skipping the end separator, obtaining the character string array after tiling grouping, and returning the character string to the token array;
s4.3: grouping and assembling tokens arrays; pushing the token character string array returned by S4.2 by applying the thought (first-in last-out/last-in first-out) of a data structure stack when meeting the "#" character, and popping when meeting the "/" character, wherein the contents between the "#" character and the "/" character are sub-elements of the character; when the "#" character is encountered, pushing the current token (the token is the attribute of a single character string after the token circulation) into the stack entry array, setting a result collector as the subset of the token which is just stacked, when the "/" character is encountered, removing the newest token in the stack array, setting the result collector as the subset of the top token in the stack array, or a final structure set, if the "#" character and the "/" character are not encountered, directly adding the current token into the result set, and returning the assembled token result set array;
s4.4: rendering the template character string into a code file according to tokens; circulating tokens, and matching a 'text' character with a common character string to directly splice; if the attribute of the 'name' character child parent object access object uses the existing lookup method to dynamically access the deep attribute on the object in the form of character strings, the analyzed character string splicing processing is obtained, if the attribute of the '#' character child parent object access object is in the form of character strings, the generated character strings are obtained through circulation in a '#' character analysis token character string template, then the character strings are spliced, and finally the spliced character strings are rendered code files.
6. The code generation method based on the database and the Mustache template engine according to claim 1, wherein in the step S5, the written character strings of the tool class are output to the file through a FileUtils file, the character strings analyzed by the parsing module of the Mustache template engine are generated into corresponding code files, and the compiling project is deployed to the server.
CN202211334666.1A 2022-10-28 2022-10-28 Code generating method based on database and Mustache template engine Pending CN115562642A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211334666.1A CN115562642A (en) 2022-10-28 2022-10-28 Code generating method based on database and Mustache template engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211334666.1A CN115562642A (en) 2022-10-28 2022-10-28 Code generating method based on database and Mustache template engine

Publications (1)

Publication Number Publication Date
CN115562642A true CN115562642A (en) 2023-01-03

Family

ID=84769490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211334666.1A Pending CN115562642A (en) 2022-10-28 2022-10-28 Code generating method based on database and Mustache template engine

Country Status (1)

Country Link
CN (1) CN115562642A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117539450A (en) * 2024-01-09 2024-02-09 云筑信息科技(成都)有限公司 Code generation method based on WPS loading item
CN117573622A (en) * 2024-01-15 2024-02-20 北京持安科技有限公司 Method and device for automatically cleaning abandoned interfaces in front-end projects
CN117539450B (en) * 2024-01-09 2024-05-10 云筑信息科技(成都)有限公司 Code generation method based on WPS loading item

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117539450A (en) * 2024-01-09 2024-02-09 云筑信息科技(成都)有限公司 Code generation method based on WPS loading item
CN117539450B (en) * 2024-01-09 2024-05-10 云筑信息科技(成都)有限公司 Code generation method based on WPS loading item
CN117573622A (en) * 2024-01-15 2024-02-20 北京持安科技有限公司 Method and device for automatically cleaning abandoned interfaces in front-end projects
CN117573622B (en) * 2024-01-15 2024-04-09 北京持安科技有限公司 Method and device for automatically cleaning abandoned interfaces in front-end projects

Similar Documents

Publication Publication Date Title
US9390097B2 (en) Dynamic generation of target files from template files and tracking of the processing of target files
US9804837B2 (en) System and method for creating, managing, and reusing schema type definitions in services oriented architecture services, grouped in the form of libraries
US8683324B2 (en) Dynamic generation of target files from template files and tracking of the processing of target files
Hsu et al. Generating finite-state transducers for semi-structured data extraction from the web
US8924837B2 (en) Text file interface support in an object oriented application
CN109582647B (en) Unstructured evidence file oriented analysis method and system
US8397157B2 (en) Context-free grammar
JPH0512095A (en) Coding, storing and recovering means and method of hierarchical structural data processing information for computer-system
CN101334728A (en) Interface creating method and platform based on XML document description
US20060036631A1 (en) High performance XML storage retrieval system and method
US20200012661A1 (en) Synchronizing resource type and property structures
CN115202626A (en) Low-code front-end development method supporting multi-technology stack components
Thao et al. Using versioned tree data structure, change detection and node identity for three-way xml merging
CN115562642A (en) Code generating method based on database and Mustache template engine
CN113704575B (en) SQL method, device, equipment and storage medium for analyzing XML and Java files
CN112130952A (en) Multi-language display method, device, equipment and product
Bock et al. PAW—Towards a physics analysis workstation
Škrbić et al. Bibliographic records editor in XML native environment
Schmidt PHP Programming with PEAR XML, Data, Dates, Web Services, and Web APIs
JP4334450B2 (en) Structured document search apparatus and structured document search method
CN111310414A (en) RDF format file analysis method and RDF format file generation method
CN114661837A (en) Penetration query method, system, storage medium and equipment
CN111190917A (en) Data processing method and device
Secosky A Sampler of What's New in Base SAS® 9.2
Wang Internationalization of Faculty Websites Using XML.

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication