CN102541565A - Method and device for equivalently interconverting data object and XML (Extensive Makeup Language) - Google Patents

Method and device for equivalently interconverting data object and XML (Extensive Makeup Language) Download PDF

Info

Publication number
CN102541565A
CN102541565A CN2011104607698A CN201110460769A CN102541565A CN 102541565 A CN102541565 A CN 102541565A CN 2011104607698 A CN2011104607698 A CN 2011104607698A CN 201110460769 A CN201110460769 A CN 201110460769A CN 102541565 A CN102541565 A CN 102541565A
Authority
CN
China
Prior art keywords
xml
data object
java bean
modular converter
data
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.)
Pending
Application number
CN2011104607698A
Other languages
Chinese (zh)
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.)
ZTE ICT Technologies Co Ltd
Original Assignee
ZTE ICT Technologies 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 ZTE ICT Technologies Co Ltd filed Critical ZTE ICT Technologies Co Ltd
Priority to CN2011104607698A priority Critical patent/CN102541565A/en
Publication of CN102541565A publication Critical patent/CN102541565A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

The invention provides a device for equivalently interconverting a data object and an XML (Extensive Makeup Language). The device comprises an XML-data object converting module and a Java Bean-data object converting module, wherein the XML-data object converting module is used for converting the XML into a corresponding Bean-data object, and the Java Bean-data object converting module is used for converting the Bean-data object into the XML. The invention also provides a method for equivalently interconverting the data object and the XML. According to the method and the device for equivalently interconverting the data object and the XML, provided by the invention, operations such as read-in, explanation, data extraction and the like of an XML document are simplified; and data of the XML is convenient to acquire and modify.

Description

