CN109710218B - Object automatic conversion method and terminal - Google Patents

Object automatic conversion method and terminal Download PDF

Info

Publication number
CN109710218B
CN109710218B CN201811417616.3A CN201811417616A CN109710218B CN 109710218 B CN109710218 B CN 109710218B CN 201811417616 A CN201811417616 A CN 201811417616A CN 109710218 B CN109710218 B CN 109710218B
Authority
CN
China
Prior art keywords
class
field
annotation
creating
apt
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.)
Active
Application number
CN201811417616.3A
Other languages
Chinese (zh)
Other versions
CN109710218A (en
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.)
Fujian Tianquan Educational Technology Ltd
Original Assignee
Fujian Tianquan Educational Technology 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 Fujian Tianquan Educational Technology Ltd filed Critical Fujian Tianquan Educational Technology Ltd
Priority to CN201811417616.3A priority Critical patent/CN109710218B/en
Publication of CN109710218A publication Critical patent/CN109710218A/en
Application granted granted Critical
Publication of CN109710218B publication Critical patent/CN109710218B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides an object automatic conversion method and a terminal, wherein a first class containing a conversion identifier in a data transmission object DTO is obtained according to a preset conversion identifier corresponding to the class; judging whether the first class comprises a preset conversion processing identifier, if so, changing a null field in the first class into an empty character string, and creating a corresponding second class in the view object VO through an APT technology according to the changed first class; if not, according to the first class, creating a corresponding second class in the view object VO through an APT technology; acquiring a first increment field containing the annotation of the increment field in the DTO according to the annotation of the preset increment field; and according to the first increment field, a corresponding second increment field in the view object VO is created through an APT technology to realize the conversion of DTO into the corresponding VO, so that the corresponding class and the increment field can be automatically converted, and the processing efficiency of object conversion is improved.

Description

