CN1513145A - System and method of mapping between software objects and structure languige element-based documents - Google Patents

System and method of mapping between software objects and structure languige element-based documents Download PDF

Info

Publication number
CN1513145A
CN1513145A CNA018233392A CN01823339A CN1513145A CN 1513145 A CN1513145 A CN 1513145A CN A018233392 A CNA018233392 A CN A018233392A CN 01823339 A CN01823339 A CN 01823339A CN 1513145 A CN1513145 A CN 1513145A
Authority
CN
China
Prior art keywords
file
key element
xml
structured language
software object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CNA018233392A
Other languages
Chinese (zh)
Other versions
CN1313953C (en
Inventor
迈克尔·拜西格尔
H
构翰·H·格林
W���ַƶ���
杰伊·W·沃菲尔德
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.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
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 International Business Machines Corp filed Critical International Business Machines Corp
Publication of CN1513145A publication Critical patent/CN1513145A/en
Application granted granted Critical
Publication of CN1313953C publication Critical patent/CN1313953C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • G06F40/143Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • G06F40/154Tree transformation for tree-structured or markup documents, e.g. XSLT, XSL-FO or stylesheets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/226Validation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)
  • Document Processing Apparatus (AREA)

Abstract

A method and system that provides a common framework for mapping between a document (e.g. an XML document) and a software object (e.g. a Java object). The framework uses a handler that masks how a property is obtained for mapping. This results in mapping code that has a common appearance for both directions of mapping. A mapping between elements of an XML document and the properties of a Java object is contained in a mapper. A mapper maps from the XML document (108) to an object (110) using a parser (104) (such as DOM or SAX). Mapping in the other direction (Java to XML) requires that the elements of the XML document (118) be built in a particular order to ensure validity of the resulting XML document (118). The present invention builds an XML template document using JSP, for example. Using JSP based templates enables tags of the document to be written in the JSP, with callbacks to get element and attribute values. Further, content can be directed to a buffer, or directly to a response stream of a servlet.

Description

