Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, completeSite preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hairEmbodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative effortsExample, shall fall within the protection scope of the present invention.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instructionDescribed feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precludedBody, step, operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this description of the invention merely for the sake of description specific embodimentAnd be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless onOther situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
Referring to Fig. 1, Fig. 1 is a kind of schematic flow diagram of interface message management method provided in an embodiment of the present invention.It shouldMethod may operate in smart phone (such as Android phone, IOS mobile phone), tablet computer, laptop and intelligence and setIn the terminals such as standby.As shown in Figure 1, the method comprising the steps of S101~S104.
S101 receives the customized note that developer writes according to target interface.
In embodiments of the present invention, the target interface refers to the application journey for needing to be selected by developer according to businessSequence programming interface, according to the difference of operating system, interface is broadly divided into Windows interface and linux interface;Work as developerSelect a certain interface as target interface after, customized note is accordingly write to selected target interface, specifically, making by oneselfJustice note is the interface message in order to obtain target interface, which includes its of interface name, interface IP address and interfaceIts attribute, wherein other attributes include class method, field, interface logic etc. in the corresponding interface code of the target interfaceDeng.More specifically, the format for the customized note write are as follows: public@interface explains name { defining body }, explains ginsengSeveral support data types:
1, all basic data types (int, float, boolean, byte, double, char, long, short);2,String type;3, Class type;4, enum type;5, Annotation type;6, the array of all of above type.
It should be noted that the comment code write can be according to selected when developer writes customized noteThe interface selected is determined, and needs to abide by following rule when writing customized note: 1) Annotation type is defined as@Interface, all Annotation can inherit this interface of java.lang.Annotation automatically, and cannot go againInherit other class or interface;2) parameter member can only use public or default (default) the two access rights modification;3) joinNumber member can only use fundamental type byte, short, char, int, long, float, double, eight kinds of master datas of booleanThe data types such as type and String, Enum, Class, annotations, and this some type of array;4) when acquisition classWhen the annotating information of method and field, it is necessary to Annotation object is obtained by the reflection technology of Java, because you remove thisExcept do not have it is other obtain annotation object method.
Further, as shown in Fig. 2, the step S101 includes step S202~S204.
S202 determines the object range in the corresponding logical code of the target interface for note.
S204 specifies object range determined by note using received customized explain of institute.
In the present embodiment, the customized note that developer is write mainly passes through creation and explains class, and defines and createdThe note value for the note class built explains logical code corresponding in target interface, above-mentioned steps S202 and step S204Explaining class by creation can specify class in the logical code of target interface or method as annotation object, such as be createdNote class be interface, define the corresponding note value of note class interface be default value (value), the note valueIt is directed toward annotation object, however, it is determined that the class Override in the corresponding logical code of target interface can pass through as annotation object" public@interface Override " mode explains the class Override of target interface, and passes through noteObtain interface message.
S102 is marked the interface message in the target interface according to the customized note.
In embodiments of the present invention, the annotation object in identified target interface can be class, be also possible to method, butIt is the class or method either in logical code, it is required that must being believed containing the interface of the target interface in such or methodBreath, since the corresponding logical code of target interface is by developer's self-developing, so developer will be apparent that in logical codeWhich class perhaps which method contain interface message creation explain by way of corresponding class or method are explained,To obtain the interface message in target interface.
Further, as shown in figure 3, the step S102 includes step S302~S304.
S302 determines position of the interface message in the corresponding logical code of the target interface.
In embodiments of the present invention, there are multiple annotation objects in the corresponding logical code of the target interface, explainObject include class perhaps the method interface message can reside in class can also perhaps exist simultaneously in method in class orIn method, since the corresponding logical code of target interface is by developer's self-developing, logic generation can be easily determinedWhich class or method include the interface message in code, for example, can according to the pre-set interface identifier of developer,It include that perhaps the method interface identifier can be corresponding class or side for the class of interface message by interface identifier determinationThe name nominating of method is corresponding interface message name, for example, in advance will include class name corresponding to the class of interface name TestIt is named as Test1 etc..
S304 is marked the corresponding interface message in identified position according to the customized note.
In embodiments of the present invention, the interface in the corresponding logical code of the target interface is believed by customized explainBreath is marked, specifically, by customized note can to the class or method in logical code including interface message intoLine flag, wherein can be with by the customized format that is marked explained are as follows: modifier (customized note class) (is explained pairAs);For example, identified annotation object is the class Override in the corresponding logical code of target interface, customized noteClass is interface, and defining the corresponding note value of note class interface is default value (value), note value valueBe directed toward annotation object Override, however, it is determined that class Override in the corresponding logical code of target interface as annotation object,The class Override of target interface can be marked by " public@interface Override " mode, andInterface message is obtained by explaining.
S103 parses the customized note according to default note resolver, and obtains in the target interfaceThe interface message of label.
In embodiments of the present invention, when use the customized note write to object range identified in target interfaceAfter being explained, the interface message of explained target interface is obtained, which includes interface name, interface IP address and connectMouthful other attributes, the note value of class is explained in the customized note by saving interface information;It is explained in class to obtainThe interface message that is saved simultaneously is shown, and needs to explain resolver by default and parse to class is explained, and obtain noteThe note value of class is to obtain the marked interface message that it is saved.
Specifically, first layer includes state session as shown in figure 4, the default note resolver uses hierarchical structureBean, without state Session Border Control and Message-Driven Bean resolver, the second layer include class explain, method explain and domain explain parsingDevice, third layer include the resolver of some specific note.
Further, as shown in figure 5, the step S103 includes step S402~S404.
Whether S402 judges in the corresponding logical code of the target interface comprising customized note.
S404, if in the corresponding logical code of the target interface include customized note, to it is described it is customized explain intoRow parsing, and the note value of the customized note is obtained, it obtains marking in the target interface by acquired note valueInterface message.
S104 is shown the interface message by HTML/JavaScript sentence, and the interface shown is believedBreath is deposited in database in the form of document.
In embodiments of the present invention, displaying code is write by HTML/JAVASCRIP grammer, storage is obtained from memoryInterface message, and interface message show in webpage/system current display interface by write displaying code, to developPersonnel provide interfacing document (document including interface message).
As seen from the above, the customized note that the embodiment of the present invention is write by receiving developer according to target interface;According to the customized note, the interface message in the target interface is marked;According to default note resolver, to instituteIt states customized note to be parsed, and obtains the interface message marked in the target interface;Pass through HTML/JavaScript languageInterface message described in sentence pair is shown, and the interface message shown is deposited in database in the form of document.This hairBright embodiment can prevent the description and the inconsistent situation of actual development process of test interface, and the ditch of developer is effectively reducedLogical cost, and influence caused by can reduce document as manual compiling due to generating spelling words mistake.
Referring to Fig. 6, a kind of corresponding above-mentioned interface message management method, the embodiment of the present invention also propose a kind of interface messageManaging device, the device 100 include: receiving unit 101, marking unit 102, resolution unit 103, display unit 104.
Wherein, the receiving unit 101, the customized note write for receiving developer according to target interface.
Marking unit 102, for being marked to the interface message in the target interface according to the customized noteNote.
Resolution unit 103 parses the customized note, and obtain institute for explaining resolver according to defaultState the interface message marked in target interface.
Display unit 104, for being shown by HTML/JavaScript sentence to the interface message, and by instituteThe interface message of displaying is deposited in database in the form of document.
As seen from the above, the customized note that the embodiment of the present invention is write by receiving developer according to target interface;According to the customized note, the interface message in the target interface is marked;According to default note resolver, to instituteIt states customized note to be parsed, and obtains the interface message marked in the target interface;Pass through HTML/JavaScript languageInterface message described in sentence pair is shown, and the interface message shown is deposited in database in the form of document.This hairBright embodiment can prevent the description and the inconsistent situation of actual development process of test interface, and the ditch of developer is effectively reducedLogical cost, and influence caused by can reduce document as manual compiling due to generating spelling words mistake.
Referring to Fig. 7, the receiving unit 101, comprising:
First determination unit 101a, for determining the object model in the corresponding logical code of the target interface for noteIt encloses.
Unit 101b is explained, for utilizing the received customized note of institute is specified to explain identified object range.
Referring to Fig. 8, the marking unit 102, comprising:
Second determination unit 102a, for determining the interface message in the corresponding logical code of the target interfacePosition.
Mark subelement 102b, for according to the customized note, to the corresponding interface message in identified position intoLine flag.
Referring to Fig. 9, the resolution unit 103, comprising:
Judging unit 103a, for whether judging in the corresponding logical code of the target interface comprising customized note.
Parsing subunit 103b, if for including customized note in the corresponding logical code of the target interface, to instituteIt states customized note to be parsed, and obtains the note value of the customized note, obtained by acquired note value describedThe interface message marked in target interface.
Above-mentioned interface message managing device and above-mentioned interface message management method correspond, specific principle and processIt is identical as above-described embodiment the method, it repeats no more.
Above-mentioned interface message managing device can be implemented as a kind of form of computer program, and computer program can be such asIt is run in computer equipment shown in Fig. 10.
Figure 10 is a kind of structure composition schematic diagram of computer equipment of the present invention.The equipment can be terminal, be also possible toServer, wherein terminal can be smart phone, tablet computer, laptop, desktop computer, personal digital assistant and wearWear the electronic device that formula device etc. has communication function.Server can be independent server, be also possible to multiple serversThe server cluster of composition.Referring to Fig.1 0, the computer equipment 500 include the processor 502 connected by system bus 501,Non-volatile memory medium 503, built-in storage 504 and network interface 505.Wherein, the non-volatile of the computer equipment 500 is depositedStorage media 503 can storage program area 5031 and computer program 5032, which is performed, and may make placeReason device 502 executes a kind of interface message management method.The processor 502 of the computer equipment 500 is calculated and is controlled for providingAbility supports the operation of entire computer equipment 500.The built-in storage 504 is the computer in non-volatile memory medium 503The operation of program 5032 provides environment, when which is executed by processor, processor 502 may make to execute a kind of interfaceApproaches to IM.The network interface 505 of computer equipment 500 such as sends the task dispatching of distribution for carrying out network communication.ThisField technical staff is appreciated that structure shown in Figure 10, only the block diagram of part-structure relevant to application scheme,The restriction for the computer equipment being applied thereon to application scheme is not constituted, specific computer equipment may include ratioMore or fewer components as shown in the figure perhaps combine certain components or with different component layouts.
Wherein, following operation is realized when the processor 502 executes the computer program:
Receive the customized note that developer writes according to target interface;
According to the customized note, the interface message in the target interface is marked;
According to default note resolver, the customized note is parsed, and obtains and is marked in the target interfaceInterface message;
The interface message is shown by HTML/JavaScript sentence, and by the interface message shown withThe form of document is deposited in database.
In one embodiment, the customized note for receiving developer and being write according to target interface, comprising:
Determine the object range in the corresponding logical code of the target interface for note;
Object range determined by note is specified using received customized explain of institute.
In one embodiment, described according to the customized note, the interface message in the target interface is carried outLabel, comprising:
Determine position of the interface message in the corresponding logical code of the target interface;
According to the customized note, the corresponding interface message in identified position is marked.
In one embodiment, the default note resolver use hierarchical structure, first layer include state Session Border Control,Without state Session Border Control and Message-Driven Bean resolver, the second layer includes that class is explained, method is explained and resolver, third are explained in domainLayer includes the resolver of some specific note.
In one embodiment, the basis is default explains resolver, parses to the customized note, and obtainThe interface message marked in the target interface, comprising:
Whether judge in the corresponding logical code of the target interface comprising customized note;
If including customized note in the corresponding logical code of the target interface, the customized note is solvedAnalysis, and the note value of the customized note is obtained, it is connect by what acquired note value obtained marking in the target interfaceMessage breath.
It will be understood by those skilled in the art that the embodiment of computer equipment shown in Figure 10 is not constituted to computerThe restriction of equipment specific composition, in other embodiments, computer equipment may include components more more or fewer than diagram, orPerson combines certain components or different component layouts.For example, in some embodiments, computer equipment only includes memoryAnd processor, in such embodiments, the structure and function of memory and processor are consistent with embodiment illustrated in fig. 10, hereinIt repeats no more.
The present invention provides a kind of computer readable storage medium, computer-readable recording medium storage has one or oneA above computer program, the one or more computer program can be held by one or more than one processorRow, to perform the steps of
Receive the customized note that developer writes according to target interface;
According to the customized note, the interface message in the target interface is marked;
According to default note resolver, the customized note is parsed, and obtains and is marked in the target interfaceInterface message;
The interface message is shown by HTML/JavaScript sentence, and by the interface message shown withThe form of document is deposited in database.
In one embodiment, the customized note for receiving developer and being write according to target interface, comprising:
Determine the object range in the corresponding logical code of the target interface for note;
Object range determined by note is specified using received customized explain of institute.
In one embodiment, described according to the customized note, the interface message in the target interface is carried outLabel, comprising:
Determine position of the interface message in the corresponding logical code of the target interface;
According to the customized note, the corresponding interface message in identified position is marked.
In one embodiment, the default note resolver use hierarchical structure, first layer include state Session Border Control,Without state Session Border Control and Message-Driven Bean resolver, the second layer includes that class is explained, method is explained and resolver, third are explained in domainLayer includes the resolver of some specific note.
In one embodiment, the basis is default explains resolver, parses to the customized note, and obtainThe interface message marked in the target interface, comprising:
Whether judge in the corresponding logical code of the target interface comprising customized note;
If including customized note in the corresponding logical code of the target interface, the customized note is solvedAnalysis, and the note value of the customized note is obtained, it is connect by what acquired note value obtained marking in the target interfaceMessage breath.
Present invention storage medium above-mentioned include: magnetic disk, CD, read-only memory (Read-Only Memory,The various media that can store program code such as ROM).
Unit in all embodiments of the invention can pass through universal integrated circuit, such as CPU (CentralProcessing Unit, central processing unit), or pass through ASIC (Application Specific IntegratedCircuit, specific integrated circuit) it realizes.
Step in interface message management method of the embodiment of the present invention can the adjustment of carry out sequence, merging according to actual needsWith delete.
Unit in interface message managing device of the embodiment of the present invention can be merged according to actual needs, divides and be deletedSubtract.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, anyThose familiar with the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or replaceIt changes, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with rightIt is required that protection scope subject to.