Object automatic conversion method and terminal
Technical Field
The invention relates to the technical field of data processing, in particular to an object automatic conversion method and a terminal.
Background
In the conventional Android data display layer, data returned by a server side is directly converted into an entity, and the data is displayed by acquiring a field, but the following disadvantages are caused if the data is directly used:
1. null is returned possibly in a certain field of returned data, and a plurality of judgment operations are required in the use process, so that the code amount is increased to a certain extent;
2. the data structure or one or more field names returned by the server side are changed, so that the client side crashes;
3. the data structure returned by the server is not required.
In the existing scheme of converting a Data Transfer Object (DTO) into a View Object (VO), a layer of conversion layer is manually added before displaying data, and data at a server is converted into a data structure of a target object, and no matter what type of data returned by an interface is, a client finally obtains only converted fields to display the data, but the number of code layers is increased, each interface needs to be converted, and when many fields are returned, the conversion needs more operations, and the workload is greatly increased.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the invention provides an object automatic conversion method and a terminal, which improve the efficiency of object conversion.
In order to solve the technical problem, the invention provides an object automatic conversion method, which comprises the following steps:
s1: acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to a preset conversion identifier corresponding to the class;
s2: judging whether the first class comprises a preset conversion processing identifier, if so, changing a null field in the first class into an empty character string, and creating a corresponding second class in the view object VO through an APT technology according to the changed first class; if not, according to the first class, creating a corresponding second class in the view object VO through an APT technology;
s3: acquiring a first increment field containing the annotation of the increment field in the DTO according to the annotation of the preset increment field; and according to the first increment field, creating a corresponding second increment field in the view object VO through an APT technology.
The invention provides an object automatic conversion terminal, which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the following steps:
s1: acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to a preset conversion identifier corresponding to the class;
s2: judging whether the first class comprises a preset conversion processing identifier, if so, changing a null field in the first class into an empty character string, and creating a corresponding second class in the view object VO through an APT technology according to the changed first class; if not, according to the first class, creating a corresponding second class in the view object VO through an APT technology;
s3: acquiring a first increment field containing the annotation of the increment field in the DTO according to the annotation of the preset increment field; and according to the first increment field, creating a corresponding second increment field in the view object VO through an APT technology.
The invention has the beneficial effects that:
the invention provides an object automatic conversion method and a terminal, which acquire a first class and a first increment field corresponding to a DTO (data transmission destination) in a DTO (data transfer destination) according to a preset conversion identifier and a comment of the increment field corresponding to the class, create a second increment field and a second class corresponding to a VO (view object) in the DTO by an APT (Android package) technology, and respectively change null fields into empty character strings, through the method, the first class containing the conversion identifier and the first increment field containing the increment field in the DTO can be intelligently acquired, the corresponding second class and second increment fields can be created and generated by the Android APT technology, and simultaneously the null field in the DTO can be changed into the empty character strings before being converted into the second class so as to realize the conversion of the DTO into the corresponding VO, the corresponding class and increment field can be automatically converted, and the problem that a client is crashed due to the change of the field name or the class name is prevented, and the number of code layers is not required to be increased, so that the steps required by conversion are simplified, and the efficiency of object conversion is improved.
Drawings
FIG. 1 is a schematic diagram illustrating the main steps of an automatic object transformation method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an object automatic switching terminal according to an embodiment of the present invention;
description of reference numerals:
1. a memory; 2. a processor.
Detailed Description
In order to explain technical contents, objects and effects of the present invention in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
The most key concept of the invention is as follows: and acquiring a first class and a first increment field corresponding to the DTO of the data transmission object according to the preset conversion identifier corresponding to the class and the annotation of the increment field, creating a second class and a second increment field corresponding to the VO of the view object through an APT technology, and respectively changing null fields into empty character strings.
The noun explains:
APT (abbreviation of Annotation Processing Tool) can analyze the Annotation in the code compiling period and generate a new Java file, thereby reducing manual code input.
Referring to fig. 1, the present invention provides an object automatic conversion method, which includes the following steps:
s1: acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to a preset conversion identifier corresponding to the class;
s2: judging whether the first class comprises a preset conversion processing identifier, if so, changing a null field in the first class into an empty character string, and creating a corresponding second class in the view object VO through an APT technology according to the changed first class; if not, according to the first class, creating a corresponding second class in the view object VO through an APT technology;
s3: acquiring a first increment field containing the annotation of the increment field in the DTO according to the annotation of the preset increment field; and according to the first increment field, creating a corresponding second increment field in the view object VO through an APT technology.
From the above description, it can be seen that the method for automatically converting an object provided by the present invention obtains a first class and a first increment field corresponding to a DTO by data transmission according to a preset conversion identifier and a comment of the increment field corresponding to the class, creates a second increment field and a second class corresponding to a view object VO by an APT technique, and changes a null field therein to a null character string, respectively, and by the above method, the first class containing a conversion identifier and the first increment field containing an increment field in the DTO can be intelligently obtained, and by the APT technique of Android, the corresponding second class and second increment field can be created and generated, and at the same time, the null field therein can be changed to a null character string before being converted to the second class, so as to realize that the DTO is converted to a corresponding VO, and the corresponding class and increment field can be automatically converted, thereby preventing a field name or a class name from being changed, the problem of client crash is caused, the number of code layers does not need to be increased, steps required by conversion are simplified, and the efficiency of object conversion is improved.
Further, the creating, according to the first class and by an APT technique, a corresponding second class in the view object VO specifically is:
acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to a preset conversion identifier corresponding to the class;
according to the first class, creating a corresponding class name and a corresponding variable name in the view object VO through an APT technology;
copying the fields in the first class into the VO;
assigning the variable values in the first class to the variables of the corresponding variable names in the VO one by one;
and obtaining the second class according to the field, the class name, the variable name and the variable after the variable name is correspondingly assigned.
From the above description, it can be known that, by the above method, the corresponding second class in the VO can be automatically created according to the first class containing the conversion identifier in the DTO, and the class name and the variable name in the second class are changed while the variable values of the fields and the variables in the second class are not affected.
Further, the step S2 is followed by:
and judging whether the first class contains a preset first field renaming annotation, if so, modifying the field name in the second class according to the first field renaming annotation through an APT (advanced persistent program) technology.
As is apparent from the above description, the field names in the second class can be automatically changed by the above method.
Further, the step S3 is followed by:
and judging whether the first incremental field contains a preset second field renaming annotation, if so, modifying the field name in the second incremental field by an APT technology according to the second field renaming annotation.
From the above description, it can be known that, by the above method, the field name in the second incremental field can be automatically changed to ensure that the changed second incremental field matches the VO.
Further, the S1 is preceded by:
after introducing an APT technology into a project corresponding to a DTO, creating a first java library, wherein the first java library comprises a conversion identifier, a field renaming annotation and an annotation of an incremental field;
and creating a second java library, wherein the second java library comprises an open-source java code generation framework and a plurality of third-party libraries.
As can be seen from the above description, with the above method, according to the conversion identifier and the incremental field obtained from the first java library, the first class including the conversion identifier and the first incremental field including the incremental field in the item can be obtained, so that according to the third party library and the java code generation framework in the second java library, the corresponding second class and second incremental field are created, and according to the field renaming annotation, the corresponding field renaming is performed.
Referring to fig. 2, the present invention provides an object automatic conversion terminal, including a memory 1, a processor 2 and a computer program stored in the memory 1 and capable of running on the processor 2, wherein the processor 2 implements the following steps when executing the computer program:
s1: acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to a preset conversion identifier corresponding to the class;
s2: judging whether the first class comprises a preset conversion processing identifier, if so, changing a null field in the first class into an empty character string, and creating a corresponding second class in the view object VO through an APT technology according to the changed first class; if not, according to the first class, creating a corresponding second class in the view object VO through an APT technology;
s3: acquiring a first increment field containing the annotation of the increment field in the DTO according to the annotation of the preset increment field; and according to the first increment field, creating a corresponding second increment field in the view object VO through an APT technology.
As can be seen from the above description, the object automatic conversion terminal provided by the present invention obtains the first class and the first incremental field corresponding to the DTO by data transmission according to the annotations of the preset conversion identifier and the incremental field corresponding to the class, creates the second incremental field and the second class corresponding to the view object VO by the APT technique, and changes the null field therein to the empty character string, respectively, by the above method, the first class containing the conversion identifier and the first incremental field containing the incremental field in the DTO can be intelligently obtained, and the corresponding second class and the second incremental field can be created and generated by the Android APT technique, and simultaneously the null field therein can be changed to the empty character string before being converted to the second class, so as to realize that the DTO is converted to the corresponding VO, the present invention can automatically convert the corresponding class and the incremental field, and prevent the field name or the class name from being changed, the problem of client crash is caused, the number of code layers does not need to be increased, steps required by conversion are simplified, and the efficiency of object conversion is improved.
From the above description, it can be known that, through the terminal, the corresponding second class in the VO can be automatically created according to the first class containing the conversion identifier in the DTO, and the class name and the variable name in the second class are changed while the variable values of the fields and the variables in the second class are not affected.
Further, the creating, according to the first class and through an APT technique, a corresponding second class in the view object VO by the object automatic transition terminal specifically includes:
acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to a preset conversion identifier corresponding to the class;
according to the first class, creating a corresponding class name and a corresponding variable name in the view object VO through an APT technology;
copying the fields in the first class into the VO;
assigning the variable values in the first class to the variables of the corresponding variable names in the VO one by one;
and obtaining the second class according to the field, the class name, the variable name and the variable after the variable name is correspondingly assigned.
From the above description, it can be known that, by the above method, the corresponding second class in the VO can be automatically created according to the first class containing the conversion identifier in the DTO, and the class name and the variable name in the second class are changed while the variable values of the fields and the variables in the second class are not affected.
Further, the object automatic switching terminal further includes, after the S2:
and judging whether the first class contains a preset first field renaming annotation, if so, modifying the field name in the second class according to the first field renaming annotation through an APT (advanced persistent program) technology.
As is apparent from the above description, the field names in the second class can be automatically changed by the above method.
Further, the object automatic switching terminal further includes, after the S3:
and judging whether the first incremental field contains a preset second field renaming annotation, if so, modifying the field name in the second incremental field by an APT technology according to the second field renaming annotation.
From the above description, it can be known that, by the above method, the field name in the second incremental field can be automatically changed to ensure that the changed second incremental field matches the VO.
Further, the object automatic switching terminal further includes, before the step S1:
after introducing an APT technology into a project corresponding to a DTO, creating a first java library, wherein the first java library comprises a conversion identifier, a field renaming annotation and an annotation of an incremental field;
and creating a second java library, wherein the second java library comprises an open-source java code generation framework and a plurality of third-party libraries.
As can be seen from the above description, with the above method, according to the conversion identifier and the incremental field obtained from the first java library, the first class including the conversion identifier and the first incremental field including the incremental field in the item can be obtained, so that according to the third party library and the java code generation framework in the second java library, the corresponding second class and second incremental field are created, and according to the field renaming annotation, the corresponding field renaming is performed.
Referring to fig. 1, a first embodiment of the present invention is:
the invention provides an object automatic conversion method, which comprises the following steps:
s0: after introducing an APT technology into a project corresponding to a DTO, creating a first java library, wherein the first java library comprises a conversion identifier, a field renaming annotation and an annotation of an incremental field;
creating a second java library, wherein the second java library comprises an open source java code generation framework and a plurality of third party libraries;
wherein the field renaming annotation comprises a first field renaming annotation and a second field renaming annotation; the conversion identifier corresponds to the class, namely the conversion identifier is positioned in the class; the conversion processing identifier is also located in the class, and certainly, all classes do not contain the identifier and need to be judged;
s1: acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to the conversion identifier corresponding to the class;
s2: judging whether the first class comprises a preset conversion processing identifier, if so, changing a null field in the first class into an empty character string, and creating a corresponding second class in the view object VO through an APT technology according to the changed first class; if not, according to the first class, creating a corresponding second class in the view object VO through an APT technology;
wherein, according to the first class, creating, by an APT technique, a corresponding second class in the view object VO specifically is:
acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to the conversion identifier corresponding to the class;
according to the first class, creating a corresponding class name and a corresponding variable name in the view object VO through an APT technology;
copying the fields in the first class into the VO;
assigning the variable values in the first class to the variables of the corresponding variable names in the VO one by one;
and obtaining the second class according to the field, the class name, the variable name and the variable after the variable name is correspondingly assigned.
S205: judging whether the first field renaming annotation is contained in the first class, if so, modifying the field name in the second class through an APT technology according to the first field renaming annotation;
s3: acquiring a first increment field containing the annotation of the increment field in the DTO according to the annotation of the increment field; according to the first increment field, creating a corresponding second increment field in the view object VO through an APT technology;
s4: judging whether the first increment field contains a second field renaming annotation, if so, modifying the field name in the second increment field through an APT technology according to the second field renaming annotation;
the conversion identifier, the conversion processing identifier, the first field renaming annotation, the second field renaming annotation and the annotation of the incremental field are all obtained from the first java library. And if the first type field contains the corresponding identification, performing corresponding processing, wherein the identification contained in the first type field and the first increment field is added by a developer in advance.
Referring to fig. 2, the second embodiment of the present invention is:
the invention provides an object automatic conversion terminal, which comprises a memory 1, a processor 2 and a computer program which is stored on the memory 1 and can run on the processor 2, wherein the processor realizes the following steps when executing the computer program:
s0: after introducing an APT technology into a project corresponding to a DTO, creating a first java library, wherein the first java library comprises a conversion identifier, a field renaming annotation and an annotation of an incremental field;
creating a second java library, wherein the second java library comprises an open source java code generation framework and a plurality of third party libraries;
wherein the field renaming annotation comprises a first field renaming annotation and a second field renaming annotation; the conversion identifier corresponds to the class, namely the conversion identifier is positioned in the class;
s1: acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to the conversion identifier corresponding to the class;
s2: judging whether the first class comprises a preset conversion processing identifier, if so, changing a null field in the first class into an empty character string, and creating a corresponding second class in the view object VO through an APT technology according to the changed first class; if not, according to the first class, creating a corresponding second class in the view object VO through an APT technology;
wherein, according to the first class, creating, by an APT technique, a corresponding second class in the view object VO specifically is:
acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to the conversion identifier corresponding to the class;
according to the first class, creating a corresponding class name and a corresponding variable name in the view object VO through an APT technology;
copying the fields in the first class into the VO;
assigning the variable values in the first class to the variables of the corresponding variable names in the VO one by one;
and obtaining the second class according to the field, the class name, the variable name and the variable after the variable name is correspondingly assigned.
S205: judging whether the first field renaming annotation is contained in the first class, if so, modifying the field name in the second class through an APT technology according to the first field renaming annotation;
s3: acquiring a first increment field containing the annotation of the increment field in the DTO according to the annotation of the increment field; according to the first increment field, creating a corresponding second increment field in the view object VO through an APT technology;
s4: and judging whether the first increment field contains a second field renaming annotation, if so, modifying the field name in the second increment field by an APT technology according to the second field renaming annotation.
The conversion identifier, the conversion processing identifier, the first field renaming annotation, the second field renaming annotation and the annotation of the incremental field are all obtained from the first java library. And if the first type field contains the corresponding identification, performing corresponding processing, wherein the identification contained in the first type field and the first increment field is added by a developer in advance.
The third embodiment of the invention is as follows:
the invention aims to solve the problem of large workload caused by manually realizing a conversion layer and improve the working efficiency. The invention is based on APT (association Processing Tool Annotation processor) technology to dynamically generate codes (zero reflection) in the compiling period, and generates VO interface display objects and conversion Processing classes (the operations of judging whether the objects are empty and modifying field names) in the Android compiling period, so as to convert the data required on the interface and finally solve the problem of manual conversion.
In order to solve the above technical problems, the present invention adopts the following solutions:
1. introducing an APT technology into a project, creating a self-defined annotation java library (a first java library) for placing annotation classes required to be used in the project, namely the self-defined annotation classes, such as: conversion identification, FieldMapper (field rename annotation), FieldConversion (delta field annotation), and so forth.
2. Creating a java library named compiler, introducing a third-party library auto-service provided by Google, mainly used for annotating a processor (annotation processor) class, and simultaneously introducing a third-party library java poet provided by squareup, and an open-source java code generation framework. Processing the annotations with the api to generate new code or source files; analyzing the annotation by combining the technology, wherein the specific method is to inherit an AbstractProcessor class provided by java jdk to realize a process method, and the self-defined annotation is processed in the process method, so that the following main steps are specifically realized:
1) parse the Conversion annotation, this step is to parse the class injected with the Conversion annotation, such as: a Conversion annotation is injected into the user class, which indicates that the user class needs to convert dto into vo;
2) creating a class name and a variable name of a vo interface display object;
3) copy dto fields into vo fields;
4) parsing the FieldConversion annotation to generate a corresponding increment field in vo;
5) generating corresponding vo and a conversion processing class, and mainly performing operations of judging, modifying field names and the like in the conversion processing class;
6) dto, converting with vo in the conversion processing class, creating vo objects in the conversion method of the conversion processing class, assigning fields in dto to the vo objects one by one, and performing judgment processing on the fields, such as: if the character-type field is null, the field is assigned to be an empty string.
In summary, according to the method and the terminal for automatically converting an object provided by the present invention, a first class and a first incremental field corresponding to a DTO in a data transmission pair are obtained according to annotations of a preset conversion identifier and an incremental field corresponding to the class, a second incremental field and a second class corresponding to a view object VO are created by an APT technique, and null fields therein are respectively changed into null character strings, the method can intelligently obtain the first class containing the conversion identifier and the first incremental field containing the incremental field in the DTO, and can create and generate the corresponding second class and second incremental field by an Android APT technique, and simultaneously can change the null field into the null character strings before converting into the second class, so as to convert the DTO into the corresponding VO, the method and the terminal can automatically convert the corresponding class and the incremental field, thereby preventing the field name or the class name from being changed, the problem of client crash is caused, the number of code layers does not need to be increased, steps required by conversion are simplified, and the efficiency of object conversion is improved.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. An object automatic conversion method, characterized by comprising the steps of:
s1: acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to a preset conversion identifier corresponding to the class;
s2: judging whether the first class comprises a preset conversion processing identifier, if so, changing a null field in the first class into an empty character string, and creating a corresponding second class in the view object VO through an APT technology according to the changed first class; if not, according to the first class, creating a corresponding second class in the view object VO through an APT technology;
s3: acquiring a first increment field containing the annotation of the increment field in the DTO according to the annotation of the preset increment field; according to the first increment field, creating a corresponding second increment field in the view object VO through an APT technology;
the S2 further includes:
and judging whether the first class contains a preset first field renaming annotation, if so, modifying the field name in the second class according to the first field renaming annotation through an APT (advanced persistent program) technology.
2. The method according to claim 1, wherein the creating, according to the first class and by an APT technique, a corresponding second class in the view object VO specifically is:
acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to a preset conversion identifier corresponding to the class;
according to the first class, creating a corresponding class name and a corresponding variable name in the view object VO through an APT technology;
copying the fields in the first class into the VO;
assigning the variable values in the first class to the variables of the corresponding variable names in the VO one by one;
and obtaining the second class according to the field, the class name, the variable name and the variable after the variable name is correspondingly assigned.
3. The method for automatically converting objects according to claim 1, further comprising after S3:
and judging whether the first incremental field contains a preset second field renaming annotation, if so, modifying the field name in the second incremental field by an APT technology according to the second field renaming annotation.
4. The method for automatically converting objects according to claim 1, wherein said S1 is preceded by:
after introducing an APT technology into a project corresponding to a DTO, creating a first java library, wherein the first java library comprises a conversion identifier, a field renaming annotation and an annotation of an incremental field;
and creating a second java library, wherein the second java library comprises an open-source java code generation framework and a plurality of third-party libraries.
5. An object automatic conversion terminal, comprising a memory, a processor and a computer program stored on the memory and operable on the processor, wherein the processor executes the computer program to implement the following steps:
s1: acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to a preset conversion identifier corresponding to the class;
s2: judging whether the first class comprises a preset conversion processing identifier, if so, changing a null field in the first class into an empty character string, and creating a corresponding second class in the view object VO through an APT technology according to the changed first class; if not, according to the first class, creating a corresponding second class in the view object VO through an APT technology;
s3: acquiring a first increment field containing the annotation of the increment field in the DTO according to the annotation of the preset increment field; according to the first increment field, creating a corresponding second increment field in the view object VO through an APT technology;
the S2 further includes:
and judging whether the first class contains a preset first field renaming annotation, if so, modifying the field name in the second class according to the first field renaming annotation through an APT (advanced persistent program) technology.
6. The object automatic transformation terminal according to claim 5, wherein the creating, according to the first class and by an APT technique, a corresponding second class in the view object VO specifically is:
acquiring a first class containing a conversion identifier in a Data Transmission Object (DTO) according to a preset conversion identifier corresponding to the class;
according to the first class, creating a corresponding class name and a corresponding variable name in the view object VO through an APT technology;
copying the fields in the first class into the VO;
assigning the variable values in the first class to the variables of the corresponding variable names in the VO one by one;
and obtaining the second class according to the field, the class name, the variable name and the variable after the variable name is correspondingly assigned.
7. The object automatic transformation terminal of claim 5, wherein said S3 is followed by further comprising:
and judging whether the first incremental field contains a preset second field renaming annotation, if so, modifying the field name in the second incremental field by an APT technology according to the second field renaming annotation.
8. The object automatic transformation terminal of claim 5, wherein said S1 is preceded by:
after introducing an APT technology into a project corresponding to a DTO, creating a first java library, wherein the first java library comprises a conversion identifier, a field renaming annotation and an annotation of an incremental field;
and creating a second java library, wherein the second java library comprises an open-source java code generation framework and a plurality of third-party libraries.
CN201811417616.3A 2018-11-26 2018-11-26 Object automatic conversion method and terminal Active CN109710218B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811417616.3A CN109710218B (en) 2018-11-26 2018-11-26 Object automatic conversion method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811417616.3A CN109710218B (en) 2018-11-26 2018-11-26 Object automatic conversion method and terminal

