CN108170408B - JS object definition generation method and device - Google Patents

JS object definition generation method and device Download PDF

Info

Publication number
CN108170408B
CN108170408B CN201611106720.1A CN201611106720A CN108170408B CN 108170408 B CN108170408 B CN 108170408B CN 201611106720 A CN201611106720 A CN 201611106720A CN 108170408 B CN108170408 B CN 108170408B
Authority
CN
China
Prior art keywords
class
attribute information
entity
generating
object definition
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
CN201611106720.1A
Other languages
Chinese (zh)
Other versions
CN108170408A (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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology 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 Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201611106720.1A priority Critical patent/CN108170408B/en
Publication of CN108170408A publication Critical patent/CN108170408A/en
Application granted granted Critical
Publication of CN108170408B publication Critical patent/CN108170408B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/22Procedural
    • 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
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a method and a device for generating JS object definition. The method comprises the following steps: loading a Dynamic Link Library (DLL) file for generating the JS object definition, wherein the DLL file comprises input and output parameters for generating the JS object definition; after the loading is completed, generating an entity of the class of the input and output parameters; reading entity attribute information of an entity and an annotation characteristic class label of the entity attribute information; and generating the JS object definition according to the read entity attribute information and the annotation characteristic class label of the entity attribute information. Through the method and the device, the problem that the JS object definition cannot be automatically generated in the related technology, and the front-end development work efficiency is low is solved.

Description

JS object definition generation method and device
Technical Field
The application relates to the technical field of webpage development, in particular to a method and a device for generating JS object definition.
Background
At present, a plurality of webpage application programs adopt a front-end and back-end separation mode in the development process, and an interactive data format adopts a Json format. When the front end and the back end are in butt joint, the front end needs to write a large number of JS object defined documents of interface input and output parameters for the butt joint of the front end data and the back end data, and because the automatic interface help document generation methods in the related technology are all based on XML format description documents, specific JS object defined documents cannot be automatically generated. Therefore, front-end technical developers need to write the JS object definition documents one by one, and the front-end development work efficiency is low.
Aiming at the problem that the JS object definition cannot be automatically generated in the related technology, which causes lower front-end development work efficiency, an effective solution is not provided at present.
Disclosure of Invention
The main purpose of the present application is to provide a method and an apparatus for generating a JS object definition, so as to solve the problem that the JS object definition cannot be automatically generated in the related art, which results in low front-end development work efficiency.
To achieve the above object, according to one aspect of the present application, there is provided a method of generating a definition of a JS object. The method comprises the following steps: loading a Dynamic Link Library (DLL) file for generating the JS object definition, wherein the DLL file comprises input and output parameters for generating the JS object definition; after the loading is completed, generating an entity of the class of the input and output parameters; reading entity attribute information of an entity and an annotation characteristic class label of the entity attribute information; and generating the JS object definition according to the read entity attribute information and the annotation characteristic class label of the entity attribute information.
Further, prior to loading the dynamic link library DLL file for generating the JS object definition, the method further comprises: adding an annotation characteristic class label of class attribute information in the class attribute information of the class of the input and output parameters, wherein the class attribute information comprises class attribute information inheriting the preset class, and the class attribute information inheriting the preset class is used for indicating an entity to inherit the class attribute information of the preset class so as to generate entity attribute information.
Further, after the loading is completed, the entity for generating the class of the input and output parameters includes: judging whether the class attribute information of the class of the input/output parameters contained in the DLL file contains class attribute information inheriting a preset class or not; and if so, according to the entity attribute information of the indication entity inheriting the class attribute information of the preset class.
Further, after determining whether the class attribute information corresponding to the class of the input/output parameter included in the DLL file includes class attribute information inheriting a predetermined class, the method further includes: and if not, sending first prompt information to the first target address, wherein the first prompt information is used for prompting that the input/output parameters in the DLL file do not contain class attribute information inheriting the preset class, and the definition of the JS object fails to be generated.
Further, after the JS object definition is generated according to the read entity attribute information and the annotation property class tag of the entity attribute information, the method further includes: sending second prompt information to a second target address, wherein the second prompt information is used for prompting that the definition of the JS object is successfully generated; determining a storage path according to the received path selection instruction, wherein the path selection instruction is used for determining a path defined by the JS object; and storing the JS object definition in the storage path.
In order to achieve the above object, according to another aspect of the present application, there is provided a generating device of a JS object definition. The device includes: the loading unit is used for loading a Dynamic Link Library (DLL) file for generating the JS object definition, wherein the DLL file comprises input and output parameters for generating the JS object definition; the first generation unit is used for generating entities of the class of the input and output parameters after the loading is finished; the reading unit is used for reading the entity attribute information of the entity and the annotation characteristic class label of the entity attribute information; and a second generation unit, configured to generate a JS object definition according to the read entity attribute information and the annotation property class tag of the entity attribute information.
Further, the apparatus further comprises: and the adding unit is used for adding an annotation characteristic class label of the class attribute information in the class attribute information of the class of the input and output parameters before loading the dynamic link library DLL file for generating the JS object definition, wherein the class attribute information comprises class attribute information inheriting the preset class, and the class attribute information inheriting the preset class is used for indicating an entity to inherit the class attribute information of the preset class so as to generate entity attribute information.
Further, the first generation unit includes: the judging module is used for judging whether the class attribute information of the class of the input/output parameters contained in the DLL file contains class attribute information inheriting a preset class or not; and the indicating module is used for indicating the entity attribute information of the entity according to the class attribute information inheriting the preset class if the entity attribute information is the preset class.
Further, the apparatus further comprises: and the first sending unit is used for sending first prompt information to the first target address after judging whether the class attribute information corresponding to the class of the input/output parameters contained in the DLL file contains the class attribute information inheriting the preset class, and if not, the first prompt information is used for prompting that the input/output parameters in the DLL file do not contain the class attribute information inheriting the preset class and that the definition of the JS object is failed to be generated.
Further, the apparatus further comprises: the second sending unit is used for sending second prompt information to a second target address after the JS object definition is generated according to the read entity attribute information and the annotation characteristic class label of the entity attribute information, wherein the second prompt information is used for prompting that the JS object definition is successfully generated; the determining unit is used for determining a storage path according to the received path selection instruction, wherein the path selection instruction is used for determining the path defined by the JS object to be stored; and a storage unit for storing the JS object definition in the storage path.
Through the application, the following steps are adopted: loading a Dynamic Link Library (DLL) file for generating the JS object definition, wherein the DLL file comprises input and output parameters for generating the JS object definition; after the loading is completed, generating an entity of the class of the input and output parameters; reading entity attribute information of an entity and an annotation characteristic class label of the entity attribute information; and generating the JS object definition according to the read entity attribute information and the annotation characteristic class label of the entity attribute information, thereby solving the problem of lower front-end development work efficiency caused by incapability of automatically generating the JS object definition in the related technology. The JS object definition is automatically generated according to the read entity attribute information and the annotation characteristic class label of the entity attribute information, and therefore the effect of improving the front-end development work efficiency is achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
fig. 1 is a flowchart of a method for generating a definition of a JS object provided according to an embodiment of the present application; and
fig. 2 is a schematic diagram of a device for generating a JS object definition according to an embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of description, some terms or expressions referred to in the embodiments of the present application are explained below:
dll (dynamic Link library) files are dynamic Link library files, also called "application development", which are software file types. In Windows, many applications are not a complete executable file, but are partitioned into relatively independent dynamic link libraries, i.e., DLL files, that are placed in the system. When we execute a certain program, the corresponding DLL file will be called. An application may use multiple DLL files, one DLL file may also be used by different applications, and such DLL files are referred to as shared DLL files.
And defining the JS object: i.e. the definition of the Java Script object, which is a collection of attributes, i.e. the definition of the individual object attributes. The definition of the JS object in the application is the definition of each object in the input and output parameters transmitted by all interfaces of the front end and the back end, and the definition of the JS object in the application is used for front end development.
According to the embodiment of the application, a method for generating a JS object definition is provided.
Fig. 1 is a flowchart of a method of generating a JS object definition according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
and step S101, loading a Dynamic Link Library (DLL) file for generating the JS object definition, wherein the DLL file comprises input and output parameters for generating the JS object definition.
In the application, an application program is started first, a browsing function in the application program is clicked to select a DLL (dynamic link library) file produced by a WebApi project, namely, a DLL file for generating JS object definitions is loaded, wherein the DLL file comprises input and output parameters for generating the JS object definitions. The DLL file can be loaded in the application using the reflection technique of C #,
optionally, in the method for generating a JS object definition provided in the embodiment of the present application, before loading the dynamic link library DLL file for generating the JS object definition, the method further includes: adding an annotation characteristic class label of class attribute information in the class attribute information of the class of the input and output parameters, wherein the class attribute information comprises class attribute information inheriting the preset class, and the class attribute information inheriting the preset class is used for indicating an entity to inherit the class attribute information of the preset class so as to generate entity attribute information.
That is, through the above technical solution, all input/output parameters of the webAPi interface inherit the specified class (predefined class), and the predefined property class tag for writing the code annotation is added to the class attribute information of the class corresponding to all webAPi input/output parameters.
Step S102, after the loading is completed, generating an entity of the class of the input and output parameters.
After the loading is completed, the entities of the class of the input-output parameters are generated, that is, the entities of the type in the WebApi are instantiated using the reflection technique of C #.
Optionally, in the method for generating a JS object definition provided in the embodiment of the present application, after the loading is completed, the entity that generates the class of the input/output parameter includes: judging whether the class attribute information of the class of the input/output parameters contained in the DLL file contains class attribute information inheriting a preset class or not; and if so, according to the entity attribute information of the indication entity inheriting the class attribute information of the preset class.
Since the class attribute information of the class of the input/output parameter included in the DLL file may or may not include class attribute information that inherits the predetermined class, it is necessary to determine whether the class attribute information of the class of the input/output parameter included in the DLL file includes class attribute information that inherits the predetermined class, and if so, the entity attribute information of the indicated entity that inherits the class attribute information of the predetermined class. For example, the class attribute information includes: name, age, address; the entity attribute information of the entity also correspondingly contains name, age and address.
Optionally, in the method for generating a JS object definition provided in the embodiment of the present application, after determining whether class attribute information corresponding to a class of an input/output parameter included in a DLL file includes class attribute information that inherits a predetermined class, the method further includes: and if not, sending first prompt information to the first target address, wherein the first prompt information is used for prompting that the input/output parameters in the DLL file do not contain class attribute information inheriting the preset class, and the definition of the JS object fails to be generated.
If the class attribute information corresponding to the class of the input/output parameter contained in the DLL file does not contain the class attribute information inheriting the predetermined class, that is, the JS object definition generation is failed, the class attribute information inheriting the predetermined class is not contained in the input/output parameter in the DLL file, and the JS object definition generation failure is sent to the first target address, for example, the first target address may be an address where a user mailbox or other users can receive the information.
Step S103, reading the entity attribute information of the entity and the annotation property class tag of the entity attribute information.
According to the entity attribute information of the acquiring entity inheriting the class attribute information of the predetermined class, for example, the class attribute information includes: name, age, address; the entity attribute information of the read entity also correspondingly contains name, age and address. For example, the annotation property class tag for name is string, the annotation property class tag for age is int, and the annotation property class tag for address is string.
And step S104, generating a JS object definition according to the read entity attribute information and the annotation characteristic class label of the entity attribute information.
For example, according to the read entity attribute information name, age, address. And the annotation property class label of the name is string, the annotation property class label of the age is int, and the annotation property class label of the address generates a JS object definition for information such as string.
Optionally, in the method for generating a JS object definition provided in the embodiment of the present application, after the JS object definition is generated according to the read entity attribute information and the annotation property class tag of the entity attribute information, the method further includes: sending second prompt information to a second target address, wherein the second prompt information is used for prompting that the definition of the JS object is successfully generated; determining a storage path according to the received path selection instruction, wherein the path selection instruction is used for determining a path defined by the JS object; and storing the JS object definition in the storage path.
After the JS object definition is generated according to the read entity attribute information and the annotation characteristic class label of the entity attribute information, sending second prompt information for prompting that the JS object definition is successfully generated to reach a second target address, and then determining a storage path according to a received path selection instruction, wherein the path selection instruction is used for determining the path for storing the JS object definition; and storing the JS object definition in the storage path. For example, in the path of C: \ Documents and Settings.
According to the method for generating the JS object definition, a Dynamic Link Library (DLL) file for generating the JS object definition is loaded, wherein the DLL file comprises input and output parameters for generating the JS object definition; after the loading is completed, generating an entity of the class of the input and output parameters; reading entity attribute information of an entity and an annotation characteristic class label of the entity attribute information; and generating the JS object definition according to the read entity attribute information and the annotation characteristic class label of the entity attribute information, thereby solving the problem of lower front-end development work efficiency caused by incapability of automatically generating the JS object definition in the related technology. The JS object definition is automatically generated according to the read entity attribute information and the annotation characteristic class label of the entity attribute information, and therefore the effect of improving the front-end development work efficiency is achieved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The embodiment of the present application further provides a device for generating a JS object definition, and it should be noted that the device for generating a JS object definition according to the embodiment of the present application may be used to execute the method for generating a JS object definition according to the embodiment of the present application. The following describes a device for generating a JS object definition provided in an embodiment of the present application.
Fig. 2 is a schematic diagram of a JS object definition generation device according to an embodiment of the present application. As shown in fig. 2, the apparatus includes: a loading unit 10, a first generating unit 20, a reading unit 30 and a second generating unit 40.
Specifically, the loading unit 10 is configured to load a dynamic link library DLL file for generating the JS object definition, where the DLL file includes input and output parameters for generating the JS object definition.
A first generating unit 20, configured to generate an entity of a class of input/output parameters after the loading is completed.
The reading unit 30 is configured to read entity attribute information of an entity and an annotation property class tag of the entity attribute information.
And a second generating unit 40, configured to generate a JS object definition according to the read entity attribute information and the annotation property class tag of the entity attribute information.
The device for generating the JS object definition provided in the embodiment of the present application is configured to load, by using the loading unit 10, a dynamic link library DLL file for generating the JS object definition, where the DLL file includes input and output parameters for generating the JS object definition; a first generating unit 20, configured to generate an entity of a class of input/output parameters after the loading is completed; a reading unit 30, configured to read entity attribute information of an entity and an annotation property class tag of the entity attribute information; and the second generating unit 40 is configured to generate the JS object definition according to the read entity attribute information and the annotation property class tag of the entity attribute information, so that the problem that the JS object definition cannot be automatically generated in the related art, which causes lower front-end development work efficiency, is solved, and the JS object definition is automatically generated by the second generating unit 40 according to the read entity attribute information and the annotation property class tag of the entity attribute information, so that the effect of improving the front-end development work efficiency is achieved.
Optionally, in the apparatus for generating a JS object definition provided in the embodiment of the present application, the apparatus further includes: and the adding unit is used for adding an annotation characteristic class label of the class attribute information in the class attribute information of the class of the input and output parameters before loading the dynamic link library DLL file for generating the JS object definition, wherein the class attribute information comprises class attribute information inheriting the preset class, and the class attribute information inheriting the preset class is used for indicating an entity to inherit the class attribute information of the preset class so as to generate entity attribute information.
Optionally, in the device for generating a definition of a JS object provided in the embodiment of the present application, the first generating unit 20 includes: the judging module is used for judging whether the class attribute information of the class of the input/output parameters contained in the DLL file contains class attribute information inheriting a preset class or not; and the indicating module is used for indicating the entity attribute information of the entity according to the class attribute information inheriting the preset class if the entity attribute information is the preset class.
Optionally, in the apparatus for generating a JS object definition provided in the embodiment of the present application, the apparatus further includes: and the first sending unit is used for sending first prompt information to the first target address after judging whether the class attribute information corresponding to the class of the input/output parameters contained in the DLL file contains the class attribute information inheriting the preset class, and if not, the first prompt information is used for prompting that the input/output parameters in the DLL file do not contain the class attribute information inheriting the preset class and that the definition of the JS object is failed to be generated.
Optionally, in the apparatus for generating a JS object definition provided in the embodiment of the present application, the apparatus further includes: the second sending unit is used for sending second prompt information to a second target address after the JS object definition is generated according to the read entity attribute information and the annotation characteristic class label of the entity attribute information, wherein the second prompt information is used for prompting that the JS object definition is successfully generated; the determining unit is used for determining a storage path according to the received path selection instruction, wherein the path selection instruction is used for determining the path defined by the JS object to be stored; and a storage unit for storing the JS object definition in the storage path.
The device for generating the JS object definition comprises a processor and a memory, the loading unit 10, the first generating unit 20, the reading unit 30, the second generating unit 40 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the JS object definition is generated by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
The present application further provides an embodiment of a computer program product, which, when being executed on a data processing device, is adapted to carry out program code for initializing the following method steps: loading a Dynamic Link Library (DLL) file for generating the JS object definition, wherein the DLL file comprises input and output parameters for generating the JS object definition; after the loading is completed, generating an entity of the class of the input and output parameters; reading entity attribute information of an entity and an annotation characteristic class label of the entity attribute information; and generating the JS object definition according to the read entity attribute information and the annotation characteristic class label of the entity attribute information.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
It will be apparent to those skilled in the art that the modules or steps of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and they may alternatively be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, or fabricated separately as individual integrated circuit modules, or fabricated as a single integrated circuit module from multiple modules or steps. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (8)

1. A method for generating a JS object definition, comprising:
loading a Dynamic Link Library (DLL) file for generating a JS object definition, wherein the DLL file comprises input and output parameters for generating the JS object definition;
after the loading is completed, generating an entity of the class of the input and output parameters;
reading entity attribute information of the entity and an annotation characteristic class tag of the entity attribute information; and
generating the JS object definition according to the read entity attribute information and the annotation characteristic class label of the entity attribute information;
wherein, prior to loading the dynamic link library DLL file used to generate the JS object definition, the method further comprises:
adding an annotation characteristic class label of class attribute information in the class attribute information of the class of the input/output parameter, wherein the class attribute information comprises class attribute information inheriting a predetermined class, and the class attribute information inheriting the predetermined class is used for indicating the entity to inherit the class attribute information of the predetermined class so as to generate the entity attribute information.
2. The method of claim 1, wherein generating the entity of the class of input-output parameters after the loading is complete comprises:
judging whether the class attribute information of the class of the input/output parameters contained in the DLL file contains the class attribute information inheriting the preset class or not; and
and if so, indicating the entity attribute information of the entity according to the class attribute information inheriting the preset class.
3. The method of claim 2, wherein after determining whether the class attribute information corresponding to the class of the input/output parameter contained in the DLL file contains the class attribute information of the inherited predetermined class, the method further comprises:
and if not, sending first prompt information to a first target address, wherein the first prompt information is used for prompting that the input/output parameters in the DLL file do not contain the class attribute information inheriting the preset class, and the definition of the JS object fails to be generated.
4. The method according to claim 1, wherein after generating the JS object definition from the read entity attribute information and the annotation property class tag of the entity attribute information, the method further comprises:
sending second prompt information to a second target address, wherein the second prompt information is used for prompting that the definition of the JS object is successfully generated;
determining a storage path according to the received path selection instruction, wherein the path selection instruction is used for determining a path for storing the JS object definition; and
and storing the JS object definition into the storage path.
5. An apparatus for generating definition of JS object, comprising:
the loading unit is used for loading a Dynamic Link Library (DLL) file for generating the JS object definition, wherein the DLL file comprises input and output parameters for generating the JS object definition;
the first generation unit is used for generating the entity of the class of the input and output parameters after the loading is finished;
a reading unit, configured to read entity attribute information of the entity and an annotation property class tag of the entity attribute information; and
the second generation unit is used for generating the JS object definition according to the read entity attribute information and the annotation characteristic class label of the entity attribute information;
wherein the apparatus further comprises:
and the adding unit is used for adding an annotation characteristic class label of class attribute information in the class attribute information of the class of the input/output parameter before loading the dynamic link library DLL file for generating the JS object definition, wherein the class attribute information contains class attribute information inheriting a preset class, and the class attribute information inheriting the preset class is used for indicating the entity inheriting the class attribute information of the preset class so as to generate the entity attribute information.
6. The apparatus of claim 5, wherein the first generating unit comprises:
the judging module is used for judging whether the class attribute information of the class of the input and output parameters contained in the DLL file contains the class attribute information of the inherited preset class; and
and if so, indicating the entity attribute information of the entity according to the class attribute information inheriting the preset class.
7. The apparatus of claim 6, further comprising:
and the first sending unit is used for sending first prompt information to a first target address after judging whether the class attribute information corresponding to the class of the input and output parameters contained in the DLL file contains the class attribute information inheriting the preset class, and if not, the first prompt information is used for prompting that the class attribute information inheriting the preset class is not contained in the input and output parameters in the DLL file and the JS object definition is failed to be generated.
8. The apparatus of claim 5, further comprising:
the second sending unit is used for sending second prompt information to a second target address after the JS object definition is generated according to the read entity attribute information and the annotation characteristic class label of the entity attribute information, wherein the second prompt information is used for prompting that the JS object definition is successfully generated;
the determining unit is used for determining a storage path according to the received path selection instruction, wherein the path selection instruction is used for determining the path for storing the JS object definition; and
and the storage unit is used for storing the JS object definition into the storage path.
CN201611106720.1A 2016-12-05 2016-12-05 JS object definition generation method and device Active CN108170408B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611106720.1A CN108170408B (en) 2016-12-05 2016-12-05 JS object definition generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611106720.1A CN108170408B (en) 2016-12-05 2016-12-05 JS object definition generation method and device

Publications (2)

Publication Number Publication Date
CN108170408A CN108170408A (en) 2018-06-15
CN108170408B true CN108170408B (en) 2020-11-24

Family

ID=62525967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611106720.1A Active CN108170408B (en) 2016-12-05 2016-12-05 JS object definition generation method and device

Country Status (1)

Country Link
CN (1) CN108170408B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625445B (en) * 2020-04-23 2024-07-05 平安国际智慧城市科技股份有限公司 Java-based test framework construction method, java-based test framework construction device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6442752B1 (en) * 1999-08-26 2002-08-27 Unisys Corporation Method, apparatus, and computer program product for replacing a dynamic link library (dll) of a first computing environment with a dll of a second computing environment that can be invoked from the first computing environment in a transparent manner
CN102375740A (en) * 2010-08-26 2012-03-14 上海科泰世纪科技有限公司 Handheld device and method for implementing interoperation of Java component and custom member by same
CN102508674A (en) * 2011-12-02 2012-06-20 方正国际软件有限公司 Method based on JSON (javascript serialized object notation) for passing object-oriented parameters and system
CN105159928B (en) * 2015-08-05 2019-04-23 深圳联友科技有限公司 A kind of JSON data conversion at model data method and system

Also Published As

Publication number Publication date
CN108170408A (en) 2018-06-15

Similar Documents

Publication Publication Date Title
US20140310051A1 (en) Methods and Apparatus for Project Portfolio Management
CN106487603B (en) Response testing method and device
CN111414739B (en) Excel data entry component, entry method and device
CN111615688A (en) Assertion verification code binding method and device
RU2639667C2 (en) Context invitation in trial version of application
CN106843901B (en) Page rendering and verification method and device
US9201897B1 (en) Global data storage combining multiple back-end storage devices
US9477582B2 (en) Executable software specification generation
CN110825425A (en) Configuration data management method and device, electronic equipment and storage medium
CN111722995B (en) Data processing method and device
CN113407254B (en) Form generation method and device, electronic equipment and storage medium
CN113434063B (en) Information display method, device and equipment
CN114048415A (en) Form generation method and device, electronic equipment and computer readable storage medium
CN106201859A (en) A kind of regression testing method and system
CN112395182A (en) Automatic testing method, device, equipment and computer readable storage medium
CN108170408B (en) JS object definition generation method and device
CN113778878A (en) Interface testing method and device, electronic equipment and storage medium
US9104573B1 (en) Providing relevant diagnostic information using ontology rules
Ahmed-Nacer et al. Model-Driven Simulation of Elastic OCCI Cloud Resources
CN104484211A (en) Method and device for sharing mirror image document
CN110362294A (en) Development task executes method, apparatus, electronic equipment and storage medium
CN115659045A (en) User operation identification method and device, storage medium and electronic equipment
CN108563578A (en) SDK compatibility detection method, device, equipment and readable storage medium
CN114691496A (en) Unit testing method, unit testing device, computing equipment and medium
CN113392003A (en) Evaluation method and device of programming code

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
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant