CN108170408A - The generation method and device of JS object definitions - Google Patents

The generation method and device of JS object definitions Download PDF

Info

Publication number
CN108170408A
CN108170408A CN201611106720.1A CN201611106720A CN108170408A CN 108170408 A CN108170408 A CN 108170408A CN 201611106720 A CN201611106720 A CN 201611106720A CN 108170408 A CN108170408 A CN 108170408A
Authority
CN
China
Prior art keywords
attribute information
entity
class
object definitions
generic attribute
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.)
Granted
Application number
CN201611106720.1A
Other languages
Chinese (zh)
Other versions
CN108170408B (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

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

This application discloses a kind of generation methods and device of JS object definitions.This method includes:The dynamic link library (DLL) file for generating JS object definitions is loaded, wherein, dll file includes the input/output argument for generating JS object definitions;After loading is completed, the entity of the class of input/output argument is generated;Read the entity attribute information of entity and the annotation characteristic class label of entity attribute information;And JS object definitions are generated according to the annotation characteristic class label of the entity attribute information and entity attribute information read.By the application, the problem of solving and cannot be automatically generated JS object definitions in the relevant technologies, cause front end development less efficient.

Description

The generation method and device of JS object definitions
Technical field
This application involves web development technologies field, in particular to a kind of generation method and dress of JS object definitions It puts.
Background technology
Many Web page application programs take the mode that front and back end detaches, and interactive data format in the process of development at present Using Json forms.When being docked in front and back end, front end needs to write the definition of the JS objects of a large amount of interface input/output argument Document use when being docked for front and rear end data, due to interface help document structure tree method automatic in the relevant technologies all It is that document is illustrated based on XML format, cannot be automatically generated the document of specific JS object definitions.Therefore front-end technology is needed to open Hair personnel write the document of JS object definitions one by one, cause front end development less efficient.
For the problem that cannot be automatically generated JS object definitions in the relevant technologies, cause front end development less efficient, Currently no effective solution has been proposed.
Invention content
The main purpose of the application is to provide a kind of generation method and device of JS object definitions, to solve the relevant technologies In the problem of cannot be automatically generated JS object definitions, causing front end development less efficient.
To achieve these goals, according to the one side of the application, a kind of generation method of JS object definitions is provided. This method includes:The dynamic link library (DLL) file for generating JS object definitions is loaded, wherein, dll file includes giving birth to Into the input/output argument of JS object definitions;After loading is completed, the entity of the class of input/output argument is generated;Read entity Entity attribute information and entity attribute information annotation characteristic class label;And according to the entity attribute information read with And the annotation characteristic class label generation JS object definitions of entity attribute information.
Further, before dynamic link library (DLL) file of the loading for generating JS object definitions, this method is also wrapped It includes:The annotation characteristic class label of generic attribute information is added in the generic attribute information of the class of input/output argument, wherein, generic attribute Include the generic attribute information for inheriting predetermined class in information, inherit predetermined class generic attribute information be used to indicate entity inherit it is predetermined The generic attribute information of class is to generate entity attribute information.
Further, after loading is completed, the entity for generating the class of input/output argument includes:Judge in dll file Comprising input/output argument class generic attribute information whether include inherit predetermined class generic attribute information;And if so, Then according to the entity attribute information of the instruction entity for the generic attribute information for inheriting predetermined class.
Further, whether the corresponding generic attribute information of class of the input/output argument included in dll file is judged wraps After the generic attribute information for inheriting predetermined class, this method further includes:If it is not, the first prompt message is then sent to first object Address, wherein, the first prompt message is used to prompt not include the class for inheriting predetermined class in the input/output argument in dll file Attribute information, and generate the failure of JS object definitions.
Further, according to the annotation characteristic class label of the entity attribute information and entity attribute information life read Into after JS object definitions, this method further includes:The second prompt message is sent to the second destination address, wherein, the second prompting letter Breath is for prompting generation JS object definition successes;Routing instructions according to receiving determine store path, wherein, path choosing Instruction is selected for determining the path of storage JS object definitions;And JS object definitions are stored into store path.
To achieve these goals, according to the another aspect of the application, a kind of generating means of JS object definitions are provided. The device includes:Loading unit, for loading the dynamic link library (DLL) file for generating JS object definitions, wherein, DLL texts Part includes the input/output argument for generating JS object definitions;First generation unit, after being completed in loading, generation The entity of the class of input/output argument;Reading unit, for reading the entity attribute information of entity and entity attribute information Annotation characteristic class label;And second generation unit, for according to the entity attribute information and entity attribute information read Annotation characteristic class label generation JS object definitions.
Further, which further includes:Adding device, for generating the dynamic link of JS object definitions in loading Before the dll file of library, the annotation characteristic class label of generic attribute information is added in the generic attribute information of the class of input/output argument, Wherein, the generic attribute information for inheriting predetermined class is included in generic attribute information, the generic attribute information for inheriting predetermined class is used to indicate Entity inherits the generic attribute information of predetermined class to generate entity attribute information.
Further, the first generation unit includes:Judgment module, for judging that the input and output included in dll file are joined Whether the generic attribute information of several classes includes the generic attribute information for inheriting predetermined class;And indicating module, for if so, root According to the entity attribute information of the instruction entity for the generic attribute information for inheriting predetermined class.
Further, which further includes:First transmitting element, for the input and output included in dll file is judged After whether the corresponding generic attribute information of class of parameter includes the generic attribute information for inheriting predetermined class, if it is not, then sending first Prompt message to first object address, wherein, the first prompt message is used to prompt not wrap in input/output argument in dll file Containing the generic attribute information for inheriting predetermined class, and generate the failure of JS object definitions.
Further, which further includes:Second transmitting element, for according to the entity attribute information that reads and After the annotation characteristic class label generation JS object definitions of entity attribute information, the second prompt message is sent to the second target Location, wherein, the second prompt message is for prompting generation JS object definition successes;Determination unit, for according to the path received Selection instruction determines store path, wherein, routing instructions are for the determining path for storing JS object definitions;And storage is single Member, for storing JS object definitions into store path.
By the application, using following steps:The dynamic link library (DLL) file for generating JS object definitions is loaded, In, dll file includes the input/output argument for generating JS object definitions;After loading is completed, input and output are generated The entity of the class of parameter;Read the entity attribute information of entity and the annotation characteristic class label of entity attribute information;And root JS object definitions are generated according to the annotation characteristic class label of the entity attribute information and entity attribute information read, solve phase The problem of cannot be automatically generated JS object definitions in the technology of pass, causing front end development less efficient.It is read by basis Entity attribute information and the annotation characteristic class label of entity attribute information automatically generate JS object definitions, and then reached and carried Rise the effect of front end development efficiency.
Description of the drawings
The attached drawing for forming the part of the application is used for providing further understanding of the present application, the schematic reality of the application Example and its explanation are applied for explaining the application, does not form the improper restriction to the application.In the accompanying drawings:
Fig. 1 is the flow chart according to the generation method of JS object definitions provided by the embodiments of the present application;And
Fig. 2 is the schematic diagram according to the generating means of JS object definitions provided by the embodiments of the present application.
Specific embodiment
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
In order to which those skilled in the art is made to more fully understand application scheme, below in conjunction in the embodiment of the present application The technical solution in the embodiment of the present application is clearly and completely described in attached drawing, it is clear that described embodiment is only The embodiment of the application part, instead of all the embodiments.Based on the embodiment in the application, ordinary skill people Member's all other embodiments obtained without making creative work should all belong to the model of the application protection It encloses.
It should be noted that term " first " in the description and claims of this application and above-mentioned attached drawing, " Two " etc. be the object for distinguishing similar, and specific sequence or precedence are described without being used for.It should be appreciated that it uses in this way Data can be interchanged in the appropriate case, so as to embodiments herein described herein.In addition, term " comprising " and " tool Have " and their any deformation, it is intended that cover it is non-exclusive include, for example, containing series of steps or unit Process, method, system, product or equipment are not necessarily limited to those steps or unit clearly listed, but may include without clear It is listing to Chu or for the intrinsic other steps of these processes, method, product or equipment or unit.
For ease of description, below to the invention relates to part noun or term illustrate:
DLL (Dynamic Link Library) file is dynamic link library file, is soft also known as " application program expansion " Part file type.In Windows, many application programs are not a complete executable file, they are divided into one A little relatively independent dynamic link libraries, i.e. dll file, are positioned in system.When we perform some program, accordingly Dll file will be called.Multiple dll files can be used in one application program, and a dll file may also be by different applications Program uses, and such dll file is referred to as shared dll file.
JS object definitions:Also it is the definition of Java Script objects, Java Script objects are the set of attribute, The definition of Java Script objects namely the definition of each object attribute.JS object definitions in the application are based on front and back end The definition of each object in the input/output argument of total interface transmission, the JS object definitions in the application are for front end exploitation.
According to an embodiment of the present application, a kind of generation method of JS object definitions is provided.
Fig. 1 is the flow chart according to the generation method of the JS object definitions of the embodiment of the present application.As shown in Figure 1, this method Include the following steps:
Step S101 loads the dynamic link library (DLL) file for generating JS object definitions, wherein, dll file includes For generating the input/output argument of JS object definitions.
Start application program first in this application, click the function of browse selection WebApi project constructions in application program Dll file namely loading for generating the dynamic link library (DLL) files of JS object definitions, wherein, dll file includes use In the input/output argument of generation JS object definitions.The reflection technology loading dll file of C# can be used in the application,
Optionally, in the generation method of JS object definitions provided by the embodiments of the present application, in loading for generating JS pairs As definition dynamic link library (DLL) file before, this method further includes:Add in the generic attribute information of the class of input/output argument Add the annotation characteristic class label of generic attribute information, wherein, the generic attribute information for inheriting predetermined class is included in generic attribute information, after The generic attribute information for holding predetermined class is used to indicate the generic attribute information of entity succession predetermined class to generate entity attribute information.
That is, the input/output argument of all webAPi interfaces is all inherited (in advance by the class specified by above technical scheme Determine class), the generic attribute information of the corresponding class of all WebApi input/output arguments all writes code plus being used for of pre-defining The characteristic class label of annotation.
Step S102 after loading is completed, generates the entity of the class of input/output argument.
After loading is completed, the entity of the class of input/output argument is generated, that is, the reflection technology using C# instantiates The entity of type in WebApi.
Optionally, in the generation method of JS object definitions provided by the embodiments of the present application, after loading is completed, generation The entity of the class of input/output argument includes:Judging the generic attribute information of the class of the input/output argument included in dll file is It is no to include the generic attribute information for inheriting predetermined class;It is and if so, real according to the instruction for the generic attribute information for inheriting predetermined class The entity attribute information of body.
Since the generic attribute information of the class of input/output argument included in the dll file may include succession predetermined class Generic attribute information, it is also possible to not comprising have inherit predetermined class generic attribute information, therefore, it is necessary to judge to include in dll file Input/output argument class generic attribute information whether include inherit predetermined class generic attribute information, if, include after The generic attribute information of predetermined class is held, then according to the entity attribute information of the instruction entity for the generic attribute information for inheriting predetermined class.Example Such as, generic attribute information includes:Name, age, address;Then the entity attribute information of entity also accordingly includes name, age, address。
Optionally, it in the generation method of JS object definitions provided by the embodiments of the present application, is included in dll file is judged Input/output argument the corresponding generic attribute information of class whether include inherit predetermined class generic attribute information after, this method It further includes:If it is not, the first prompt message is then sent to first object address, wherein, the first prompt message is used to prompt dll file In input/output argument in do not include the generic attribute information for inheriting predetermined class, and generate the failure of JS object definitions.
If not including in the corresponding generic attribute information of the class of the input/output argument included in dll file has succession to make a reservation for It the generic attribute information of class namely can cause to generate the failure of JS object definitions, will not be included in the input/output argument in dll file There is the generic attribute information for inheriting predetermined class, and generate JS object definitions and be unsuccessfully sent to first object address, for example, first object Address can be the address that subscriber mailbox or other users can receive this information.
Step S103 reads the entity attribute information of entity and the annotation characteristic class label of entity attribute information.
According to the entity attribute information of the acquisition entity for the generic attribute information for inheriting predetermined class, for example, in generic attribute information Including:Name, age, address;The entity attribute information for then reading entity also accordingly includes name, age, address.Such as, The annotation characteristic class label of name is string, and the annotation characteristic class label of age is int, the annotation characteristic class label of address For string.
Step S104 is generated according to the annotation characteristic class label of the entity attribute information and entity attribute information read JS object definitions.
For example, according to the entity attribute information name, age, address that read.The annotation characteristic class label of name is The annotation characteristic class label of string, age are int, and the annotation characteristic class label of address generates JS pairs for information such as string As definition.
Optionally, in the generation method of JS object definitions provided by the embodiments of the present application, according to the entity read After attribute information and the annotation characteristic class label of entity attribute information generation JS object definitions, this method further includes:It sends Second prompt message to the second destination address, wherein, the second prompt message is for prompting generation JS object definitions success;According to connecing The routing instructions received determine store path, wherein, routing instructions are for the determining path for storing JS object definitions; And JS object definitions are stored into store path.
JS objects are being generated according to the entity attribute information and the annotation characteristic class label of entity attribute information that read After definition, the second prompt message of transmission connects for prompting generation JS object definitions success to the second destination address, then basis The routing instructions received determine store path, wherein, routing instructions are for the determining path for storing JS object definitions; And JS object definitions are stored into store path.For example, it is stored in C:Documents and Settings ... road In diameter.
The generation method of JS object definitions provided by the embodiments of the present application generates the dynamic of JS object definitions by loading State chained library dll file, wherein, dll file includes the input/output argument for generating JS object definitions;It is completed in loading Later, the entity of the class of input/output argument is generated;Read the entity attribute information of entity and the annotation of entity attribute information Characteristic class label;And JS is generated according to the annotation characteristic class label of the entity attribute information and entity attribute information read Object definition solves and cannot be automatically generated JS object definitions in the relevant technologies, causes front end development is less efficient to ask Topic.By automatically generating JS objects according to the entity attribute information and the annotation characteristic class label of entity attribute information that read Definition, and then achieved the effect that promote front end development efficiency.
It should be noted that step shown in the flowchart of the accompanying drawings can be in such as a group of computer-executable instructions It is performed in computer system, although also, show logical order in flow charts, it in some cases, can be with not The sequence being same as herein performs shown or described step.
The embodiment of the present application additionally provides a kind of generating means of JS object definitions, it should be noted that the application is implemented The generating means of the JS object definitions of example can be used for performing the generation for JS object definitions that the embodiment of the present application is provided Method.The generating means of JS object definitions provided by the embodiments of the present application are introduced below.
Fig. 2 is the schematic diagram according to the generating means of the JS object definitions of the embodiment of the present application.As shown in Fig. 2, the device Including:Loading unit 10, the first generation unit 20,30 and second generation unit 40 of reading unit.
Specifically, loading unit 10, for loading the dynamic link library (DLL) file for generating JS object definitions, wherein, Dll file includes the input/output argument for generating JS object definitions.
First generation unit 20 after being completed in loading, generates the entity of the class of input/output argument.
Reading unit 30, for reading the annotation characteristic category of the entity attribute information of entity and entity attribute information Label.
Second generation unit 40, for according to the entity attribute information and the annotation characteristic of entity attribute information read Class label generates JS object definitions.
The generating means of JS object definitions provided by the embodiments of the present application, by loading unit 10, for loading to give birth to Into the dynamic link library (DLL) file of JS object definitions, wherein, dll file includes defeated for generating the input of JS object definitions Go out parameter;First generation unit 20 after being completed in loading, generates the entity of the class of input/output argument;Reading unit 30, for reading the annotation characteristic class label of the entity attribute information of entity and entity attribute information;And second generation it is single Member 40, for being determined according to the annotation characteristic class label of the entity attribute information and entity attribute information generation JS objects read The problem of justice solves and cannot be automatically generated JS object definitions in the relevant technologies, causes front end development less efficient, passes through Second generation unit 40 is given birth to automatically according to the annotation characteristic class label of the entity attribute information and entity attribute information that read Into JS object definitions, and then achieve the effect that promote front end development efficiency.
Optionally, in the generating means of JS object definitions provided by the embodiments of the present application, which further includes:Addition is single Member, for before dynamic link library (DLL) file of the loading for generating JS object definitions, in the class of the class of input/output argument The annotation characteristic class label of generic attribute information is added in attribute information, wherein, include in generic attribute information and inherit predetermined class Generic attribute information, the generic attribute information for inheriting predetermined class are used to indicate the generic attribute information of entity succession predetermined class to generate entity Attribute information.
Optionally, in the generating means of JS object definitions provided by the embodiments of the present application, the first generation unit 20 includes: Judgment module, it is pre- whether the generic attribute information for judging the class of the input/output argument included in dll file includes succession Determine the generic attribute information of class;And indicating module, for if so, according to inherit predetermined class generic attribute information instruction entity Entity attribute information.
Optionally, in the generating means of JS object definitions provided by the embodiments of the present application, which further includes:First hair Send unit, the corresponding generic attribute information of class of the input/output argument for being included in dll file is judged whether include after After holding the generic attribute information of predetermined class, if it is not, the first prompt message is then sent to first object address, wherein, the first prompting Information is used to prompt not include the generic attribute information for inheriting predetermined class in the input/output argument in dll file, and generate JS Object definition fails.
Optionally, in the generating means of JS object definitions provided by the embodiments of the present application, which further includes:Second hair Unit is sent, for generating JS pairs according to the entity attribute information and the annotation characteristic class label of entity attribute information that read After definition, the second prompt message is sent to the second destination address, wherein, the second prompt message is for prompting generation JS objects It defines successfully;Determination unit, for determining store path according to the routing instructions received, wherein, routing instructions For determining the path of storage JS object definitions;And storage unit, for storing JS object definitions into store path.
The generating means of the JS object definitions include processor and memory, and the above-mentioned generation of loading unit 10, first is single Member 20,30 and second generation unit 40 of reading unit etc. in memory, are deposited as program unit storage by processor execution The above procedure unit of storage in memory realizes corresponding function.
Comprising kernel in processor, gone in memory to transfer corresponding program unit by kernel.Kernel can set one Or more, generate JS object definitions by adjusting kernel parameter.
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/ Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM), memory includes at least one deposit Store up chip.
Present invention also provides a kind of embodiment of computer program product, when being performed on data processing equipment, fitting In the program code for performing initialization there are as below methods step:Load the dynamic link library (DLL) text for generating JS object definitions Part, wherein, dll file includes the input/output argument for generating JS object definitions;After loading is completed, generation input The entity of the class of output parameter;Read the entity attribute information of entity and the annotation characteristic class label of entity attribute information;With And JS object definitions are generated according to the annotation characteristic class label of the entity attribute information and entity attribute information read.
It should be noted that for aforementioned each method embodiment, in order to be briefly described, therefore it is all expressed as a series of Combination of actions, but those skilled in the art should know, the application is not limited by described sequence of movement because According to the application, certain steps may be used other sequences or be carried out at the same time.Secondly, those skilled in the art should also know It knows, embodiment described in this description belongs to preferred embodiment, involved action and module not necessarily the application It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of the unit, it is only a kind of Division of logic function, can there is an other dividing mode in actual implementation, such as multiple units or component can combine or can To be integrated into another system or some features can be ignored or does not perform.
The unit illustrated as separating component may or may not be physically separate, be shown as unit The component shown may or may not be physical unit, you can be located at a place or can also be distributed to multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, it can also That each unit is individually physically present, can also two or more units integrate in a unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
Obviously, those skilled in the art should be understood that each module of above-mentioned the application or each step can be with general Computing device realize that they can concentrate on single computing device or be distributed in multiple computing devices and be formed Network on, optionally, they can be realized with the program code that computing device can perform, it is thus possible to which they are stored In the storage device by computing device come perform either they are fabricated to respectively each integrated circuit modules or by they In multiple modules or step be fabricated to single integrated circuit module to realize.In this way, the application be not limited to it is any specific Hardware and software combines.
The foregoing is merely the preferred embodiments of the application, are not limited to the application, for those skilled in the art For member, the application can have various modifications and variations.All any modifications within spirit herein and principle, made, Equivalent replacement, improvement etc., should be included within the protection domain of the application.