The method and apparatus that a kind of data object and XML equivalence are changeed mutually
Technical field
The present invention relates to field of computer technology, particularly relate to the method and apparatus that the equivalence of a kind of XML data object and Java Bean object is changeed mutually.
Background technology
XML (EXtensible Markup Language, extend markup language) is of many uses at the WEB development field, is usually used in data storage file, the data sharing of reduced data storage, system configuration, the data sharing of the system integration etc.
XML has played considerable effect in system's centralized procedure, the WebService application based on soap protocol realizes the data sharing of different development language platforms; Data transmissions based on XML is carried out data interaction with some terminals such as mobile phone.
At present, in software development, when XML data object and Java Bean data object are changeed mutually, for operation more complicated such as the reading in of XML file, explanation, data extracts.
Summary of the invention
The method and apparatus that the object of the present invention is to provide a kind of data object and XML equivalence to change has mutually been simplified for operations such as the reading in of xml file, explanation, data extracts, conveniently obtains and revise the data of xml.
In order to solve above technical matters, the device that the present invention provides a kind of data object and XML equivalence to change mutually comprises: XML data object modular converter and Java Bean data object modular converter,
Said XML data object modular converter is used for converting XML to corresponding Java Bean object;
Said Java Bean data object modular converter is used for converting Java Bean object to XML.
Further, said XML data object modular converter converts XML to corresponding Java Bean object through the parserXML () method of XStream instrument.
Further, said Java Bean data object modular converter converts Java Bean object to XML through the toXML () method of XStream instrument.
In order to solve above technical matters, the method that the present invention also provides a kind of data object and XML equivalence to change mutually is characterized in that, comprising:
Confirm to want the data converted object;
According to the translation data object of confirming, select corresponding data object modular converter to change.
Further, confirm that the translation data object becomes corresponding Java Bean object for the XML data-switching, then selects XML data object modular converter.
Further, said XML data object modular converter converts XML to corresponding Java Bean object through the parserXML () method of XStream instrument.
Further, confirm that the translation data object is that Java Bean object converts corresponding XML data to, then selects Java Bean data object modular converter
Further, said Java Bean data object modular converter converts Java Bean object to XML through the toXML () method of XStream instrument.
With compared with techniques is arranged mutually; The method and apparatus that the present invention provides a kind of data object and XML equivalence to change mutually; Simplified for operations such as the reading in of xml file, explanation, data extracts; After converting the bean object of JAVA to,, conveniently obtain and revise the data of xml through getter () and setter () method.
Description of drawings
Accompanying drawing described herein is used to provide further understanding of the present invention, constitutes a part of the present invention, and illustrative examples of the present invention and explanation thereof are used to explain the present invention, does not constitute improper qualification of the present invention.In the accompanying drawings:
Fig. 1 is that the present invention provides a kind of XML data object and the equivalence of the Java Bean object structural representation of the device of commentaries on classics mutually;
Fig. 2 is that the present invention provides a kind of XML data object and the equivalence of the Java Bean object process flow diagram of the method for commentaries on classics mutually.
Embodiment
In order to make technical matters to be solved by this invention, technical scheme and beneficial effect clearer, clear,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
Conversion equipment as shown in Figure 1, that the present invention provides a kind of XML data object and the equivalence of Java Bean object to change mutually comprises XML data object modular converter and Java Bean data object modular converter, wherein,
XML data object modular converter converts the XML of String type to corresponding Java Bean object.
Java Bean data object modular converter converts Java Bean object to the XML of String type.
Specifically, the parserXML () method that XML data object modular converter can be through the XStream instrument converts the XML of String type to corresponding Java Bean object.
Specifically, Java Bean data object modular converter can convert Java Bean object to the XML of String type through the toXML () method of XStream instrument.
Conversion method as shown in Figure 2, that the present invention provides a kind of XML data object and the equivalence of Java Bean object to change mutually comprises:
Step 1, definite data converted object of wanting;
The translation data object that step 2, basis are confirmed selects corresponding data object modular converter to change, and specifically comprises:
As confirming that the translation data object becomes corresponding Java Bean object for the XML data-switching; Then select XML data object modular converter; Specifically, the parserXML () method that XML data object modular converter can be through the XStream instrument converts the XML of String type to corresponding Java Bean object.
As confirming that the translation data object is that Java Bean object converts corresponding XML data to; Then select Java Bean data object modular converter; Specifically, Java Bean data object modular converter can convert Java Bean object to the XML of String type through the toXML () method of XStream instrument.
Above-mentioned explanation illustrates and has described a preferred embodiment of the present invention; But as previously mentioned; Be to be understood that the present invention is not limited to the form that this paper discloses, should do not regard eliminating as, and can be used for various other combinations, modification and environment other embodiment; And can in invention contemplated scope described herein, change through the technology or the knowledge of above-mentioned instruction or association area.And change that those skilled in the art carried out and variation do not break away from the spirit and scope of the present invention, then all should be in the protection domain of accompanying claims of the present invention.

Claims (8)

1. the device that changes mutually of data object and XML equivalence is characterized in that, comprising: XML data object modular converter and Java Bean data object modular converter,
Said XML data object modular converter is used for converting XML to corresponding Java Bean object;
Said Java Bean data object modular converter is used for converting Java Bean object to XML.
2. device as claimed in claim 1 is characterized in that, said XML data object modular converter converts XML to corresponding Java Bean object through the parserXML () method of XStream instrument.
3. device as claimed in claim 1 is characterized in that, said Java Bean data object modular converter converts Java Bean object to XML through the toXML () method of XStream instrument.
4. data object and the XML equivalence method of changeing mutually is characterized in that, comprising:
Confirm to want the data converted object;
According to the translation data object of confirming, select corresponding data object modular converter to change.
5. method as claimed in claim 4 is characterized in that, confirms that the translation data object becomes corresponding Java Bean object for the XML data-switching, then selects XML data object modular converter.
6. method as claimed in claim 5 is characterized in that, said XML data object modular converter converts XML to corresponding Java Bean object through the parserXML () method of XStream instrument.
7. method as claimed in claim 4 is characterized in that, confirms that the translation data object is that Java Bean object converts corresponding XML data to, then selects Java Bean data object modular converter.
8. method as claimed in claim 7 is characterized in that, said Java Bean data object modular converter converts Java Bean object to XML through the toXML () method of XStream instrument.
CN2011104607698A 2011-12-31 2011-12-31 Method and device for equivalently interconverting data object and XML (Extensive Makeup Language) Pending CN102541565A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011104607698A CN102541565A (en) 2011-12-31 2011-12-31 Method and device for equivalently interconverting data object and XML (Extensive Makeup Language)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011104607698A CN102541565A (en) 2011-12-31 2011-12-31 Method and device for equivalently interconverting data object and XML (Extensive Makeup Language)