Publications (2)

Publication Number Publication Date
CN109710218A CN109710218A (en) 2019-05-03
CN109710218B true CN109710218B (en) 2022-02-11

Family

ID=66255110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811417616.3A Active CN109710218B (en) 2018-11-26 2018-11-26 Object automatic conversion method and terminal

Country Status (1)

Country Link
CN (1) CN109710218B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579061A (en) * 2020-12-17 2021-03-30 青岛以萨数据技术有限公司 Method, device, system and storage medium for data transmission between android components
CN112764763B (en) * 2020-12-31 2024-01-26 亿企赢网络科技有限公司 Code conversion method, system, equipment and computer readable storage medium
CN113110847B (en) * 2021-04-29 2024-02-13 杭州以诺行汽车科技股份有限公司 Conversion processing method and system for program codes

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106126224A (en) * 2016-06-21 2016-11-16 浪潮软件集团有限公司 Tool, system and method for generating program object
CN106227668A (en) * 2016-07-29 2016-12-14 腾讯科技(深圳)有限公司 Data processing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7080361B2 (en) * 2001-07-30 2006-07-18 Lockheed Martin Corporation Process for generating enterprise java bean components from an SQL database

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106126224A (en) * 2016-06-21 2016-11-16 浪潮软件集团有限公司 Tool, system and method for generating program object
CN106227668A (en) * 2016-07-29 2016-12-14 腾讯科技(深圳)有限公司 Data processing method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Android POJO 转换器 —> RapidOOO";天天_byconan;《https://www.cnblogs.com/tiantianbyconan/p/8971041.html》;20180429;第1-8页 *
"MapStruct 详解";小柴的生活观;《https://blog.csdn.net/chenshun123/article/details/83445438》;20181027;第1-15页 *