Claims (10)

1. a kind of generation method of JS object definitions, which is characterized in that including:
The dynamic link library (DLL) file for generating JS object definitions is loaded, wherein, the dll file includes generating The input/output argument of the JS object definitions;
After loading is completed, the entity of the class of the input/output argument is generated;
Read the entity attribute information of the entity and the annotation characteristic class label of the entity attribute information;And
According to the generation of the annotation characteristic class label of the entity attribute information and the entity attribute information read JS object definitions.
2. according to the method described in claim 1, it is characterized in that, loading the dynamic link library for generating JS object definitions Before dll file, the method further includes:
The annotation characteristic class label of generic attribute information is added in the generic attribute information of the class of the input/output argument, wherein, Include the generic attribute information for inheriting predetermined class in the generic attribute information, the generic attribute information for inheriting predetermined class is used to refer to Show that the entity inherits the generic attribute information of predetermined class to generate the entity attribute information.
3. according to the method described in claim 2, it is characterized in that, after loading is completed, the input/output argument is generated The entity of class include:
Judge whether the generic attribute information of the class of the input/output argument included in the dll file includes described inherit and make a reservation for The generic attribute information of class;And
If so, the entity attribute information according to the instruction entity of the generic attribute information for inheriting predetermined class.
4. the according to the method described in claim 3, it is characterized in that, input and output ginseng included in the dll file is judged After whether the corresponding generic attribute information of several classes includes the generic attribute information for inheriting predetermined class, the method is also wrapped It includes:
If it is not, the first prompt message is then sent to first object address, wherein, first prompt message is described for prompting Do not include the generic attribute information for inheriting predetermined class in input/output argument in dll file, and generate the JS objects Definition failure.
5. according to the method described in claim 1, it is characterized in that, according to the entity attribute information and institute read After the annotation characteristic class label generation JS object definitions for stating entity attribute information, the method further includes:
The second prompt message is sent to the second destination address, wherein, second prompt message is for described JS pairs of prompting generation As defining successfully;
Routing instructions according to receiving determine store path, wherein, the routing instructions are for determining storage institute State the path of JS object definitions;And
The JS object definitions are stored into the store path.
6. a kind of generating means of JS object definitions, which is characterized in that including:
Loading unit, for loading the dynamic link library (DLL) file for generating JS object definitions, wherein, in the dll file Input/output argument including being used to generate the JS object definitions;
First generation unit after being completed in loading, generates the entity of the class of the input/output argument;
Reading unit, for reading the annotation characteristic category of the entity attribute information of the entity and the entity attribute information Label;And
Second generation unit, for special according to the entity attribute information and the annotation of the entity attribute information that read Property class label generate the JS object definitions.
7. device according to claim 6, which is characterized in that described device further includes:
Adding device, it is defeated in the input for before dynamic link library (DLL) file of the loading for generating JS object definitions Go out in the generic attribute information of the class of parameter to add the annotation characteristic class label of generic attribute information, wherein, in the generic attribute information Include the generic attribute information for inheriting predetermined class, the generic attribute information for inheriting predetermined class is used to indicate the entity and inherits in advance The generic attribute information of class is determined to generate the entity attribute information.
8. device according to claim 7, which is characterized in that first generation unit includes:
Whether judgment module, the generic attribute information for judging the class of the input/output argument included in the dll file include There is the generic attribute information for inheriting predetermined class;And
Indicating module, for if so, entity category according to the instruction entity of the generic attribute information for inheriting predetermined class Property information.
9. device according to claim 8, which is characterized in that described device further includes:
First transmitting element, the corresponding generic attribute letter of class of the input/output argument for being included in the dll file is judged After whether breath includes the generic attribute information for inheriting predetermined class, if it is not, then sending the first prompt message to first object Address, wherein, first prompt message be used to prompting not including in input/output argument in the dll file it is described after The generic attribute information of predetermined class is held, and generates the JS object definitions failure.
10. device according to claim 6, which is characterized in that described device further includes:
Second transmitting element, for according to the entity attribute information and the annotation of the entity attribute information read After characteristic class label generates the JS object definitions, the second prompt message is sent to the second destination address, wherein, described second Prompt message is successful for prompting the generation JS object definitions;
Determination unit, for determining store path according to the routing instructions received, wherein, the routing instructions are used In the path for determining the storage JS object definitions;And
Storage unit, for storing the JS object definitions into the store 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 true CN108170408A (en) 2018-06-15
CN108170408B 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)