Publications (1)

Publication Number Publication Date
CN102541565A true CN102541565A (en) 2012-07-04

Family

ID=46348538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011104607698A Pending CN102541565A (en) 2011-12-31 2011-12-31 Method and device for equivalently interconverting data object and XML (Extensive Makeup Language)

Country Status (1)

Country Link
CN (1) CN102541565A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102891892A (en) * 2012-09-28 2013-01-23 用友软件股份有限公司 Additional information carrying device and method for service-oriented architecture system
CN106886390A (en) * 2015-12-15 2017-06-23 大唐软件技术股份有限公司 A kind of Java object generation and conversion method and Java object generation and conversion equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050262135A1 (en) * 2004-05-21 2005-11-24 Bea Systems, Inc. Systems and methods for EJB finders using SQL
CN101957758A (en) * 2010-10-14 2011-01-26 上海普元信息技术股份有限公司 Method for realizing rapid Web Service publishment in service oriented architecture application systems

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050262135A1 (en) * 2004-05-21 2005-11-24 Bea Systems, Inc. Systems and methods for EJB finders using SQL
CN101957758A (en) * 2010-10-14 2011-01-26 上海普元信息技术股份有限公司 Method for realizing rapid Web Service publishment in service oriented architecture application systems

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JKORDEIRO: "ParserXML.java", 《HTTP://CODE.GOOGLE.COM/P/DEIBAY/SOURCE/BROWSE/TRUNK/DEIBAY-SHARE/DEIBAY/UTIL/PARSERXML.JAVA?SPEC=SVN59&R=59》 *
最爱树袋熊: "使用 XStream 在 JavaBean 与 XML JSON 之间相互转换", 《HTTP://LININGHEBE.ITEYE.COM/BLOG/469561》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102891892A (en) * 2012-09-28 2013-01-23 用友软件股份有限公司 Additional information carrying device and method for service-oriented architecture system
CN106886390A (en) * 2015-12-15 2017-06-23 大唐软件技术股份有限公司 A kind of Java object generation and conversion method and Java object generation and conversion equipment

Similar Documents

Publication Publication Date Title
CN101567065B (en) Cross-platform online file editing system and method thereof
CN102163233A (en) Method and system for converting webpage markup language format
CN104484216A (en) Method and device for generating service interface document and on-line test tool
CN104680421B (en) A kind of saleable vector graphics SVG display methods and device
CN103474068A (en) Method, equipment and system for implementing voice command control
CN103078958A (en) Real-time monitoring supervising method for WEB mode of power SCADA (Supervisory Control And Data Acquisition) on basis of combining SVG (Scalable Vector Graphics) with RIA (Rich Internet Application)
CN105183759A (en) Picture commenting method and apparatus
CN102298575A (en) Method and system for copying and pasting Word file content with format
CN103235718A (en) Method and device for generating remote procedure call (RPC) code
CN103702162A (en) Remote control method and system as well as TV terminals
CN106528184A (en) App development method based on cordova platform
CN109710140A (en) A kind of smart phone social application automatic data collection method
CN109116828A (en) Model code configuration method and device in a kind of controller
CN105701153B (en) Method and device for reading webpage resources and electronic equipment
CN103605514A (en) Front-end template processing method and device
CN107222461B (en) Communication processing method and device
CN102186114B (en) ETL (Extraction Transformation and Loading) based digital television interactive application middleware
CN102541565A (en) Method and device for equivalently interconverting data object and XML (Extensive Makeup Language)
CN103984539A (en) Operation method and operation system for household appliance
CN103902539A (en) Method and device for analyzing extensible markup language data
CN102624876A (en) Data configuration method and data configuration device
CN104750468A (en) Server side topological data conversion method and device
CN103294463A (en) Editing system and method
CN102722367B (en) A kind of method of data processing, processor and terminal
CN102004633A (en) Method and device for processing control property

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120704