Patent ID: 7970730

Claim:
In a computing environment comprising a processor operatively coupled to a memory, a computer-implemented method for dynamically generating classes and instances of said classes from XML input data using runtime type schema inferencing, thereby facilitating efficient and convenient runtime late-bound access to dynamic data types, the method comprising: receiving a first input stream of XML input data from an XML document, wherein upon receiving the XML input data, a type schema of the XML input data is unknown; processing, at runtime, the XML input data in order to infer a type schema of the input data based on actual values of the input data of the first input stream, wherein the type schema represents an organization or structure of the input data of the first input stream which is unknown prior to being inferred; generating source code from the type schema and compiling the source code to generate one or more classes that represent the XML input data of the first input stream; loading the generated one or more classes into memory; generating an instance of each of the generated one or more classes and deserializing the XML input data of the first input stream to the one or more instances, thereby enabling late-bound access to the XML input data of the first input stream through the one or more instances; perform a caching operation for generation of the type schema during the runtime process; receiving a second input stream of XML input data from an XML document; processing, at runtime, the XML input data of the second input stream to validate the XML input data of the second input stream against the type schema, including determining whether the type schema is valid as to the XML input data of the second input stream, and if the type schema is valid as to the XML input data of the second input stream, applying the type schema against the XML input data of the second input stream, including deserializing the XML input data of the second input stream into an instance of the generated one or more classes to thereby enable late-bound access to the XML input data of the second input stream through the one or more instances; and, if the type schema is not valid as to the XML input data of the second input stream: inferring a new type schema based on actual runtime values of the XML input data of the second input stream, produce source code from the new type schema, compile the source code into assembly code, and process the assembly code to generate one or more new classes that are loaded into memory, the one or more new classes representing the XML input data of the second input stream, generating an instance of each of the one or more new classes, and deserializing the XML input data of the second input stream to the one or more instances of the one or more new classes to thereby enable late-bound access to the XML input data of the second input stream through the one or more instances of the one or more new classes.