Data Binding « XML « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » XML » Data Binding 

1. Use XML data binding to do your laundry - JavaWorld    javaworld.com

What if I told you that there already are XML data-binding frameworks that can generate this type of marshaling and unmarshaling code for you? Just feed in a DTD (document type definition) or an XML Schema and -- presto! -- you have Java classes that can marshal, unmarshal, and check data constraints. And like many Java XML tools, these frameworks are mostly free. In this article, we'll examine two such frameworks: Sun's Java Architecture for XML Binding (JAXB) and Castor from the Exolab Group.

2. XML Data Binding with Castor    onjava.com

For some applications, I don't want to even think about "parsing" data. It would be so nice if I could have a Java object to work with, and have it saved off as an XML representation to share, or store. This is exactly what XML data-binding can do for us. There are a few frameworks to help us do this, but we will walk through Castor, an open source framework from Exolab. Castor is a data-binding framework, which is a path between Java objects, XML documents, SQL tables, and LDAP directories. Today, we will work with Castor XML, the XML piece of the Castor project

3. Schemaless Java-XML Data Binding with VTD-XML    onjava.com

This article introduces a new Java-XML data binding technique based entirely on VTD-XML and XPath. The new approach differs from traditional Java-XML data binding tools in that it doesn't mandate schema, takes advantage of XML's inherent loose encoding, and avoids needless object creation, resulting in much greater efficiency.

4. Mapping XML to Java, Part 2 - JavaWorld    javaworld.com

Regardless of whether you use DOM or SAX, when mapping XML data into Java, two things happen -- navigation and data collection. DOM and SAX differ in how those aspects are addressed. That is, DOM separates navigation and data collection, while SAX merges navigation and collection.

5. Mapping XML to Java, Part 1 - JavaWorld    javaworld.com

Some standard tools currently available for working with XML are better than others. The SAX API in particular has some important runtime features for performance-sensitive code. In this article, we will develop some patterns for applying the SAX API. You will be able to create fast XML-to-Java mapping code with a minimum memory footprint, even for fairly complex XML structures (with the exception of recursive structures).

6. Binding XML to Java    theserverside.com

Manipulating XML data easily and efficiently in Java remains an important problem. Numerous approaches to XML binding exist in the industry, including DOM, JAXB, XML Beans, Castor, SDO and so on. In this article we will explore how the Eclipse Modeling Framework, EMF, solves the XML binding problem in a number of interesting ways, and we'll compare that to the alternatives.

7. Generate XML Mapping Code with JAXB    devx.com

The latter solution is called mapping, binding, or translation, and it is the solution JAXB utilizes. In the mapping process, a developer usually uses a parser (SAX or DOM) to get at the data in an XML file and then uses the data to populate a domain object model. Often, the developer creates one class per element of the document, assigning values to attributes from either the data contained within the tag or the tag attributes. If a tag contains further elements, then the developer creates relationships from the class that represent the outer tag to the class representing the inner tag. Of course, before the developer populates an object with data, he or she has to first instantiate it. So the developer also writes code that manages both the creation and collection of objects.

8. XML and Java technologies: Data binding Part 4: JiBX Usage    ibm.com

Part 3 of this series gave you an introduction to the architecture of the JiBX data binding framework. That included a quick overview of JiBX's Java-centric approach to data binding, as contrasted with the XML-centric approach used by most other data binding frameworks. Now in Part 4, you'll find out how to use the power of this Java-centric approach to data binding in your applications.

9. XML and Java technologies: Data binding, Part 2: Performance    ibm.com

Part 1 provides background on why you'd want to use data binding for XML, along with an overview of the available Java frameworks for data binding. If you haven't already read Part 1, you'll probably want to at least glance over it now. In this part I'm going straight to the issue of performance without further discussion of the whys and hows!

10. XML and Java technologies: Data binding Part 3: JiBX architecture    ibm.com

The basic architecture of JiBX is very different from those of other XML data binding frameworks for Java applications. This leads to both advantages and drawbacks when comparing JiBX with these other frameworks. On the plus side, JiBX gains the advantages of very fast operation, a compact runtime, and greater isolation between XML document formats and Java language object structures. On the minus side, it's based on a relatively unproven parser technology and does not support the validation flexibility provided by some of the alternatives (especially JAXB).

11. XML and Java technology: Data binding in 1,000 varieties    ibm.com

While that's the most common approach to data binding, APIs that take an XML document and represent the entire document as an object are also a form of data binding. These APIs include the Document Object Model (DOM), JDOM, and dom4j, all of which create an object model of an XML document in Java coding.

12. Data binding with Castor, Part 2: Marshall and unmarshall XML    ibm.com

After all the time and detail spent on marshalling, unmarshalling is pretty simple. You take an XML document, ensure you have a Java class that matches the data, and let Castor do the work. Let's unmarshall the two XML documents we generated earlier. Listing 12 takes care of the work.

13. JCP Watch: Enhanced Wireless Messaging, XML Data Binding and SIP Support    developer.com

There was one new proposed JSR's along with other JSR's that have matured. Significantly, the Java XML Binding API and the SIP Servlet API (details below) have been approved in their final ballots and additional support for wireless messaging has been proposed.

14. Automating XML/Java mapping with Jato    developer.com

Jato, is an open-source effort focusing on XML/Java conversion (http://www.krumel.com/jato ). Jato encapsulates the mapping between XML and Java objects into an XML file (using Jato-specific tags). This allows the developer to focus strictly on the mapping without paying too much attention to implementation. As the author of Jato observes, conversion implementations often have similar patterns. By capturing the mapping in a single place and then allowing Jato handle the parsing, conversion, and generation, you save many lines of code.

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.