The system and method that between software object and file, shines upon based on the structured language key element
Technical field
The present invention relates to conversion or mapping field between the file of software object and structured language key element, especially relevant to Java TMMapping between the various software objects of object and extend markup language (XML) file.
Background technology
Extend markup language (XML) is to aim at web page files and the standard that designs produces the bowdlerized version of SGML (SGML).It allows the deviser can create oneself customized tag, and the function that provides HTML to provide.For example, link the html link that only can quote a file with respect to each, XML supports to point to the link of multidocument.
Because XML is a kind of self-description data forms of (in the present invention describes, also being called the structured language key element), so can be used for the code of enhanced data model.Therefore, XML can be used as the exchanges data medium between different system.Such as the cobol program of leaving over, database, C++ program and so on data can XML open or announcement in the system of many types.A commercial problem that generally meets with comprises: how with information from the XML File mapping to other data layout, and contrary operation, for example, in case between the example of XML file layout, exchanged information, then might need its information mapping is become the Java object, when carrying out database or transactional request, can be used.
A kind of example of XML/Java crossover tool is disclosed in the people's such as Meltzer that on September 26th, 2000 announced the United States Patent (USP) 6,125,391.In order to convert Java to from XML, people's Analysis of X ML file and firing events such as Meltzer.Particularly, analyzer traversal XML file, and in storer, set up tree represenation, for inquiry usefulness, and another analyzer travels through the XML file, and (for example, begins file event with the information firing event of relevant this document; Has the key element title, the beginning key element incident of factor content, closure element incident, ends file incident etc.).
In order to convert XML to from Java, people such as Meltzer produce the code of the memory access that comprises each key element.The memory access of key element comprises circulation, with each character circulation primary.This circulation comprises switch statement, carries out action why according to this character.This action is for setting up the StringBuffer of the key element fragment that comprises the XML file.People's such as Meltzer solution does not provide the support that Java is changed into the code of XML to handling.In people's such as Meltzer the practice, all codes all are generated, and the user is not easy editor.
As a result, need a kind of in order to the support software object and based on the mapping framework of the mapping between the file (for example XML) of structured language key element, wherein this framework can use tool master to be realized efficiently.
Summary of the invention
The shortcoming of the prior art that more than gathers can be overcome according to demonstration methods of the present invention and system, and common frame wherein is provided, and uses for the mapping between file (for example XML file) and software object (for example Java object).This framework uses processor to cover how getattr uses for mapping.So cause the two-way mapping code that mapping has common appearance of going up.Mapping between the attribute of the key element of XML file and Java object is contained in the mapper.Mapper by use ((SAX)) analyzer such as the document dbject model (DOM) of XML or simple application programming interfaces (API) from the XML File mapping to software object.
The mapping (Java to XML) of other direction requires to create with particular order the key element of XML file, with the validity of the XML file of guaranteeing the result.For example, in order to ensure this kind validity, the embodiment of demonstration of the present invention uses JavaServer Pages TM(JSP) create the XML template file.Use can be write file label with JSP based on the template of JSP, and this JSP has the readjustment of key element of obtaining and property value.JSP supports the documentation of complete ground, drawing template establishment efficiently with editing machine.Moreover, the content directed at buffer perhaps directly can be pointed to the response flow of servlet.
According to an aspect of the present invention, provide a kind of data structure that will represent software object to convert the computer implemented method of the structured language key element of file to, this method comprises: (a) generating structure language elements template file; (b) read attribute from software object, these attributes are related with the structured language key element of file; (c) use these attributes, according to related the obtaining between attribute and structured language key element by the defined member of structured language key element; And (d) with these member interstitital texture language elements template files.
According to a further aspect in the invention, provide a kind of and convert the structured language key element of file the computer implemented method of the data structure of representing software object to, this method comprises: each the structured language key element that (a) reads file; (b) from one group of defined available attributes of the data structure by software object, select, determine the attribute related with the structured language key element of file; And (c) to fill the attribute of the data structure of representing software object from the structured language key element value of file.
According to a further aspect in the invention, provide a kind of software object that will comprise attribute to convert system by the defined file of structured language key element to, this system comprises: (a) file template; (b) processor interface, it provides the expression of its structured language key element of file according to the readjustment of file template; (c) mapping block communicates with processor interface, the structured language key element that becomes file to discern the property transformation of software object; And (d) export target class, communicate with mapping block, the structured language key element that is produced in the step (c) is write in the file.
According to a further aspect in the invention, provide a kind of file conversion that will comprise the structured language key element to become the system of software object, this system comprises: (a) analyzer, in order to obtain the incident of representation file characteristic; (b) input source class is in order to read file; (c) content handler class, itself and input source class communicate, in order to the impact damper of realizing using for the incident that analyzer obtained; And (d) mapping block, itself and content handler class communicate, and the incident that analyzer obtained are converted to the attribute of software object.
According to a further aspect in the invention, provide a kind of software object that will have attribute to convert the method for the file of representing with the structured language key element to, this method comprises: the example that (a) software object is offered the Map Interface that is called; (b) use the example of the container that is called to compile and carry out template; And (c) use template that this document is write specific output stream through compiling.
According to a further aspect in the invention, provide a kind of file conversion that will comprise the structured language key element to become the method for software object, this method comprises: (a) with the be called example of Map Interface of file supply; (b) Map Interface is registered as content handler; (c) use the instance analysis file of the analyzer that is called; And (d) fill software object with the attribute related with the structured language key element of coming from this document analysis by the readjustment Map Interface.
According to a further aspect in the invention, provide a kind of data structure that will represent software object to convert the computer program of the structured language key element of file to, this computer program comprises the computer readable program code device as following purposes: (a) generating structure language elements template file; (b) read attribute from software object, these attributes are relevant with the structured language key element of this document; (c) use these attributes, according to related the obtaining between attribute and structured language key element by the defined member of structured language key element; And (d) with these member interstitital texture language elements template files.
According to a further aspect in the invention, provide a kind of and convert the structured language key element of file the computer program of the data structure of representing software object to, this computer program comprises the computer readable program code device as following purposes: each the structured language key element that (a) reads file; (b) from one group of defined available attributes of the data structure by software object, select, determine the attribute related with the structured language key element of file; And (c) to fill the attribute of the data structure of representing software object from the structured language key element value of file.
After also reading the description of following embodiments of the invention in conjunction with the accompanying drawings, it will be appreciated by those skilled in the art that others of the present invention and characteristic.
Accompanying drawing is described
Further characteristic of the present invention and advantage will be in conjunction with the accompanying drawings, in detailed description, described, wherein:
Fig. 1 is the calcspar of computer system, and this computer system can be in order to realize the method and the device of the embodiment of the invention;
Fig. 2 is a calcspar, and wherein diagram is for the framework that shines upon between XML and Java object and contrary operation is used;
Fig. 3 is a process flow diagram, and wherein diagram uses the framework of Fig. 2 with the method for XML File mapping to software object; And
Fig. 4 is a process flow diagram, and wherein diagram uses the framework of Fig. 2 software object to be mapped to the method for XML file.
Embodiment
The representative of Fig. 1 and associated description can realize the example of suitable computing environment of the present invention.Though the present invention will be described with the computer executable instructions of the computer program carried out on the personal computer haply, the present invention equally can with the realization that combines of other program module.
Generally speaking, program module comprises: in order to carry out special duty or to realize the routine of special abstract data type, program, key element, data structure and so on.The present invention can further use and comprise handheld apparatus simultaneously, multicomputer system, and based on microprocessor or programmable consumer electronics, small-size computer, other computer system configurations of mainframe computer and so on is realized.The present invention can implement in distributed computing environment simultaneously, and this computing environment is by executing the task by the teleprocessing device of telecommunication network link.In distributed computing environment, program module can be arranged in server and long-range memory storage apparatus.
With reference to Fig. 1, demonstration system 10 comprises: existing personal computer 20, wherein comprise processing unit 22, and system storage 24 and system bus 26, this system bus various system components that are coupled comprise coupled system storer 24 and processing unit 22.System bus 26 comprises the bus structure of several types, comprises memory bus or Memory Controller, peripheral bus, and use the local bus of any bus architecture of various existing bus architectures (for example PCI, VESA, ISA, EISA etc.).
System storage 24 comprises ROM (read-only memory) (ROM) 28 and random-access memory (ram) 30.Basic input/output (BIOS) 32 is stored among the ROM 28, and it is included in the basic routine of during starts assisting transmission information at the inter-module of computing machine 20.Computing machine 20 comprises hard disk drive 34 simultaneously, disc driver 36 (in order to read and to write movable disk 38) and CD drive 40 (in order to read CD-ROM dish 42, perhaps reading or write other optical medium).Drive 34,36 and 40 and be connected to system bus 26 by interface 44,46 and 48 respectively.
Drive 34,36 and 40 and associated computer-readable media (38,42) provide computing machine 20 data, the non-volatile memories of data structure and computer executable instructions.The storage medium of Fig. 1 only as an example, and those skilled in the art is known: still comprise other type media that (for example cassette disk, flash card, digital video disks etc.) can be read by computing machine.
Comprise operating system 50, one or more application programs 52, some program modules of other program module 54 and routine data 56 be stored in drive 34,36 and 40 and RAM 30 in.The user can will instruct and information input computing machine 20 by keyboard 58 and input media 60 (for example: mouse, microphone, rocking bar, game mat, satellite dish antenna, scanner etc.).These devices (58 and 60) are connected to processing unit 22 by the port interface 62 that is coupled to bus 26 (for example serial port, parallel port, game port, USB (universal serial bus) (USB) etc.).The display device of monitor 64 or other type is connected to bus 26 by interface 66 (for example video converter) equally.
Computing machine 20 can use logic to be connected to one or more remote computers such as remote computer 68, operates in the network type environment.Remote computer 68 can be server, router, and same stage arrangement, perhaps other network node commonly used, and generally include the relevant many or all component of described above and computing machine 20, however for simply, only the display-memory memory storage 70.Logic shown in Figure 1 connects and comprises server network (LAN) 72 and Wide Area Network (WAN) 74.This class network environment generally is used for office, full enterprise computer network, enterprise network and the Internet.
When being used for the lan network environment, computing machine 20 is connected to LAN 72 by network interface or converter 76.When being used for the WAN network environment, computing machine 20 generally includes for modulator-demodular unit 78 or other device set up such as communication usefulness on the WAN 74 of the Internet.May be that inside or outside modulator-demodular unit 54 are connected to bus 26 by port interface 62.In the network type environment, described computing machine 20 relative program modules or wherein the part can be stored in the remote memory storage device 70.
The discussion of method of the present invention is based on from XML to Java object and the conversion/aspects such as mapping from the Java object to XML.Support other data layout simultaneously.For example, many business applications of leaving over are with COBOL, and C and PL1 write.These application programs are by residing at such as CICS TM(gpio line transaction processing software) or IMS TMProgram in the enterprise information systems (EIS) such as (information management systems) is formed.The COBOL structure is used in the input of cobol program and output.So need from XML to COBOL and from the mapping of COBOL to XML.The present invention can be used to carry out these mappings, wherein (discussed below) XML will fill the COBOL structure from the XML file to the mapping processor of object X, and the mapping processor of (discussed below) object X to XML will be from COBOL structure extracted data, and is made by template and to be used for filling the XML file.
As a setting, mapping method of the present invention utilizes following advanced processes: (a) the vocabulary device can be by the word or the marker character (being called marker characterization) of special system identification with the character composition; (b) analyzer analysis marker character in groups is so that discern legal language member; And (c) code generator is obtained the language member of a combined method, and generates executable code.Can be mixed by (a)-(c) defined function.
For example for the mapping from XML to Java object, each character in the XML file is all analyzed, so that identification is such as beginning label, attribute, the XML tag symbol that end-tag and " CDATA " section etc. are legal.Then, must form legal XML member by the verification mark symbol.On the most basic level, will verify: the underlined opening and closing label that all has coupling, and attribute all suitably builds on and opens under the label.If document type definition (DTD) or XML pattern can be used, the XML member that then may be able to determine during analyzing be found is legal aspect DTD or XML pattern, is the complete XML of form simultaneously.At last, the data that comprise in the XML file will be used for finishing useful thing (promptly mapping to the Java object).
Some task already pointed out to small part can be carried out by existing XML analyzer.The XML analyzer is handled the task of lexical analysis and grammatical analysis.Two examples of grammatical analysis standard are: SAX and DOM APIs (the simple application DLL (dynamic link library) (API) of SAX-XML; The DOM-document dbject model).
SAX is based on incident.Realize the incident of the XML analyzer generation of SAX corresponding to the different qualities that finds in the XML file of being analyzed.DOM API is the API based on object model.The XML analyzer of realization DOM is created common object model in storer, represent the content of XML file.In case after the XML analyzer is finished analysis, will comprise the DOM object tree in the storer, in order to structure and the two kinds of information of content about this XML file to be provided.
Fig. 2 is the synoptic diagram of framework 100 according to an embodiment of the invention.Framework 100 specifically is shown in the integrated package 102 such as Servlet that can carry out in Fig. 1 system 10.Integrated package 102 comprises the analyzer 104 that for example uses DOM or SAX to be realized, itself and XML-object map module 106 are carried out interaction.For clear, when describing realization embodiment of the present invention, will be discussed as the example of analyzer 104 with SAX.
XML-object map module 106 receives the XML file 108 of input, and produces the Java object 110 of output.Integrated package 102 further comprises (for example according to JavaServer Pages TM-JSP technology) XML file template module 112, itself and object-XML mapping block 114 communicate.Object-XML mapping block 114 receives the Java object 116 of input, and produces the XML file 118 of output.
XML is to the mapping of software object
With reference to Fig. 2, XML-object map module 106 comprises following assembly:
(a) input source class 106-1 (XML2xInputSource) is in order to realize the XML file 108 of input;
(b) buffer content processor class 106-2 (XML2xBufferedContentHandler) is in order to the impact damper of realizing using for the SAX incident that analyzer 104 is produced;
(c) Map Interface 106-3 (XML2xMapping) shines upon in order to carry out, and sets the input and output object flow; And
(d) mapping class 106-4 (XML2xMappingImpl), it provides the method that maps to the Java object 110 of output from the XML file 108 of input.
The further details of various interface and class below is discussed.In Java, " class " and " interface " two nouns have certain sense.The class of Java (abstract, inner or final) is the data member of definition special object and the set of method, and the interface of Java then is used for stipulating certain function (that is the essential thing of doing of interface specified class) on the class that realizes this interface.Interface is simultaneously in order to provide the spendable constant of class of realizing this interface.Interface comprises constant variables and method statement, but the class that realizes this interface is then left in the realization of method for.Class can realize the interface of arbitrary number.
Table M106-1 gathers the main function (promptly all not listing) of input source class 106-1 (XML2xInputSource).
Use XML2xInputSource can be from byte stream, reads the XML file among character stream or the XML2xBuferedContentHandler 106-2.
Table M106-1
Function Describe
Available () Return the byte number that can from inlet flow, read with blocking.
GetBufferedHandler () Obtain the processor of the buffering of SAX incident
GetByteStream () Return byte stream
GetCharacterStream () Return character stream reader
Read () The following byte of reading of data from this inlet flow
Skip () From this inlet flow, cross over the byte of input
Table M106-2 gathers the main function (promptly all not listing) of buffer content processor class 106-2 (XML2xBufferedContentHandler).Processor class 106-2 comprises content handler simultaneously, in order to the SAX incident of buffering from analyzer 104.So permission incident regeneration.Can use the example of this characteristic to be: the different piece of XML file is used different mapping processor.Simple object Access Protocol (SOAP) is the realization example.
Table M106-2
Function Describe
Characters (char[] ch, int start, int length); The method annotations and comments, wherein ch is the character from XML file 108; Start is the starting position in the array; The number of characters of length for from array, reading.
Parse () Carry out the SAX incident in the impact damper
SOAP is the lightweight protocol of using for exchange message in the nonconcentrated distributed environment.It is a kind of agreement based on XML, is made up of three parts: seal (1), and why definition frame reaches in order to describing message and how to handle; (2) one group coding rules are in order to the example of the data type of expressing the application program definition; And (3) agreement, in order to represent remote procedure call and response.Soap message is the XML file, is wherein sealed by essential SOAP, and optionally SOAP head and essential SOAP main body are formed.In the case, seal with main body and might use different mapping processor.
Table M106-3 gathers the main function (promptly all not listing) of Map Interface 106-3 (XML2xMapping).XML2xMapping carries out mapping, and allows the configuration of InputStream.
Table M106-3
Function Describe
Execute () The mapping of form is created in execution from the XML file 108 of input.The complete example of execute () below is provided.
SetInputStream () Setting inlet flow-promptly, specify the source of the input XML file 108 that is shone upon.
Table M106-4 gathers the main function (promptly all not listing) of mapping class 106-4 (XML2xMappingImpl).Discussion as the definition of above related genera and interface, the XML2xMappingImpl class is directly used, but, increase content and obtain subclass to proper method according to the document type definition of the input XML file 108 of the output Java object 110 that is shone upon and desire mapping.
Table M106-4
Function Describe
EndElement () Receive the end notification of key element.Analyzer 104 will the end of each key element call the method in input XML file 108.Even when key element is empty key element, each endElement still has corresponding startElement () incident.
Execute () The mapping of form is created in execution from input XML file 108.
SetDocumentLocator () Receive object for the origin usefulness of location SAX file event.
SetInputStream () Set inlet flow.Specify the source of the XML file of desire mapping.
StartElement () Receive the notice that begins of key element.The method is called at the place that begins of analyzer 104 each key element in input XML file 108.Even when key element is empty key element, each startElement () incident still has corresponding endElement () incident.Before the endElement of correspondence () incident, all factor contents are all reported in regular turn.
With reference to Fig. 3, graphic technique 300 wherein shows XML file 108 is mapped to the performed roughly step of software object 110 (for example Java Bean):
(a) in step 302, obtain for the example of realizing mapping to the Map Interface 106-4 (for example XML2XMapping) that object X uses from XML;
(b) in step 304, call Map Interface 106-4, and input XML file 108 is provided in step 306;
(c) Map Interface 106-4 obtains the example of event analysis device (for example analyzer 104) in step 308, and registration Map Interface 106-4 is content handler (for example buffer content processor class 106-2) in step 310;
(d) in step 312, on XML file 108, call analyzer 104 (promptly beginning to analyze this document);
(e) when execution in step (d), readjustment Map Interface 106-4 in step 314 is to call the whole bag of tricks (for example startDocument, startElement, characters, endElement, endDocument or the like);
(f) in step 316, Map Interface 106-4 creates software object 110 in startDocument and/or startElement method; And
(g) in step 318, Map Interface 106-4 is set in this key element in the software object 110 in the endElement method.
SAX API discussed above comprises the specification that many prior aries are known.The present invention relates to create the class for realizing that " ContentHandler " interface is used, this " ContentHandler " interface is: when finding the SAX incident in the XML file, the XML analyzer is in order to the callback interface of advising process.This interface and XML2xBufferedContentHandler class 106-2 and XML2xInputSource class 106-1 also use.SAX API provides the " DefaultHandler " of " ContentHandler " interface to realize class simultaneously.Below the example I " XML-JAVA CUSTOME R " of Xiang Shuing is expanded " DefaultHandler ", produces client Java Bean from client XML file.
Example I
XML-JAVAC?USTOMER
Below (detailed description) content be the part of example I:
(A) customer.xml: the sample of input XML file 108;
(B) XML2CustomerMapping.java: the processor class 106-2 of analyzer 104 readjustments.It comprises for the instruction of setting up client's object and setting up its value usefulness.
(C) execute.java: map to Java and (as following example II) from XML and map to mapping class/interface 106-3 of XML, the program of 106-4 from Java in order to carry out;
(D) customer.java: the client Java Bean 110 of output; And
(E) CustomerSymbols.java: comprise integer constant and Hash mapping.Hash mapping is in order to bookmark name is mapped to the integer constant of using among the XML2CustomerMapping.java.
The XML file (customer.xml) of input is provided A..
∥START?customer.xml
<?xml?version=”1.0”?>
<customer>
<FirstName>Jane</FirstName>
<LastName>Doe</LastName>
<CustId>xyz.123</CustId>
</customer>
∥FND?customer.xml
B. provide below in order to set up client's object and to set the program (XML2CustomerMapping.java) of its value, wherein will delete to some extent for the sake of clarity.
∥START XML2CustomerMapping.java    public class XML2CustomerMapping extends    com.xxx.xml2xmapping.XML2xMappinglmpl{      private StringBuffer fieldCurrent()ualifiedElementName=new    StringBuffer(““);        private Customer fieldCustomer;        private Stack elementStack;       *XMLCustomerInfo2RecordCustomerInfoMapper constructor comment.       public XML2CustomerMapping(){         super();         elementStack=new Stack();       }       *characters method comment.       public void characters(char[]ch,int start,int length)throws       org.xml.sax.SAXException{         switch(this.fieldCurrentElementSymbol){         case CustomerSymbols.CUSTOMER_FIRSTNAME:         case CustomerSymbols.CUSTOMER_LASTNAME:         case CustomerSymbols.CUSTOMER_ID:         ((StringBuffer)elementStack.lastElement()).append(ch,start,length);         break;         }       }       *endElement method comment.       public void endElement(String namespaceURI,String localName,       String rawName)throws org.xml.sax.SAXException{         String symbolName;<!-- SIPO <DP n="11"> --><dp n="d11"/>    if(namespaceURI.equals(““))symbolName=rawName;    else symbolName=namespaceURI+“_”+localName;    this.fieldCurrentElement Symbol=    CustomerSymbols.getSymbol(symbolName);    ∥Get the value    String value=    ((StringBuffer)elementStack.pop()).toString();      switch(this.fieldCurrentElementSymbol){        case CustomerSymbols.CUSTOMER_FIRSTNAME:{          this.fieldCustomer.setFirstName(value);          break;        }        case CustomerSymbols.CUSTOMER_LASTNAME:{         this.fieldCustomer.setLastName(value);           break;        }        case CustomerSymbols.CUSTOMER_ID:{          this.fieldCustomer.setId(value);          break;        }      }      this.fieldCurrentElementSymbol=0;    }    *@return com.xxx.connector.mapping.xml.test.Customer    public Customer getCustomer(){<!-- SIPO <DP n="12"> --><dp n="d12"/>      return this.fieldCustomer;    }    *startElernent method comment.    public void startElement(String namespaceURI,String localName,StringrawName,org.xml.sax.Attributes atts)throws    org.xml.sax.SAXException{      String symbolName;      if(namespaceURI.equals(““))symbolName=rawName;      else symbolName=namespaceURI+“_“+localName;       this.fieldCurrentElementSymbol=      CustomerSymbols.getSymbol(symbolName);      elementStack.push(new StringBuffer());      switch(this.fieldCurrentElementSymbol){         case CustomerSyxribols.CUSTOMER:{                this.fieldCustomer=new Customer();                break;         }      }    }    }    ∥END XML2CustomerMapping.java
C. provide below in order to carry out from XML map to Java (and such as the following example II detailed description from Java to XML) program (execute.java), wherein will delete to some extent for the sake of clarity.
∥ START execute.java<!--SIPO<dP n="13">--<dp n="d13"/>Package com.xxx.xml2xmapping.sample.customer; Import java.io.*; Import org.xml.sax.*; Public class Execute{ * Execute constructor comment. public Execute () { super (); * Starts the application. * @param args an array of command-line arguments public static void main (java.lang.String[] args) int numIterations=1; XML2CustomerMapping inMapping=new XML2CustomerMapping (); Customer2XMLMapping outEventBasedMapping=new Customer2XMLMapping (); ∥ Create the XML2Customer handler and the Customer2XML handler XML2CustomerMapping in Mapping=new XML2CustomerMapping (); Customer2XMLMapping outEventBasedMapping=new Customer2XMLMapping (); ∥ read in the customer.xml file ByteArrayInputStream inStream=null; Try{ FileInputSyteam fileInputStream=new FileInputStream (" customer.xml "); Byte[] bytes=new byte () [fileInputStream.available ()]; FileInputStream.read (bytes, 0, fileInputStream.available ()); InStream=new ByteArrayInputStream (bytes); Catch (Exception e) { e.printStackTrace (); }<!--SIPO<dP n="14">--<dp n="d14"/>ByteArrayOutputStream outStream=new ByteArrayOutputStream (); Try{ long ts=System.currentTimeMillis (); For (int 1=(); I<numIterations; I++) { ∥ inbound mapping ∥ map from XML document to customer Java Bean inStream.reset (); InMapPing.setInputStream (inStream); InMapping.execute (); ∥ some execution, here a connector would be called ∥ get the customer object and print its contents Customer aCustomer=inMapping.getCustomer (); System.out.println (" First name from XML document is "+aCustomer.getFirstName ()); System.out.println (" Lame name from XML documentis "+aCustomer.getLastName ()); System.out.println (" Customer idfrom XML documentis "+aCustomer.getId ()); ∥ Change the values on the customer object aCustomer.setFirstName (" James "); ACustomer.setLastName (" Bond "); ACustomer.setId (" 007 "); ∥ outbound mapping ∥ map from Java to XML outEventBasedMapping.setCustomer (aCustomer); ∥ outEventBasedMapping.setOutputStream (outStream); OutEventEasedMapping.setOutputStream (System.out); OutEventBasedMapping.execute (); Long te=System.currentTimeMillis (); System.out.println (" Average time " ten (te-ts)/numIterations+ " ms. "); Catch (Exception e)<!--SIPO<dP n="15">--<dp n="d15"/>E.printStackTrace (); ∥ END execute.java
D. the following client Java Bean (customer.java) that describes in detail.Java Bean is the Reusable Components that meets the standard design system of prior art.Perhaps as seen perhaps sightless class object term of execution that Bean being.JavaBean provides the assembly system, i.e. the standard card cage of using for developer component.
∥START customer.java    package com.xxx.xml2xmapping.sample.customer;    public class Customer{      private java.lang.String fieldFirstName=new String();      private java.lang.String fieldLastName=new String();      private java.lang.String fieldId=new String();    *Customer constructor comment.    public Customer(){      super(),    }    *Gets the FIRSTNAMEproperty (java.lang.String)value.    *@return The FIRSTNAMEproperty value.    *@see#setFirstName    public java.lang.String getFirstName(){      return fieldFirstName;    }    *Gets the id property(java.lang.String)value.    *@return The id property value.    *@see#setId    public java.lang.String getId(){      return fieldId;    }    *Gets the lastName property(java.lang.String)value.    *@return The lastName property value.    *@see#setLastName    public java.lang.String getLastName(){      retum fieldLastName;    }    *Sets the firstName property (java.lang.String)value.    *@param firstName The new value for the property.    *@see#getFirstName<!-- SIPO <DP n="17"> --><dp n="d17"/>    public void setFirstName(java.lang.String firstName){      fieldfirstName=firstName;    }    *Sets the id property(java.lang.String)value.    *@paramid The new value for the property.    *@see#getId    public void setId(java.lang.String_ID){      fieldId=id;    }    /**    *Sets the lastName property(java.lang.String)value.    *@param lastName The new value for the property.    *@see#getLastName    public void setLastName(java.lang.String lastName){       fieldLastName=lastName;    }    }    ∥END customer.java
As shown in example I, because handling all, analyzer 104 begins, the incident of key element and end-tag, and then the tracking of the incident of improvement will be very efficient so map to Java from XML.
As a further example, consider with single client XML file extent to be client's array.Desire produces the array of client java bean, please follow following program:
(i) use the startElement of Customers to create vector;
(ii) in the startElement of each Customer, create the Customer object; And
(iii) with FirstName, LastName, startElement with CustID, getElement, the endElement incident is filled the Customer object, uses the endElement of Customer that the Customer object is inserted in the vector, and the endElement that uses Customers, create the Customers array from vector, and be set in operated Java object.
Analyzer 104 is safeguarded XML structure (that is, the XML key element of the tabulation of the representative tabulation) usefulness of storehouse for recurrence.Each startElement all creates object.This storehouse can be according to requiring in order to reserved state.In case after creating sub-key element, then can be set in its parent object.
Software object is to the mapping of XML
With reference to Fig. 2, object-XML mapping block 114 comprises following assembly:
(a) processor interface 114-1 (X2XMLHandler) is in order to the administrative analysis incident;
(b) Map Interface 114-2 (X2XMLMapping) shines upon in order to carry out, and sets export target stream;
(c) mapping class 114-3 (X2XMLMappingImpl), it provides in order to map to the method for output XML file 118 from input Java object 116; And
(d) export target class 114-4 (X2XMLOutputTarget) is in order to realize the XML file 118 of output.
The main function (promptly all not listing) of table M114-1 aggregation process device interface 114-1 (X2XMLHandler).Mapping block 114 is realized interface 114-1, and at JSP container registration example.For such as the beginning and the end of key element and obtain basic incidents associated with the file such as key element value, file template 112 will be adjusted back mapping block 114.
Table M114-1
Function Describe
GetElementValue () Return the value of key element.Be used for when with simple types when operation in beginning and closure element label range not.
EndElement () Receive the end notification of key element.When operating, in order to maintenance state with complicated type.
GetElementAttribute () Return the property value of appointment.Be used for when the time with the operation of the complicated type in beginning and closure element label range.
GetElementRepetitions () For repeating key element, the number of repetition will be returned.
IsOptionalAttributePresent () If optional attribute is then returned the true " of ", otherwise return the pseudo-" of ".This is used for XML file template (JSP) 112, in order to be controlled in title and the value that whether produces optional attribute in the XML file 118.Be used for when the time with the operation of the complicated type in beginning and closure element label range.
StartElement () Receive the notice that begins of key element.When operating, in order to maintenance state with complicated type.
Usually, container is to provide life cycle management to assembly, safety, the example of deployment and execution time service.There is the container (webpage, JSP, servlet, applet or the like) of many particular types can provide assembly distinctive service.The Servlet container is a kind of providing services on the Internet, with request of transmitting and response, and the container of decoding request and formatted response.The JSP container is a kind ofly to provide the container as the same services of servlet container to add a kind of engine of the JSP page being explained and is treated to servlet.
X2XMLHandler 114-1 provides the mirror image (but being not the same) of the analysis incident that analyzer 104 born results.In fact, the structure that is provided by analyzer 104 is the mirror image in the path from X2XML.
When using SAX to realize analyzer 104, incident is received by the processor 106-2 of processing events (that is, being actually callback mechanism).In this example, processor 106-2 is in order to fill java class.
When calling template 112, will adjust back X2XMLHandler interface 114-1.The data that processor 114-1 asks by obtaining and the state of maintenance analysis are handled readjustment.
Though processor interface 114-1 is similar in the performed various function aspects of XML-object map module 106, still has some difference.The key element title be generate or manually write, rather than take from and have the pattern that " name space " supports.Each key element can have unique key element title.Therefore, startElement and endElement method only need name parameter.
When XML-object map module 106 was carried out mapping, input source class 106-1 (being the XML reader) returned the key element title with character string.At mapping class/interface 106-3, among the 106-4, the key element title is equipped with unique numeral.This numeral is used for switch statement, handles for controlling element and uses.In object-XML module 114, handle optimisedly, and coding is auxiliary by the key element title being defined as integer constant and being improved.Therefore, the readjustment of these methods uses integer constant but not character string.
The information order of the incident order reflection object 116 among the processor interface 114-1 itself.
(writing with JavaServer Pages technology) XML file template 112 uses the following coding style that describes in detail.The JSP technology generates user interface separates with content, thereby can need not change the dynamic content of bottom when changing the overall page layout.Prior art is known, and JavaServer Pages is the expansion of Java Servlet technology.
XML file template 112-JSP coding style example
Beginning and end-tag and complicated type coding readjustment for file 118.But so allow processor 114-1 maintenance state.In JSP XML file template 112, also direct coding begins and end-tag, so that with its definite object output stream.When operating with simple types, the readjustment of need not encoding, but still need coding beginning and end-tag, so that with its definite object output stream.
If complexity or simple types are optionally, then use isOptionalElementPresent () among the conditional clause in the template 112, whether produce optional key element in order to control.
If attribute is optionally, then uses isOptionalAttributePresent (intelementName) in the complicated type, and use isOptionalAttributePresent (int elementName, int attributeName) in the simple types.If the simple types of key element type for repeating then uses isOptionalAttributePresent (int index, int elementName, int attributeName) method to determine whether it comprises optional attribute.
For the key element that repeats, the getElementRepetitions method is in order to return the key element number of repetition.This is used for setting up the circulation in the template 112, uses for handling each key element.For simple types, template 112 should comprise beginning and end-tag, and calls getElementValue (int index, int elementName) to obtain its value.For complicated type, owing to state must be safeguarded, so template 112 should be called startElement (int index, int elementName) and endElement (int index, intelementName) method.
Table M114-2 gathers the main function (promptly all not listing) of Map Interface 114-2 (X2XMLMapping).Map Interface 114-2 execution (between Java and XML) mapping function, and set up export target stream.Map Interface 114-2 extensible processor interface 114-1 provides to produce required file template 112 callback methods of output XML file 118.
Table M114-2
Function Describe
Execute () Execution is in order to create the mapping of output XML file 118.
SetOutputStream () Output stream is set at output XML file 118 will produce.
Table M114-3 gathers the main function (promptly all not listing) of mapping class 114-3 (X2XMLMappingImpl).Mapping class 114-3 provides the method that maps to output XML file 118 from input Java object 116.Discussion as the definition of above related genera and interface, X2XMLMappingImpl class 114-3 is directly used, but, increase content to proper method and obtain subclass according to the files classes definition of the input Java object 116 of the output XML file 118 that is shone upon and desire mapping.
Table M114-3
Function Describe
Execute () Execution is in order to create the mapping of output XML file 118.
SetOutputStream () Output stream is set at output XML file 118 will produce.
Table M114-4 gathers the main function (promptly all not listing) of export target class 114-4 (X2XMLOutputTarget).
X2XMLOutputTarget class 114-4 allows XML file 118 is write byte stream or character stream.Class 114-4 provides optimization, and for example allowing the goal-setting with byte stream is the output stream of servlet.Therefore, XML file 118 is not cushioned before writing out.
Table M114-4
Function Describe
Close () Close output stream, and discharge any system resource relevant with this output stream.
Flush () Remove output stream, and force output byte to write out any buffering.
Write () Byte is written to output stream from the specified byte array.
In a word, X2XMLMappingImpl class 114-3 realizes X2XMLMapping interface 114-2.X2XMLMapping interface 114-2 is expanded X2XMLHandler interface 114-1.Therefore, X2XMLMappingImpl class 114-3 realizes defined method among the X2XMLHandler interface 114-1.
With reference to Fig. 4, graphic technique 400 wherein shows software object 116 (for example Java Bean) is mapped to the performed roughly step of XML file 118:
(a) in step 402, obtain the example of Map Interface 114-2 (for example X2XMLMapping), in order to realize from input object X116 to the mapping of exporting XML file 118;
(b) in step 404, the software object 116 among the setting Map Interface 114-3 and the output stream of XML file 118;
(c) in step 406, call Map Interface 114-2;
(d) in step 408, create the JSP container;
(e) in step 410, Map Interface 114-2 uses the JSPXML template 112 of creating XML file 118 to call the JSP container;
(f) in step 412, compiling of JSP container and execution JSP XML template 112;
(g) in step 414, begin XML file 118 is write the output stream of (from step 404) appointment through the JSP XML template 112 of compiling;
(h) in step 416, when being applicable to the element/attribute data and be applicable to beginning/end-tag, through the JSP XML template 112 readjustment Map Interface 114-2 of compiling, safeguarding treatment state, and data are added to output XML file 118 (data are from software object 116 retrievals);
(i) in step 418, call isOptionalElementPresent method or isOptionalAttributePresent method alternatively through the JSP XML template 112 of compiling, whether should generate some part of XML file with decision;
(j) in step 420, JSP XML template 112 readjustment getElementRepetitions methods should be how many times with decision circulation when producing some part of XML file; And
(k) in step 422, safeguard treatment state by storehouse; Array occurs when generate complicated type in the XML file, when recurrence or complicated type occurring and being contained in another complicated type, this will be of great use.
Use XML file template 112 from the mapping of Java to XML, this XML file template is encoded with the analyzer 104 desired similar standards of handling (at least for complex object) incident.For example, for complicated type, beginning and end-tag must be encoded (initial form does not then need).Below the example II " JAVA-XML CUSTOMER " of Xiang Shuing produces the client XML file of output from the client iava object of input.
Example II
JAVA-XML?CUSTOMER
Following assembly (following details) is the part of example II:
(A) Customer2XMLMapping.java: processor class 114-1, called by JSP 112, obtain numerical value in order to client Java object 116 from input, fill the XML file 118 of output;
(B) the customer.jsp:JSP template 112, in order to generate the XML file 118 of output;
(C) CustomerSymbols.java: comprise constant and Hash mapping.This Hash mapping is in order to map to integer constant with bookmark name.JSP template 112 is used these integer constants; And
(D) execute.java: mapping class/interface 114-2, the program of 114-3 is in order to the mapping from Java to XML and (as the C item of the above example I that provides) from XML to Java to be provided.
A. in order to set up the program of XML file from the Java object of input
(Customer2XMLMapping.java), wherein will delete to some extent for the sake of clarity.
∥START Customer2XMLMapping.java    package com.xxx.xml2xmapp±ng.sample.customer;    import java();util.*;    import com.ibm.xml2xmapping.util.*;    public class Customer2XMLMapping extends    com.xxx.xml2xmapping.X2XMLMappingImpl{      private Customer fieldCustomer;    /***    *Customer2XMLMapping constructor comment.    */    public Customer2XMLMapping(){      super();      fieldPageName=””customer.jsp”;    }    /**    *getElementRepetitions method comment.    */    public int getElementRepetitions(int name){      switch(name){<!-- SIPO <DP n="24"> --><dp n="d24"/>      }      return 0;    }    /**    *getElementValue method comment.    */    public String getElementValue(int name){      switch(name){         case CustomerSymbols.CUSTOMER_FIRSTNAME:{            return this.fieldCustomer.getfirstName();         }         case CustomerSymbols.CUSTOMER LASTNAME:{            retum this.fieldCustomer.getLastName();         }         case CustomerSymbols.CUSTOMER_ID:{            return this.fieldCustomer.getId();         }      }      return“”;    }    *getElementValue method comment.    public String getElementValue(int index,int name){       switch(name){       }       retutn““;    }    *@param aCustomer    com.xxx.xml2xmapping.sample.customer.Customer    public void setCustomer(Customer aCustomer){          this.fieldCustomer=aCustomer;    }<!-- SIPO <DP n="25"> --><dp n="d25"/>    }   ∥END Customer2XMLmapping.java
The file template (Customer.jsp) of the module 112 of B.JSP form wherein will be deleted for the sake of clarity to some extent.
∥START Customer.jsp    <%@page import=”com.ibm.xml2xmapping.*“%>    <%@page    import=”com.ibm.xml2xmapping.sample.customer.CustomerSymbols”%>    <%X2XMLHandler handler=    (X2XMLHandler)request.getAttribute      (“com.ibm.xml2xmapping.X2XMLHandler”);    handler.setWriter(out);%>    <?xml version=”1.0”?>    <customer>    <FirstName><%=handler.getElementValue      (CustomerSymbols.CUSTOMER_FIRSTNANE)%></FirstName>    <LastName><%=handler.getElementValue      (CustomerSymbols.CUSTOMER_LASTNAME)%></LastName>    <CustId><%=handle r.getElementValue(CustomerSymbols.CUSTOMER ID)%></CustId>    </customer>    ∥END Customer.jsp
The program (Customersymbols.java) of employed Hash mapping of C.customer.jsp and constant,
Wherein will delete to some extent for the sake of clarity.
∥START Customersymbols.java    package com.xxx.xml2xmapping.sample.customer;  import java.util.HashMap;    public class CustomerSymbols{      public static final int CUSTOMER=1;      public static finalint CUSTOMER FIRSTName=2;      public static finalint CUSTOMER LASTNAME=3;      public static final int CUSTOMER ID=4;      private static CustomerSymbols fieldInstance;      private HashMap fieldName2SymbolDictionary;      private static Object anObject=new Object();    *CustomerInfoElementSymbols constructor comment.    private CustomerSymbols(){      super();      this.fieldName2SymbolDictionary=new HashMap();      this.fieldName2SymbolDictionary.put(“customer”,                new Integer(CustomerSymbols.CUSTOMER));      this.fieldName2SymbolDictionary.put(“FirstName”,                new Integer(CustomerSymbols.CUSTOMER_FIRSTNAEVJE));    this.fieldName2SymbolDictionary.put(“LastName”,                new Integer(CustomerSymbols.CUSTOMER_LASTNAME));    this.fieldName2SymbolDictionary.put(“CustId”,             new Integer(CustomerSymbols.CUSTOMER_ID));    }    *@return int    *@param elementName java.lang.String    public static int getSymbol(String elementName){       if(CustomerSymbols.fieldInstance==null){          synchronized(anObject)<!-- SIPO <DP n="27"> --><dp n="d27"/>                if(CustomerSymbols.fieldInstance=null)                   CustomerSymbols.fieldInstance=new    CustomerSymbols();            }      }    }    return    ((Integer)CustomerSymbols.fieldInstance.fieldName2SymbolDictionary.get(elementName)).intValue();    }    }    ∥END Customersymbols.java
For the array of client's situation of being discussed for example I generates the XML file, below provide the customer.jsp example of rewriting:
for(int i=0;    i<handler.getElementRepetitions(CustomerSymbols.CUSTOMERS);i++)    {    <%handler.startElement(i,CustomerSymbols.cCJsTOMER);%>    <customer>    <FirstName>    <%=handler.getElementValue        (CustomerSymbols.CUSTOMER_FIRSTNAME)%></FirstName>    <LastName>    <%=handler.getElementValue        (CustomerSymbols.CEJSTOMERLASTNAME%></LastName>    <CustId><%=handler.getElementValue        (CustomerSymbols.CUSTOMER_ID)%></CustId>    </customer>    <%=handler.endElement(i,Customersymbols.CUSTOMER);%>    <%}%>
Processor 114-1 decision array size (that is, should carry out the how many times circulation), and in the getElementRepitions method, return.When customer.jsp called startElement with subscript and title, processor 114-1 set quoting this specific consumers object in the array.
In order to handle recurrence, processor 114-1 uses storehouse.When the object recurrence, processor 114-1 pushes in the storehouse startElement, and endElement is ejected.The object of operation is the object that is positioned at the storehouse top.
If object is optionally, then use isOptionalElement () or isOptionalAttribute () method decision objects whether to exist.Processing among the customer.jsp is rewritten, and to increase conditional statement, it uses a Boolean that returns in the isOptionalxxx method.
In a word, the advantage of example embodiment of the present invention comprises:
(a) provide from the XML File mapping to the Java object and the common frame from the Java object map to the XML file, wherein this framework uses processor, and this processor is covered as getattr and used for mapping;
(b) use existing instrument (for example SAX analyzer, JSP) initialization mapping method of the present invention (XML/Java); And
(c) provide (in the Java environment) interface and class, in order to simplify the structure that mapping of the present invention is handled, make the mapping of two mapping directions handle similar.

Claims (44)

1. the data structure that will represent software object converts the computer implemented method of the structured language key element of file to, and this method comprises:
(a) generating structure language elements template file;
(b) read attribute from software object, these attributes are related with the structured language key element of file;
(c) use these attributes, according to related the obtaining between attribute and structured language key element by the defined member of structured language key element; And
(d) with these member interstitital texture language elements template files.
2. computer implemented method as claimed in claim 1, wherein step (c) comprises direct readjustment software object, with the attribute of the member that obtains the structure of representing defined file and content.
3. computer implemented method as claimed in claim 1, wherein step (c) comprises the structure of creating representation file and the object model of content.
4. computer implemented method as claimed in claim 1, wherein the structured language key element is represented extend markup language (XML) member.
5. key element implementation method as claimed in claim 1, wherein step (c) is included in and sets up circulation in the template file, in order to handle the structured language key element that repeats.
6. one kind converts the structured language key element of file the computer implemented method of the data structure of representing software object to, and this method comprises:
(a) read each structured language key element of file;
(b) from one group of defined available attributes of the data structure by software object, selected, determined the attribute related with the structured language key element of file; And
(c) to fill the attribute of the data structure of representing software object from the structured language key element value of file.
7. computer implemented method as claimed in claim 6, wherein step (a) comprises the structure of generation expression file and the incident of content.
8. computer implemented method as claimed in claim 6, wherein step (a) comprises the event call-back processor with the structure and the content of representation file.
9. computer implemented method as claimed in claim 6, wherein step (a) comprises the structure of creating representation file and the object model of content.
10. computer implemented method as claimed in claim 6, wherein the structured language key element is represented extend markup language (XML) member, and step (a) further comprises execute file type definition (DTD) and XML mode standard.
11. computer implemented method as claimed in claim 10 further comprises and safeguards the storehouse of using for the XML member of recurrence.
12. the software object (116) that will comprise attribute converts the system by the defined file of structured language key element (118) to, this system comprises:
(a) file template (112);
(b) processor interface (114-1), its readjustment according to file template (112) provides the expression of the structured language key element of file (118);
(c) mapping block (114-2,114-3), (114-1) communicates with processor interface, the structured language key element that becomes file (118) to be discerned the property transformation of software object (116); And
(d) export target class (114-4), (114-2 114-3) communicates, and the structured language key element that is produced in the step (c) is write file (118) with mapping block.
13. system as claimed in claim 12, wherein this mapping block comprises Map Interface (114-2), in order to carry out the conversion of attribute to the structured language key element, with the export target stream of setting this document (118), and mapping class (114-3), in order to provide Map Interface (114-2) employed method.
14. system as claimed in claim 13 wherein is defined as impact damper with export target stream.
15. system as claimed in claim 13 wherein is defined as export target stream the response flow of servlet.
16. system as claimed in claim 12, wherein the structured language key element is represented extend markup language (XML) member.
17. system as claimed in claim 16, wherein file template uses JavaServer Pages (JSP) to create.
18. the file (118) that will comprise the structured language key element converts the system of software object (110) to, this system comprises:
(a) analyzer (104) is in order to obtain the incident of representation file (108) characteristic;
(b) input source class (106-1) is in order to read file (108);
(c) content handler class (106-2), (106-1) communicates with the input source class, in order to the impact damper of the incident use that realizes being obtained for analyzer (104); And
(d) (106-3,106-4), (106-2) communicates mapping block with the content handler class, will convert the attribute of software object (110) to by analyzer (104) incident of being obtained.
19. system as claimed in claim 18, wherein this mapping block comprises Map Interface (106), flows in order to execution incident to the conversion of attribute and the export target of setting software object (110), and mapping class (106-3), in order to provide Map Interface (106-4) employed method.
20. system as claimed in claim 19, wherein the structured language key element is represented extend markup language (XML) member.
21. the software object that will have an attribute converts the method with the file of structured language key element representative to, this method comprises:
(a) software object is offered the example of the Map Interface that is called;
(b) use the example of the container that is called to compile and carry out template; And
(c) use template that file is write specific output stream through compiling.
22. method as claimed in claim 21 further comprises the readjustment Map Interface, to safeguard treatment state.
23. method as claimed in claim 21 further comprises by calling the isOptionalElementPresent method through the template of compiling, whether generates the selected part of this document with decision.
24. method as claimed in claim 21 further comprises by calling the isOptionalAttributePresent method through the template of compiling, whether generates the selected part of this document with decision.
25. method as claimed in claim 21, further comprising when generating complicated type in file uses storehouse to safeguard treatment state, described complicated type is to select from the group that the following is formed: array, recurrence and the complicated type that is contained in another complicated type.
26. method as claimed in claim 25, wherein this stack states be by from through the compiling template to the readjustment of Map Interface safeguarded, in order to indicate these complicated types when to begin and to finish.
27. method as claimed in claim 21 further comprises the getElementRepetitions method of calling, and should carry out the how many times circulation with the decision template on the selected part of file.
28. method as claimed in claim 21, wherein the structured language key element is represented extend markup language (XML) member, and template uses JavaServer Pages (JSP) to create.
29. the file conversion that will comprise the structured language key element becomes the method for software object, this method comprises:
(a) file is offered the example of the Map Interface that is called;
(b) Map Interface is registered as content handler;
(c) use instance analysis this document of the analyzer that is called; And
(d) fill software object with the attribute related with the structured language key element of coming from file analysis by the readjustment Map Interface.
30. method as claimed in claim 29, wherein step (d) comprises readjustment and calls method selected from the group that the following is formed: startDocument, startElement, characters, endElement, and endDocument.
31. method as claimed in claim 30 is wherein created software object by Map Interface performed startDocument and startElement method.
32. method as claimed in claim 29 wherein is set in attribute in the software object by the performed endElement method of Map Interface.
33. method as claimed in claim 29, wherein the structured language key element is represented extend markup language (XML) member.
34. the data structure that will represent software object converts the computer program of the structured language key element of file to, this computer program comprises the computer readable program code device as following purposes:
(a) generating structure language elements template file;
(b) read attribute from software object, these attributes are related with the structured language key element of file;
(c) use these attributes, according to related the obtaining between attribute and structured language key element by the defined member of structured language key element; And
(d) with these member interstitital texture language elements template files.
35. computer program as claimed in claim 34, wherein step (c) comprises direct readjustment to software object, with the incident of the member that obtains the structure of representing defined file and content.
36. computer program as claimed in claim 34, wherein step (c) comprises the structure of creating representation file and the object model of content.
37. computer program as claimed in claim 34, wherein the structured language key element is represented extend markup language (XML) member.
38. computer program as claimed in claim 34, wherein step (c) is included in and sets up circulation in the template file, in order to handle the structured language key element that repeats.
39. one kind converts the structured language key element of file the computer program of the data structure of representing software object to, this computer program comprises the computer readable program code device as following purposes:
(a) read each structured language key element of file;
(b) from one group of defined available attributes of the data structure by software object, selected, determined the attribute related with the structured language key element of this document; And
(c) to fill the attribute of the data structure of representing software object from the structured language key element value of this document.
40. computer program as claimed in claim 39, wherein step (a) comprises the structure that produces representation file and the incident of content.
41. computer program as claimed in claim 39, wherein step (a) comprises the event call-back processor with the structure and the content of representation file.
42. computer program as claimed in claim 39, wherein step (a) comprises the structure of creating representation file and the object model of content.
43. computer program as claimed in claim 39, wherein the structured language key element is represented extend markup language (XML) member, and step (a) further comprises execute file type definition (DTD) and XML mode standard.
44. computer program as claimed in claim 43 further comprises and safeguards the storehouse of using for the XML member of recurrence.
CNB018233392A 2001-06-07 2001-12-28 System and method of mapping between software objects and structure languige element-based documents Expired - Fee Related CN1313953C (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CA002349905A CA2349905A1 (en) 2001-06-07 2001-06-07 System and method of mapping between software objects and structured language element based documents
CA2,349,905 2001-06-07

Publications (2)

Publication Number Publication Date
CN1513145A true CN1513145A (en) 2004-07-14
CN1313953C CN1313953C (en) 2007-05-02

Family

ID=4169222

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB018233392A Expired - Fee Related CN1313953C (en) 2001-06-07 2001-12-28 System and method of mapping between software objects and structure languige element-based documents

Country Status (11)

Country Link
EP (1) EP1399841A1 (en)
JP (1) JP2004530225A (en)
KR (1) KR100583517B1 (en)
CN (1) CN1313953C (en)
CA (1) CA2349905A1 (en)
CZ (1) CZ20033330A3 (en)
HU (1) HUP0400135A2 (en)
PL (1) PL367225A1 (en)
RU (1) RU2287181C2 (en)
TW (1) TW573278B (en)
WO (1) WO2002101579A1 (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100336023C (en) * 2004-08-24 2007-09-05 英业达股份有限公司 Method for realizing software call through keyword associated mechanism
CN100390735C (en) * 2004-12-06 2008-05-28 国际商业机器公司 Method and system for producing GUI format
CN100416567C (en) * 2004-11-30 2008-09-03 国际商业机器公司 Sharable two way method and system for switching between object model and XML
CN101355560B (en) * 2008-09-12 2011-12-14 深圳市联软科技有限公司 Method and system for transmitting data
CN102866884A (en) * 2011-08-31 2013-01-09 微软公司 Projecting native application programming interfaces of operating system into other programming languages
CN104756072A (en) * 2012-11-02 2015-07-01 微软公司 Cross-platform data visualizations using common descriptions
US9563487B2 (en) 2011-08-11 2017-02-07 Microsoft Technology Licensing, Llc. Runtime system
CN106407679A (en) * 2016-09-13 2017-02-15 上海市徐汇区中心医院 Mobile Internet cross-platform cross-equipment remote diagnosis and treatment system
CN108519964A (en) * 2018-03-09 2018-09-11 中国工程物理研究院计算机应用研究所 The method that XML Schema documents are converted into Java code
US10089119B2 (en) 2009-12-18 2018-10-02 Microsoft Technology Licensing, Llc API namespace virtualization
CN110795169A (en) * 2018-08-02 2020-02-14 武汉斗鱼网络科技有限公司 Method and related device for acquiring data
US10635504B2 (en) 2014-10-16 2020-04-28 Microsoft Technology Licensing, Llc API versioning independent of product releases
CN113742008A (en) * 2021-09-13 2021-12-03 挂号网(杭州)科技有限公司 Interface calling method and device, electronic equipment and storage medium

Families Citing this family (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003091419A (en) * 2001-09-19 2003-03-28 Just Syst Corp Information processor and its program
US7861250B2 (en) 2003-04-25 2010-12-28 Microsoft Corporation Runtime polymorphism
US7194485B2 (en) 2003-11-21 2007-03-20 International Business Machines Corporation Mapping XML schema components to qualified java components
US7212410B2 (en) 2004-01-16 2007-05-01 Finisar Corporation Actuator for small form-factor pluggable transceiver
US7418456B2 (en) 2004-01-16 2008-08-26 International Business Machines Corporation Method for defining a metadata schema to facilitate passing data between an extensible markup language document and a hierarchical database
US7290012B2 (en) 2004-01-16 2007-10-30 International Business Machines Corporation Apparatus, system, and method for passing data between an extensible markup language document and a hierarchical database
US7120864B2 (en) 2004-01-27 2006-10-10 International Business Machines Corporation Eliminating superfluous namespace declarations and undeclaring default namespaces in XML serialization processing
CN1306400C (en) * 2004-05-20 2007-03-21 北京大学 Binary system software member and its manufacturing method
KR100653610B1 (en) 2004-09-15 2006-12-04 (주)웹플러스 On-line flash editing system with reinforced function of editing navigation bar
US7904417B2 (en) 2006-02-27 2011-03-08 Microsoft Corporation Recursive metadata templating
KR100836736B1 (en) * 2006-09-27 2008-06-10 한국전자통신연구원 Apparatus for Parser Framework using Markup Language and Method thereof
US8578350B2 (en) 2006-11-30 2013-11-05 Ncr Corporation System and method for interpreting a specification language file to implement a business system
US8381093B2 (en) 2006-12-06 2013-02-19 Microsoft Corporation Editing web pages via a web browser
US8880564B2 (en) * 2007-10-11 2014-11-04 Microsoft Corporation Generic model editing framework
US9250938B2 (en) * 2008-10-15 2016-02-02 Microsoft Technology Licensing, Llc Caching runtime generated code
US8347208B2 (en) * 2009-03-04 2013-01-01 Microsoft Corporation Content rendering on a computer
JP5249092B2 (en) * 2009-03-09 2013-07-31 Necシステムテクノロジー株式会社 Information processing apparatus, multidimensional array expansion processing method, and program
US20100235806A1 (en) * 2009-03-13 2010-09-16 Microsoft Corporation Rich Web Site Authoring And Design
CN101826113A (en) * 2010-05-14 2010-09-08 珠海世纪鼎利通信科技股份有限公司 High-efficiency and unified method for storing wireless measurement data
KR101535703B1 (en) 2012-09-28 2015-07-09 삼성에스디에스 주식회사 Apparatus and method for converting Value Object
RU2527201C1 (en) * 2013-01-24 2014-08-27 Общество с ограниченной ответственностью "Системное моделирование и анализ" Data conversion method, data conversion device and data conversion system
KR102095703B1 (en) * 2013-06-20 2020-04-01 에스케이플래닛 주식회사 An apparatus, method and recording medium for Markup parsing
CN104636265B (en) * 2015-01-21 2016-04-27 广东电网有限责任公司电力科学研究院 A kind of access method of efficient memory model tissue of CIMXML document
KR102255806B1 (en) * 2017-07-03 2021-05-26 (주)더리스 Integrated management method and system of online shopping mall based on API
CN110795168B (en) * 2018-08-02 2022-11-11 武汉斗鱼网络科技有限公司 Method for acquiring data and related device
CN113505269B (en) * 2021-07-02 2024-03-29 卡斯柯信号(成都)有限公司 Binary file detection method and device based on XML
JP7315253B2 (en) * 2021-09-29 2023-07-26 株式会社スカイディスク System, server and method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5926189A (en) * 1996-03-29 1999-07-20 Apple Computer, Inc. Method and apparatus for typographic glyph construction including a glyph server
US6343265B1 (en) * 1998-07-28 2002-01-29 International Business Machines Corporation System and method for mapping a design model to a common repository with context preservation
US6125391A (en) * 1998-10-16 2000-09-26 Commerce One, Inc. Market makers using documents for commerce in trading partner networks
US6226675B1 (en) * 1998-10-16 2001-05-01 Commerce One, Inc. Participant server which process documents for commerce in trading partner networks
AU778101B2 (en) * 1999-06-14 2004-11-18 Integral Development Corporation System and method for conducting web-based financial transactions in capital markets
US6327628B1 (en) * 2000-05-19 2001-12-04 Epicentric, Inc. Portal server that provides a customizable user Interface for access to computer networks

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100336023C (en) * 2004-08-24 2007-09-05 英业达股份有限公司 Method for realizing software call through keyword associated mechanism
CN100416567C (en) * 2004-11-30 2008-09-03 国际商业机器公司 Sharable two way method and system for switching between object model and XML
CN100390735C (en) * 2004-12-06 2008-05-28 国际商业机器公司 Method and system for producing GUI format
CN101355560B (en) * 2008-09-12 2011-12-14 深圳市联软科技有限公司 Method and system for transmitting data
US10089119B2 (en) 2009-12-18 2018-10-02 Microsoft Technology Licensing, Llc API namespace virtualization
US9563487B2 (en) 2011-08-11 2017-02-07 Microsoft Technology Licensing, Llc. Runtime system
CN102866884A (en) * 2011-08-31 2013-01-09 微软公司 Projecting native application programming interfaces of operating system into other programming languages
US9229790B2 (en) 2011-08-31 2016-01-05 Microsoft Technology Licensing, Llc Projecting native application programming interfaces of an operating system into other programming languages
CN102866884B (en) * 2011-08-31 2016-09-28 微软技术许可有限责任公司 The method and apparatus that the machine application programming interface is projected other programming languages
US9824473B2 (en) 2012-11-02 2017-11-21 Microsoft Technology Licensing, Llc Cross-platform data visualizations using common descriptions
CN104756072B (en) * 2012-11-02 2018-05-04 微软技术许可有限责任公司 For the cross-platform data visualization method and system using public description
CN104756072A (en) * 2012-11-02 2015-07-01 微软公司 Cross-platform data visualizations using common descriptions
US10254848B2 (en) 2012-11-02 2019-04-09 Microsoft Technology Licensing, Llc Cross-platform data visualizations using common descriptions
US10635504B2 (en) 2014-10-16 2020-04-28 Microsoft Technology Licensing, Llc API versioning independent of product releases
CN106407679A (en) * 2016-09-13 2017-02-15 上海市徐汇区中心医院 Mobile Internet cross-platform cross-equipment remote diagnosis and treatment system
CN106407679B (en) * 2016-09-13 2019-03-26 上海市徐汇区中心医院 Mobile interchange cross-platform cross equipment remote diagnosis system
CN108519964A (en) * 2018-03-09 2018-09-11 中国工程物理研究院计算机应用研究所 The method that XML Schema documents are converted into Java code
CN110795169A (en) * 2018-08-02 2020-02-14 武汉斗鱼网络科技有限公司 Method and related device for acquiring data
CN113742008A (en) * 2021-09-13 2021-12-03 挂号网(杭州)科技有限公司 Interface calling method and device, electronic equipment and storage medium
CN113742008B (en) * 2021-09-13 2024-04-02 挂号网(杭州)科技有限公司 Interface calling method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
EP1399841A1 (en) 2004-03-24
CA2349905A1 (en) 2002-12-07
RU2003137567A (en) 2005-05-27
CZ20033330A3 (en) 2004-03-17
WO2002101579A1 (en) 2002-12-19
KR100583517B1 (en) 2006-05-24
CN1313953C (en) 2007-05-02
RU2287181C2 (en) 2006-11-10
PL367225A1 (en) 2005-02-21
JP2004530225A (en) 2004-09-30
KR20040007545A (en) 2004-01-24
HUP0400135A2 (en) 2004-08-30
TW573278B (en) 2004-01-21

Similar Documents

Publication Publication Date Title
CN1313953C (en) System and method of mapping between software objects and structure languige element-based documents
US20040168124A1 (en) System and method of mapping between software objects &amp; structured language element-based documents
CN1783019A (en) Interface infrastructure for creating and interacting with web services
Can et al. Pykaldi: A python wrapper for kaldi
Grönniger et al. Monticore: a framework for the development of textual domain specific languages
CN1647042A (en) Methods for customizing software abstractions
CN1811702A (en) System and method for developing portal applications and automatically deploying them into a portal server application
KR101213890B1 (en) Using strong data types to express speech recognition grammars in software programs
JP3430007B2 (en) Machine translation device and recording medium
US20070050707A1 (en) Enablement of multiple schema management and versioning for application-specific xml parsers
CN1841362A (en) Method and system for processing an electronic form
CN1379882A (en) Method for converting two-dimensional data canonical representation
CN1969272A (en) Importation of automatically generated content
CN1704900A (en) Method and apparatus for generating user interfaces based upon automation with full flexibility
CN1906575A (en) Dynamic software update system, method and program product
CN1848774A (en) System and method for long-distance calling communication assembly
JP2005011358A (en) Adaptive machine translation
CN1661554A (en) System and method for building wireless applications
CN101038550A (en) Information processing apparatus and information processing method
CN1842081A (en) ABNF character string mode matching and analyzing method and device
CN1480840A (en) Information processor, information processing method, computer readble memory medium
CN1991765A (en) Developing apparatus and method for hand-held terminal application program
US8930925B2 (en) Method for enabling compilation of a Cobol source program utilizing a two-stage compilation process, the Cobol source program including a mix of Cobol, C++ or JAVA statements, and optional OpenMP directives
Gómez et al. CRUDyLeaf: a DSL for generating spring boot REST APIs from entity CRUD operations
CN1797404A (en) Methods and systems for preserving unknown mark in a strongly typed environment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1067210

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
C19 Lapse of patent right due to non-payment of the annual fee
CF01 Termination of patent right due to non-payment of annual fee
REG Reference to a national code

Ref country code: HK

Ref legal event code: WD

Ref document number: 1067210

Country of ref document: HK