Detailed description of the invention
For the technical scheme making those skilled in the art be more fully understood that in the application, below in conjunction with in the embodiment of the present application
Accompanying drawing, the technical scheme in the embodiment of the present application is clearly and completely described, it is clear that described embodiment is only
It is some embodiments of the present application rather than whole embodiments.Based on the embodiment in the application, ordinary skill people
The every other embodiment that member is obtained under not making creative work premise, all should belong to the scope of the application protection.
Below in conjunction with the accompanying drawings element naming conflict processing method described herein is described in detail.Fig. 1 is the application institute
State the method flow diagram of a kind of element term a kind of embodiment of clash handle device.Although this application provides such as following embodiment or
Method operating procedure described in flow chart, but based on conventional or can include more in the process without performing creative labour
Or less operating procedure.Not existing in logicality in necessary causal step, the execution sequence of these steps does not limits
In the execution sequence that the embodiment of the present application provides.When the device in practice of described method or end product perform, can be by
Perform or the executed in parallel (ring of such as parallel processor or multiple threads according to embodiment or method shown in the drawings order
Border).
Fig. 1 is the method flow schematic diagram of a kind of a kind of embodiment of element term conflict processing method that the application provides.Such as Fig. 1
Shown in, described method may include that
S1: store the rule of combination of the prefix character pre-set and described prefix character and self-defined masurium.
The application can pre-set one or more prefix character, and described prefix can be stored by the way of specifying
Character.Letter that described prefix character can include may be used for being combined with self-defined masurium, numeral, special symbol etc.
Character information.General, the prefix character of an acquiescence, such as " pre " or " pa " can be pre-set.Before described
The character information that can include adding described self-defined masurium character front end to that asyllabia symbol is general, may be used for mark display should
Element is self-defining element, and element term is the self-defined masurium that with the addition of this prefix character.
In a preferred embodiment of the present application, the prefix character that described storage pre-sets can include storing and pre-sets
At least two prefix character.So, when the conflict of self-defined masurium occurs, can be that developer provides more front asyllabia
Symbol chooses item, and developer can be according to the data processing needs of self-defined element, process, or the type etc. of self-defined element
Choose suitable prefix character.In element term conflict processing method described in the present embodiment, can set according to different application scene
The multiple prefix characters put, can effectively reduce the probability of self-defined masurium conflict, improve the reliability of overall applicability, with
Time can also improve the development efficiency such as the programming of application, design.
The rule of combination that described prefix character and self-defined masurium can also be set general in the present embodiment.Described combination rule
Then may be generally comprised in specific embodiment application scenarios, there is conflict in the such as title at the self-defined element of Webpage
Time, the prefix character of described setting combines or operation method with the self-defined masurium of described Name Conflict, to reach to form institute
State the new element name of self-defined element.The exploitation design language that described rule of combination can be used in combination is arranged, it is also possible to from
Arranging according to design requirement of definition.In most application scenarios in the art, described rule of combination can include before described
Asyllabia symbol adds the front position of described self-defined masurium to.Such as in above-mentioned Webpage application and development designs, Ke Yishe
Determine global variable prefix, may be used for storing the prefix character such as " pa-" pre-set, or can also store and determine whether
Add the instruction of prefix character or judge information.Such as developer can be with a self-defined element, such as a paging
Label.Can there is name punching when arranging self-defined element entitled " pagination " for self-defining element in described developer
Prominent situation, before can adding the prefix character in global variable to self-defined masurium according to rule of combination described above
End position, forms new element name " pa-pagination ".
Certainly, in other application scenarios, described rule of combination can set according to design requirement or exploitation design language
Put.Such as when using angular.js framework under javascript environment, if developer uses such as<pa-pagination>this
The self-defined element of sample, then then need by the title of " paPagination " when defining element, so generating new element name
Depending on the regular specification concrete according to different frameworks.General can the including but not limited to such as of rule of combination described herein
The above-mentioned front position that described prefix character adds to described self-defined masurium, as formed afterwards plus prefix character " pa-"
New element name " pa-pagination ".Or it can also be provided that to described prefix character is added described self-defined masurium
Back-end location, such as the new element name " pagination-pa " formed afterwards plus prefix character "-pa ".Even, should at some
With in scene, described rule of combination can also include described prefix character replaces specific field in described self-defined masurium
Character etc..
It should be noted that the rule of combination of prefix character described herein and self-defined element can include one described before
The corresponding a kind of rule of combination of asyllabia symbol, it is also possible to include multiple described prefix character correspondence one rule of combination, naturally it is also possible to bag
Include a certain rule of combination of same sampling of the prefix character to all settings to be combined or computing with described self-defined masurium
Embodiment.General, after arranging described prefix character and rule of combination, described prefix character can have corresponding thereto
Rule of combination.
The prefix character pre-set can be stored, and the rule of combination of described prefix character and described self-defined masurium is set.
S2: the self-defined masurium obtaining element term conflict and the described prefix character chosen, generate according to described rule of combination
The new element name of described self-defined masurium.
In embodiments herein, developer quotes self-defined element and occurs when conflict occurs in self-defined masurium, the application
Described method can obtain the self-defined masurium of described self-defined masurium conflict.Concrete described acquisition element term conflict
The method of self-defined masurium can include by the specific function in application and development programming language, assembly, script, class, function mould
Blocks etc. monitor when the self-defined masurium of the self-defined element currently quoted exists naming conflict and obtain described self-defined masurium.
The application is not precluded within application scenes and can also include being obtained as described by the self-defined masurium specified by developer
Take the self-defined masurium of element term conflict, the self-defined unit such as specifying the self-defined elements A being presently in existence to be conflict
Element name, or specify the self-defined elements A that be newly added identical with the described self-defined element name existed ' for conflict certainly
Definition masurium.Then the described self-defined masurium specified is carried out computing or combination producing new element name.
When conflict occurs in the self-defined masurium of appearance described above, developer can be from the described prefix character prestored
Choose and need and the prefix character of described self-defined masurium combination, then the application method can obtain described in the front asyllabia chosen
Symbol.In concrete implementation mode, can be in described appearance self-defined masurium conflict or when quoting self-defined element, Xiang Kai
The personnel of sending out show the prefix character of storage, select for developer.
As described in aforementioned, after getting the prefix character chosen, can generate according to the rule of combination corresponding to described prefix character
The new element name of described self-defined masurium.
Certainly, if storage has multiple prefix character, as also storage has prefix character " au-", " us-", " cn-",
Occur can the preset prefix character " pa-" of storage, " au-", " us-", " cn-" being carried when self-defined masurium conflicts
Supply developer select.Such as developers multiple in above-mentioned application scenarios when self-defined paging tag element past
Toward using self-defined masurium " pagination ", and the first developer in the plurality of developer and the second exploit person
Member makes to the addition of identical prefix character " pa-" in order to avoid masurium self-defined with other developers is identical.So exist
Such as when page development quotes customized label, the 3rd developer is introducing the self-defined masurium of the first developer
After " pa-pagination ", it is re-introduced into during self-defined masurium " pa-pagination " of the second developer that name can occur
The situation of conflict.The national language that the most now developer can show in applying according to Webpage chooses use respective country
The prefix character of english abbreviation, then forms the new element name of customized label element according to described rule of combination.
Obtain the prefix character chosen and the self-defined masurium of element term conflict, make by oneself according to the generation of described rule of combination
The new element name of justice masurium.
S3: set up the mapping relations being called described self-defined masurium by described new element name.
After the new element name generating self-defined masurium according to the prefix character chosen, can set up described self-defined masurium with
The mapping relations of described new element name.Described mapping relations can be stored by data base or this locality and/long-range functional module.This
The self-defined masurium that will appear from naming conflict in embodiment is modified as another new element name, makes by oneself in actual application scenarios
Justice element one of them property value of entitled self-defined element.In the described paging label in self-defined element such as html generally
Can also include multiple attribute information, such as coordinate information, colouring information and with call other functions, module, label etc.
Related information.In the application in order to ensure will name punching self-defined masurium be modified as new element name after described new element name should
By the availability in exploitation, method described in the present embodiment can set up and store described self-defined masurium and described new element name
Mapping relations, in order to the self-defined of reality can be called when described new element name quoted by other functions, module or label etc.
Masurium.
Mapping relations described in the present embodiment can be according to different Application development environ-ments or the design requirement combining developer
It is configured.Such as in the environment of self-defined html page elements, described foundation by described new element name call described from
The mapping relations of definition masurium can include making by oneself with described by arranging global object and set up and store described new element name
The mapping relations of justice masurium.Concrete such as can arrange a global object relation, may be used for storing naming conflict
Self-defined masurium " pagination " and the new element name generating this self-defined element according to described prefix character and rule of combination
The mapping relations of " pa-pagination ", such as relation={ ' pagination ': ' paPagination '.Described global object is according to opening
The specification sending out design language can be called use by other assemblies, module, label etc. in the global scope limited.
Fig. 2 is the method flow schematic diagram of the application a kind of element term conflict processing method another kind embodiment.As in figure 2 it is shown,
After establishing the described mapping relations that can be called described self-defined masurium by new element name, in application other such as
Function, module, label etc. can refer to the self-defined masurium corresponding to described new element name by described mapping relations.Cause
This, in a kind of element term conflict processing method described herein, described method can also include:
S4: access the self-defined masurium corresponding to described new element name based on described mapping relations.
Needing explanation, application described herein can include based on the page developing design under html.Described herein one
Planting element term conflict processing method and go for the framework of self-defined page elements, including but not limited to can self-defined html
The application scenarios of page elements.
Element term conflict processing method described in the embodiment of the present application can significantly drop when quoting the self-defined element of third party
The situation of low element self-defined element naming conflict and the amendment treatment effeciency of self-defined masurium time naming conflict occurs.And
And, the application can arrange multiple prefix character, can be that developer provides more prefix character to select space, effectively
Reduce and quote the naming conflict problem that the identical self-defined element name corresponding prefix of interpolation is caused by different developer.Need
Bright, at the application scenarios of the framework self-defined html page elements the most described above supporting self-defined page elements
In, method described herein can self-defining or quote third-party self-defined element occur conflict time, reduce exploitation
Personnel carry out attribute information amendment to the self-defined masurium of naming conflict, rewriting definition even abandons use, improve application programming
The development efficiency of design.On the other hand, herein described method establishes to be called by new element name and make by oneself accordingly
The mapping relations of justice masurium, have ensured and still can draw in current application Programming Design exploitation use amended new element name
Use the self-defined masurium of former reality.
Element term conflict processing method described herein be possible not only to effectively reduce because of self-defined element naming conflict and
The naming conflict phenomenon that the prefix character added while the name of described self-defined element is identical is the most identical and causes.And occurring
During described self-defined element naming conflict, developer can need not the self-defined element of naming conflict is carried out former attribute information
Or to the amendment of related information, can directly be referred to the original self-defined masurium of reality by the mapping relations set up.
And the application method can provide multiple prefix character and/or multiple rule of combination, developer is made to have more new element to name
Select space, facilitate developer to quote operating with of self-defined element, improve application and development efficiency.
Based on element term conflict processing method described herein, the application also provides for a kind of element term clash handle device.
Fig. 3 is the modular structure schematic diagram of herein described element term a kind of embodiment of clash handle device.As it is shown on figure 3, it is concrete
, described device may include that
Memory module 101, may be used for storing the prefix character pre-set and described prefix character and self-defined masurium
Rule of combination;
Computing module 102, the self-defined masurium that may be used for acquisition element term conflict and the prefix character chosen, and according to
Described rule of combination calculates the new element name generating described self-defined masurium;
Mapping block 103, may be used for setting up and storing the mapping relations of described self-defined masurium and described new element name.
Element term clash handle device described herein can be greatly lowered element when quoting the self-defined element of third party
The situation of self-defined element naming conflict.Further, the application device can arrange multiple prefix character, can be developer
There is provided more prefix character to select space, effective reduction to quote different developer the name of identical self-defined element is added accordingly
Prefix and the naming conflict problem that causes.At the self-defined html that the framework supporting self-defined page elements is the most described above
In the application scenarios of page elements, device described herein can be at self-defining or quote third-party self-defined element and go out
When now conflicting, directly can choose prefix character to be added in current application development interface, then generate new self-defined unit
The title of element.Developer so can be avoided the self-defined masurium of naming conflict to carry out attribute information amendment, rewrites definition
Even abandon use, improve the development efficiency of application programming design.The most herein described device stores to have and can pass through Singapore dollar
Element name calls the mapping relations of corresponding self-defined masurium, has ensured after the exploitation use amendment of current application Programming Design
New element name still can refer to the self-defined masurium of former reality.
Fig. 4 is the modular structure schematic diagram of herein described element term clash handle device another kind embodiment.As described in Figure 4,
Described device can also include:
Access modules 104, may be used for accessing described new element name institute according to the mapping relations of storage in described mapping block 103
Corresponding self-defined masurium.
Method described herein can self-defining or quote third-party self-defined element occur conflict time, can pass through
Described access modules accesses the self-defined masurium calling reality, and developer can need not self-defined unit to naming conflict again
Element name carries out attribute information amendment, rewriting definition even abandons use, improves the development efficiency of application programming design.
In herein described element term clash handle device preferred embodiment, described memory module 101 can store and set in advance
At least two prefix character put.
In herein described element term clash handle device another kind preferred embodiment, described rule of combination can include following
In at least one:
Described prefix character is added to the front position of described self-defined masurium;
Described prefix character is added to the back-end location of described self-defined masurium;
Described prefix character is replaced the character of specific field in described self-defined masurium.
As it was previously stated, described prefix character can include a described prefix character corresponding with the rule of combination of self-defined element
Plant rule of combination, it is also possible to include multiple described prefix character correspondence one rule of combination, naturally it is also possible to include all settings
The prefix character a certain rule of combination of same sampling.General, after described prefix character and rule of combination are set, described prefix
Character can have rule of combination corresponding thereto.
Fig. 5 is the modular structure signal of a kind of embodiment of mapping block 103 in herein described element term clash handle device
Figure.As described in Figure 5, described mapping block 103 may include that
Global object's module 1031, may be used for the global object set up, stores described self-defined element in described global object
Name and the mapping relations of described new element name.
Described global object can be quoted by global reference in application scenes.Such as at the ring of self-defined html page elements
The mapping relations of the new element name of the band prefix after former self-defined masurium and generation can be deposited in global variable by border, as
Relation={ ' pagination ': ' paPagination ' }.
A kind of Name Conflict treating method and apparatus that the application provides, is possible not only to effectively reduce because of the name punching of self-defined element
The naming conflict phenomenon that the prefix character added while prominent and described self-defined element name is identical is the most identical and causes.And
When there is described self-defined element naming conflict, developer can need not belong to the self-defined element of naming conflict originally
Property information or to the amendment of related information, can directly be referred to the original self-defined unit of reality by the mapping relations set up
Element name.And the application method can provide multiple prefix character and/or multiple rule of combination, developer is made to have multiple Singapore dollars
Element name selects space, facilitates developer to quote operating with of self-defined element, reduces the process time solving naming conflict
With raising application and development efficiency.
Although teachings herein is mentioned the description of the data processing circumstance of html, javascript design language or the like, but,
The application is not limited to must be complete standard or the situation of mentioned data handling utility environment.In the application, each is real
Executing foregoing description involved in example is only the application in some embodiments in the application, self-defined pages of other support at some
The framework of surface element can also be carried out the scheme of each embodiment of above-mentioned the application.Certainly, the application the various embodiments described above are being met
Described in other of process method step without creative deformation, still can realize identical application, not repeat them here.
Although this application provides the method operating procedure as described in embodiment or flow chart, but based on routine or without creativeness
Means can include more or less operating procedure.The sequence of steps enumerated in embodiment is only numerous step execution sequences
In a kind of mode, do not represent unique execution sequence.When device in practice or client production perform, can be according to reality
Execute example or method shown in the drawings order performs or executed in parallel (environment of such as parallel processor or multiple threads).
Above-described embodiment illustrates device or module, specifically can be realized by computer chip or entity, or by having certain function
Product realize.For convenience of description, it is divided into various module to be respectively described with function when describing apparatus above.Certainly, exist
Implement the function of each module to be realized in same or multiple softwares and/or hardware during the application, it is also possible to will realize same
The module of function is realized by the combination of multiple submodules or subelement.
It is also known in the art that in addition to realizing controller in pure computer readable program code mode, the most permissible
Make controller with gate, switch, special IC, FPGA control by method step carries out programming in logic
The form of device processed and embedding microcontroller etc. realizes identical function.The most this controller is considered a kind of Hardware Subdivision
Part, and its inside is included can also be considered as the structure in hardware component for the device realizing various function.Or even,
In can being considered as the device being used for realizing various function not only can being the software module of implementation method but also can being hardware component
Structure.
The application can be described in the general context of computer executable instructions, such as program module.
Usually, program module include perform particular task or realize the routine of particular abstract data type, program, object, assembly,
Data structure, class etc..The application can also be put into practice in a distributed computing environment, in these distributed computing environment, by
The remote processing devices connected by communication network performs task.In a distributed computing environment, program module can position
In the local and remote computer-readable storage medium including storage device.
As seen through the above description of the embodiments, those skilled in the art it can be understood that to the application can be by soft
Part adds the mode of required general hardware platform and realizes.Based on such understanding, the technical scheme of the application is the most in other words
The part contributing prior art can embody with the form of software product, and this computer software product can be stored in
In storage medium, such as ROM/RAM, magnetic disc, CD etc., use so that a computer equipment is (permissible including some instructions
Be personal computer, mobile terminal, server, or the network equipment etc.) perform each embodiment of the application or embodiment
Method described in some part.
Each embodiment in this specification uses the mode gone forward one by one to describe, and between each embodiment, same or analogous part is mutual
Seeing, what each embodiment stressed is the difference with other embodiments.The application can be used for numerous general or
In special computing system environments or configuration.Such as: personal computer, server computer, handheld device or portable set
Standby, laptop device, mobile communication terminal, multicomputer system, system based on microprocessor, programmable electronic equipment,
Network PC, minicomputer, mainframe computer, the distributed computing environment including any of the above system or equipment etc..
Although depicting the application by embodiment, it will be appreciated by the skilled addressee that the application have many deformation and a change and
Without departing from spirit herein, it is desirable to appended claim includes that these deformation and change are without deviating from spirit herein.