Also Published As

Publication number Publication date
CN109710218A (en) 2019-05-03

Similar Documents

Publication Publication Date Title
Albahari et al. C# 5.0 in a Nutshell: The Definitive Reference
Horstmann et al. Core Java 2: Fundamentals
US7937688B2 (en) System and method for context-sensitive help in a design environment
US8191042B2 (en) Continuation based declarative definition and composition
US5953526A (en) Object oriented programming system with displayable natural language documentation through dual translation of program source code
US7716246B2 (en) Dynamic mechanism for providing metadata
US7565364B1 (en) Annotation processor discovery
CN109710218B (en) Object automatic conversion method and terminal
WO1995000903A1 (en) Program modeling system
KR100750834B1 (en) A method of data call stack tracing in data monitoring of JAVA byte code and a device for storing the method in compter program type
EP1962185A2 (en) Condition editor for business process management and business activity monitoring
EP2956862A1 (en) Call stacks for asynchronous programs
US11403074B1 (en) Systems and methods for generating interfaces for callback functions in object-oriented classes
CN113032393A (en) Method and device for binding associated object
US7673289B1 (en) Ignoring output arguments of functions in programming environments
US20080201481A1 (en) Remote interface marshalling
Janssen et al. ILU 2.0 alpha14 Reference Manual
US20150268938A1 (en) Method for creating a computer software compiler for client server computing
Feigenbaum Go for Java Programmers
Price et al. Mastering Visual C#. Net
Lin et al. A style for integrating MS‐Windows software applications to client–server systems using Java technology
Blizničenko et al. Generating UML Models with Inferred Types from Pharo Code
Khan C# 7 and. NET Core 2.0 High Performance: Build highly performant, multi-threaded, and concurrent applications using C# 7 and. NET Core 2.0
Bubak et al. Convenient use of legacy software in Java with Janet package
Lavieri Mastering Java 11: Develop modular and secure Java applications using concurrency and advanced JDK libraries

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant