Specific embodiment
In order to make those skilled in the art better understand the technical solutions in the application, below in conjunction with the application reality
The attached drawing in example is applied, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described implementation
Example is merely a part but not all of the embodiments of the present application.Based on the embodiment in the application, this field is common
The application protection all should belong in technical staff's every other embodiment obtained without making creative work
Range.
Element naming conflict processing method described herein is described in detail with reference to the accompanying drawing.Fig. 1 is this
Apply for a kind of method flow diagram of embodiment of a kind of element term clash handle device.Although this application provides such as following
Method operating procedure described in embodiment or flow chart, but in the method may be used based on routine or without creative labor
To include more or less operating procedure.In the step of there is no necessary causalities in logicality, these steps
Execution sequence is not limited to provided by the embodiments of the present application execute sequence.The device or end product in practice of the method
When execution, can be executed according to embodiment or method shown in the drawings sequence or it is parallel execute (such as parallel processor or
The environment of person's multiple threads).
Fig. 1 is a kind of method flow schematic diagram of embodiment of a kind of element term conflict processing method provided by the present application.
As shown in Figure 1, the method may include:
S1: the rule of combination of pre-set prefix character and the prefix character and customized masurium is stored.
One or more prefix character can be preset in the application, and institute can be stored by specified mode
State prefix character.The prefix character may include the letter that can be used for being combined with customized masurium, number, specific
The character informations such as symbol.In general, the prefix character of a default, such as " pre " or " pa " can be preset.Described
General prefix character may include the character information for being added to the customized masurium character front end, can be used for identifying aobvious
Show that the element is customized element, element term is the customized masurium for being added to the prefix character.
In a preferred embodiment of the present application, the pre-set prefix character of storage may include that storage is preparatory
At least two prefix characters being arranged.In this way, can be provided when there is the conflict of customized masurium for developer more
Prefix character chooses item, and developer can be according to the data processing needs of customized element, process or customized element
The suitable prefix character of the selections such as type.In element term conflict processing method described in the present embodiment, it can be answered according to difference
With multiple prefix characters of scene setting, a possibility that customized masurium conflicts can be effectively reduced, improve overall applicability
Reliability, while can also be improved the development efficiency such as the programming of application, design.
The general rule of combination that the prefix character Yu customized masurium can also be set in the present embodiment.Described
Rule of combination may be generally comprised in specific embodiment application scenarios, such as weigh up in the name of the customized element of Webpage
When now conflicting, the prefix character of the setting is combined with the customized masurium of the Name Conflict or operation method, to reach
To the new element name for forming the customized element.The exploitation design language that the rule of combination can be used in combination is set
It sets, customized can also be arranged according to design requirement.In most application scenarios in the art, the rule of combination can be with
Front position including the prefix character to be added to the customized masurium.Such as in above-mentioned Webpage application and development
In design, global variable prefix can be set, can be used for storing pre-set prefix character such as " pa- ", or may be used also
To store the instruction for determining whether to add prefix character or judge information.Such as developer can with a customized element,
Such as the label of a paging.The developer is that customized element is arranged for customized element is entitled
Can occur the case where naming conflict when " pagination ", it can will be in global variable according to rule of combination described above
Prefix character is added to the front position of customized masurium, is formed new element name " pa-pagination ".
Certainly, in other application scenarios, the rule of combination can be according to design requirement or exploitation design language
It is configured.Such as when using angular.js frame under javascript environment, if developer uses such as < pa-
Pagination > as customized element, then then need the title with " paPagination " when defining element, so
Generate new element name rule specifically standardized according to different frames depending on.Rule of combination described herein is general can be with
The prefix character is including but not limited to added to the front position of the customized masurium as described above, before such as adding
The new element name " pa-pagination " that asyllabia symbol " pa- " is formed afterwards.Or it may be set to be and add the prefix character
To the back-end location of the customized masurium, the new element name " pagination- such as formed afterwards plus prefix character "-pa "
pa".Even, in application scenes, the rule of combination also may include that the prefix character is replaced to described make by oneself
The character etc. of specific field in adopted masurium.
It should be noted that the rule of combination of prefix character described herein and customized element may include one
The prefix character corresponds to a kind of rule of combination, also may include that multiple prefix characters correspond to a kind of rule of combination, certainly
It also may include that a certain rule of combination of sampling same to the prefix character of all settings and the customized masurium carry out group
The embodiment of conjunction or operation.In general, after the prefix character and rule of combination is arranged, the prefix character can have with
Its corresponding rule of combination.
It can store pre-set prefix character, and the combination of the prefix character Yu the customized masurium be set
Rule.
S2: obtaining the customized masurium of element term conflict and the prefix character of selection, is advised according to the combination
Then generate the new element name of the customized masurium.
In embodiments herein, when the customized masurium of the customized element appearance of developer's reference conflicts,
The customized masurium of the herein described available customized masurium conflict of method.The specific acquisition masurium
Claim conflict customized masurium method may include by application and development programming language specific function, component, script,
Class, functional module etc. monitor the customized masurium of the customized element currently quoted there are obtained when naming conflict it is described from
Define masurium.It also may include by developer by specified customized element that the application, which is not precluded in application scenes,
Name is as the customized masurium for obtaining element term conflict, such as specifies the customized elements A that is presently in existence to be
The customized masurium of conflict, or specify and name the customized of identical new addition with the already existing customized element
Elements A ' it is the customized masurium to conflict.Then operation is carried out to the specified customized masurium or combination producing is new
Masurium.
When the customized masurium of appearance described above conflicts, developer can be from the pre-stored prefix
The prefix character for needing to combine with the customized masurium is chosen in character, then the available selection of the application method
Prefix character.In concrete implementation mode, customized masurium conflict or the customized member of reference can occur described
When plain, the prefix character of storage is shown to developer, is selected for developer.
It, can the rule of the combination according to corresponding to the prefix character after getting the prefix character of selection as described in aforementioned
Then generate the new element name of the customized masurium.
Certainly, if being stored with multiple prefix characters, it is also such as stored with prefix character " au- ", " us- ", " cn- ", is being gone out
Preset prefix character " pa- ", " au- ", " us- ", " cn- " of storage can be supplied to exploitation when existing customized masurium conflict
Personnel select.Such as multiple developers in above-mentioned application scenarios are often made in customized paging tag element
With customized masurium " pagination ", and the first developer and the second developer in the multiple developer arrive
Make to be added to identical prefix character " pa- " in order to avoid identical as the customized masurium of other developers.So in example
When quoting customized label such as page development, third developer is in the customized masurium " pa- for introducing the first developer
After pagination ", can occur name punching when being re-introduced into customized masurium " pa-pagination " of the second developer
Prominent situation.So at this time developer can be applied according to Webpage shown in national language choose using respective country
Then the prefix character of english abbreviation forms the new element name of customized label element according to the rule of combination.
The customized masurium for obtaining the prefix character and element term conflict chosen generates institute according to the rule of combination
State the new element name of customized masurium.
S3: the mapping relations called by the new element name to the customized masurium are established.
After the prefix character according to selection generates the new element name of customized masurium, the customized member can establish
The mapping relations of plain name and the new element name.It is reflected described in being stored as database or local and/long-range functional module
Penetrate relationship.The customized masurium for naming conflict occur is modified as another new element name in the present embodiment, is answered actual
With the entitled customized one of attribute value of element of element customized in scene.In the customized element such as html
In paging label usually can also include multiple attribute informations, such as coordinate information, colouring information and with call other functions,
The related information of module, label etc..In the application in order to ensure will name punching customized masurium be modified as new element name after
Availability of the new element name in application and development, the present embodiment the method can establish and store the customized element
Name and the mapping relations of the new element name, so as to can in the reference new element name such as other functions, module or label
Actual customized masurium is arrived to call.
Mapping relations described in the present embodiment can be according to different Application development environ-ments or setting in conjunction with developer
Meter demand is configured.Such as in the environment of customized html page elements, described establish is called by the new element name
Mapping relations to the customized masurium may include being established by setting global object and storing the new element name
With the mapping relations of the customized masurium.A global object relation for example specifically can be set, can be used for
It stores the customized masurium " pagination " of naming conflict and this is generated according to the prefix character and rule of combination makes by oneself
The mapping relations of the new element name " pa-pagination " of adopted element, such as relation={ ' pagination ': '
paPagination'}.The global object can be by other in the global scope of restriction according to the specification of exploitation design language
The calling such as component, module, label use.
Fig. 2 is a kind of method flow schematic diagram of element term conflict processing method another kind embodiment of the application.Such as Fig. 2
It is shown, after establishing the mapping relations that can be called by new element name to the customized masurium, in
Other can be referred to customized corresponding to the new element name such as function, module, label by the mapping relations
Masurium.Therefore, in a kind of element term conflict processing method described herein, the method can also include:
S4: customized masurium corresponding to the new element name is accessed based on the mapping relations.
It should be noted that application described herein may include based on the page for developing design under html.The application institute
A kind of element term conflict processing method stated can be adapted for the frame of customized page elements, can including but not limited to make by oneself
The application scenarios of adopted html page elements.
Element term conflict processing method described in the embodiment of the present application can be big in the customized element of reference third party
The modification processing of the case where amplitude reduction element customized element naming conflict and customized masurium when there is naming conflict
Efficiency.Also, multiple prefix characters can be set in the application, it is empty that more prefix character selections can be provided for developer
Between, naming conflict caused by the different developers of reference add corresponding prefix to identical customized element name is effectively reduced and asks
Topic.It should be noted that in the customized html page elements for supporting the frame of customized page elements especially described above
Application scenarios in, method described herein can conflict in self-defining or the third-party customized element of reference
When, it reduces developer and the customized masurium of naming conflict is carried out attribute information modification, rewriting definition or even abandoned to use,
Improve the development efficiency of application programming design.On the other hand, establishing in herein described method can be adjusted by new element name
The mapping relations for using corresponding customized masurium, ensured used in the exploitation of current application Programming it is modified new
Masurium still can refer to former actual customized masurium.
Element term conflict processing method described herein can not only be effectively reduced to name because of customized element and be rushed
Naming conflict phenomenon caused by the prefix character that the prominent and described customized element adds while naming identical is also identical.And
And when the customized element naming conflict occur, developer can not need to carry out the customized element of naming conflict
Former attribute information or modification to related information, can directly be referred to by the mapping relations of foundation it is actual it is original from
Define masurium.And the application method can provide multiple prefix characters and/or multiple rules of combination, there is developer more
More new element name selection spaces, facilitates developer to quote operating with for customized element, improves application and development efficiency.
Based on element term conflict processing method described herein, the application also provides a kind of element term clash handle
Device.Fig. 3 is a kind of modular structure schematic diagram of embodiment of herein described element term clash handle device.As shown in figure 3,
Specifically, the apparatus may include:
Memory module 101 can be used for storing pre-set prefix character and the prefix character and customized member
The rule of combination of plain name;
Computing module 102 can be used for obtaining the customized masurium of element term conflict and the prefix character of selection, and
The new element name for generating the customized masurium is calculated according to the rule of combination;
Mapping block 103, the mapping that can be used for establishing and storing the customized masurium and the new element name are closed
System.
Element term clash handle device described herein can significantly be dropped in the customized element of reference third party
The case where low element customized element naming conflict.Also, multiple prefix characters can be set in the application device, can be open
Hair personnel provide more prefix characters and select space, and the different developers of reference are effectively reduced and name identical customized element
Add naming conflict problem caused by corresponding prefix.The frame for supporting customized page elements it is especially described above from
In the application scenarios for defining html page elements, device described herein can be third-party certainly in self-defining or reference
When definition element conflicts, prefix character to be added can be directly chosen in current application development interface, is then generated
The title of new customized element.In this way attribute information can be carried out to avoid customized masurium of the developer to naming conflict
Modification, rewriting definition are even abandoned and are used, the development efficiency of raising application programming design.It is stored in herein described device simultaneously
The mapping relations to corresponding customized masurium can be called by new element name by having, and ensured in current application Programming
Exploitation still can refer to former actual customized masurium using modified new element name.
Fig. 4 is the modular structure schematic diagram of herein described element term clash handle device another kind embodiment.Such as Fig. 4
Described, described device can also include:
Access modules 104 can be used for accessing the new element according to the mapping relations stored in the mapping block 103
Customized masurium corresponding to name.
Method described herein can be when self-defining or the third-party customized element of reference conflict, can
To call actual customized masurium by access modules access, developer can not needed again to naming conflict
Customized masurium carries out attribute information modification, rewriting definition is even abandoned and used, the development efficiency of raising application programming design.
In herein described element term clash handle device preferred embodiment, the memory module 101 be can store
Pre-set at least two prefix character.
In herein described element term clash handle device another kind preferred embodiment, the rule of combination be can wrap
It includes at least one of following:
The prefix character is added to the front position of the customized masurium;
The prefix character is added to the back-end location of the customized masurium;
The prefix character is replaced to the character of specific field in the customized masurium.
As previously mentioned, the rule of combination of the prefix character and customized element may include the prefix character
A kind of corresponding rule of combination, also may include that multiple prefix characters correspond to a kind of rule of combination, naturally it is also possible to including right
The a certain rule of combination of the same sampling of the prefix character of all settings.In general, after the prefix character and rule of combination are set,
The prefix character can have rule of combination corresponding thereto.
Fig. 5 is a kind of module knot of embodiment of mapping block 103 in herein described element term clash handle device
Structure schematic diagram.As described in Figure 5, the mapping block 103 may include:
Global object's module 1031 can be used for the global object established, make by oneself described in storage in the global object
The mapping relations of adopted masurium and the new element name.
The global object can be quoted in application scenes by global reference.Such as in customized html page member
The mapping relations of the new element name with prefix after former customized masurium and generation can be deposited into the overall situation in the environment of element
In variable, such as relation={ ' pagination ': ' paPagination ' }.
A kind of Name Conflict treating method and apparatus provided by the present application, can not only effectively reduce because of customized element
Naming conflict caused by the prefix character that naming conflict and the customized element add while naming identical is also identical
Phenomenon.And when the customized element naming conflict occur, developer can not needed to the customized of naming conflict
Element carries out former attribute information or the modification to related information, can directly be referred to by the mapping relations of foundation actual
Original customized masurium.And the application method can provide multiple prefix characters and/or multiple rules of combination, make to develop
Personnel have multiple new element name selection spaces, facilitate developer to quote operating with for customized element, reduce and solve
The processing time of naming conflict and raising application and development efficiency.
Although mentioning retouching for the data processing circumstance of html, javascript design language or the like in teachings herein
It states, still, the application is not limited to the case where must being complete standard or mentioned data handling utility environment.This Shen
Please in foregoing description involved in each embodiment be only application in some embodiments in the application, in certain others
Support the scheme that each embodiment of above-mentioned the application can also be carried out in the frame of customized page elements.Certainly, meeting this Shen
Please process method step described in the various embodiments described above other without creative deformations, identical Shen still may be implemented
Please, details are not described herein.
Although this application provides the method operating procedure as described in embodiment or flow chart, based on conventional or noninvasive
The means for the property made may include more or less operating procedure.The step of enumerating in embodiment sequence is only numerous steps
One of execution sequence mode, does not represent and unique executes sequence.It, can when device or client production in practice executes
To execute or parallel execute (such as at parallel processor or multithreading according to embodiment or method shown in the drawings sequence
The environment of reason).
Above-described embodiment illustrates device or module, can specifically be realized by computer chip or entity, or by having certain
The product of function is planted to realize.For convenience of description, it is divided into various modules when description apparatus above with function to describe respectively.When
So, the function of each module can be realized in the same or multiple software and or hardware, can also be incited somebody to action when implementing the application
Realize that the module of same function is realized by the combination of multiple submodule or subelement.
It is also known in the art that other than realizing controller in a manner of pure computer readable program code, it is complete
Entirely can by by method and step carry out programming in logic come so that controller with logic gate, switch, specific integrated circuit, programmable
Logic controller realizes identical function with the form for being embedded in microcontroller etc..Therefore this controller is considered one kind
Hardware component, and the structure that the device for realizing various functions that its inside includes can also be considered as in hardware component.Or
Person even, can will be considered as realizing the device of various functions either the software module of implementation method can be hardware again
Structure in component.
The application can describe in the general context of computer-executable instructions executed by a computer, such as program
Module.Generally, program module includes routines performing specific tasks or implementing specific abstract data types, programs, objects, group
Part, data structure, class etc..The application can also be practiced in a distributed computing environment, in these distributed computing environments,
By executing task by the connected remote processing devices of communication network.In a distributed computing environment, program module can
To be located in the local and remote computer storage media including storage equipment.
As seen through the above description of the embodiments, those skilled in the art can be understood that the application can
It realizes by means of software and necessary general hardware platform.Based on this understanding, the technical solution essence of the application
On in other words the part that contributes to existing technology can be embodied in the form of software products, the computer software product
It can store in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions are used so that a computer equipment
(can be personal computer, mobile terminal, server or the network equipment etc.) executes each embodiment of the application or implementation
Method described in certain parts of example.
Each embodiment in this specification is described in a progressive manner, the same or similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.The application can be used for crowd
In mostly general or special purpose computing system environments or configuration.Such as: personal computer, server computer, handheld device or
Portable device, laptop device, mobile communication terminal, multicomputer system, microprocessor-based system, programmable electricity
Sub- equipment, network PC, minicomputer, mainframe computer, distributed computing environment including any of the above system or equipment etc.
Deng.
Although depicting the application by embodiment, it will be appreciated by the skilled addressee that the application there are many deformation and
Variation is without departing from spirit herein, it is desirable to which the attached claims include these deformations and change without departing from the application's
Spirit.