Citations (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
CN105159928A (en) * 2015-08-05 2015-12-16 深圳联友科技有限公司 Method and system for converting JSON data into model data

Patent Citations (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
CN105159928A (en) * 2015-08-05 2015-12-16 深圳联友科技有限公司 Method and system for converting JSON data into model data

Also Published As

Publication number Publication date
CN108170408B (en) 2020-11-24

Similar Documents

Publication Publication Date Title
JP2020535555A5 (en)
JP2019532414A (en) Kernel module loading method and apparatus
CN106201566A (en) The rich big special hot upgrade method of software of profit and equipment
CN110046101A (en) Page automated testing method, device and computer storage medium
CN109062617A (en) A kind of application method, the mobile terminal of platform that supporting polymorphic type equipment
CN109522068A (en) The edit methods of the methods of exhibiting and system of the page, page data
EP2962186A1 (en) Providing code change job sets of different sizes to validators
CN107423893B (en) Full-coverage testing method and device for business process
WO2016202157A2 (en) Random testing program generation method and device, apparatus, and storage medium
US10540150B2 (en) Composable context menus
CN108491207A (en) Expression processing method, apparatus, equipment and computer readable storage medium
CN112632920A (en) Link processing method, link processing device, terminal equipment and storage medium
CN110457038A (en) Card display methods, device, equipment and the storage medium of attached application end
CN104246693B (en) Information processing unit for protecting the data in call stack and method
CN103838720B (en) Page file, which is loaded into, executes method and apparatus
US8397217B2 (en) Integrating templates into tests
Gallos et al. WebSnapse v3: Optimization of the Web-based Simulator of Spiking Neural P System using Matrix Representation, WebAssembly and Other Tools
CN103646015B (en) Transmission, the method and system for receiving and transmitting XML message
CN108196937A (en) Processing method, device, computer equipment and the storage medium of string
CN108170408A (en) The generation method and device of JS object definitions
CN110287171B (en) Data processing method and system
CA3117332A1 (en) Generating test cases for a software application and identifying issues with the software application as a part of test case generation
EP3785193A1 (en) Test and training data
CN112015373B (en) Endogenous safety application software formal modeling method based on formalization method
CN108306937A (en) Sending method, acquisition methods, server and the storage medium of short message verification 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