|
|||||||||||
| PREV NEXT | FRAMES NO FRAMES | ||||||||||
XMLBeans is a tool that allows you to access the full power of XML in a Java friendly way. It is an XML-Java binding tool. The idea is that you can take advantage the richness and features of XML and XML Schema and have these features mapped as naturally as possible to the equivalent Java language and typing constructs. XMLBeans uses XML Schema to compile Java interfaces and classes that you can then use to access and modify XML instance data. Using XMLBeans is similar to using any other Java interface/class, you will see things like getFoo or setFoo just as you would expect when working with Java. While a major use of XMLBeans is to access your XML instance data with strongly typed Java classes there are also API's that allow you access to the full XML infoset (XMLBeans keeps full XML Infoset fidelity) as well as to allow you to reflect into the XML schema itself through an XML Schema Object model.
There are at least two major things that make XMLBeans unique from other XML-Java binding options.
A major objective of XMLBeans has been to be applicable in all non-streaming (in memory) XML programming situations. You should be able to compile your XML Schema into a set of java classes and know that you will be able to use XMLBeans for all of the schemas you encounter (even the warped ones) and that you will be able to get to the XML at whatever level is necessary.
XMLBeans provides three major APIs:
XmlObject The java classes that are generated from an XML Schema are all derived from XmlObject. These provide strongly typed getters and setters for each of the elements within the defined XML. Complex types are in turn XmlObjects. For example getCustomer might return a CustomerType (which is an XmlObject). Simple types turn into simple getters and setters with the correct java type. For example getName might return a String.
XmlCursor From any XmlObject you can get an XmlCursor. This provides efficient, low level access to the XML Infoset. A cursor represents a position in the XML instance. You can move the cursor around the XML instance at any level of granularity you need from individual characters to Tokens.
SchemaType XMLBeans provides a full XML Schema object model that you can use to reflect on the underlying schema meta information. For example, you might want to generate a sample XML instance for an XML schema or perhaps find the enumerations for an element so that you can display them. All of this was built with performance in mind. Informal benchmarks and user feedback indicate that XMLBeans is extremely fast.
| Packages | |
| javax.xml.namespace | |
| org.apache.xmlbeans | Provides classes for XML Beans schema, infoset, xpath, and xquery handling. |
|
|||||||||||
| PREV NEXT | FRAMES NO FRAMES | ||||||||||