Deserialization

The state of DataBeans can be set automatically with the data in an XML instance document. This process is called deserialization. After deserializing, you use accessors and mutators to manipulate the XML document data from Java code.

There are different ways to deserialize XML documents into DataBean instances. The most common way is through the following constructor of a DataBean instance:

RootName(InputStream istrm, boolean validate)

Another way to deserialize XML is by calling the following method on an existing DataBean instance:

void deserializeXML(java.io.InputStream istrm, boolean validate)

A third way to deserialize XML into a DataBean instance allows the user to do a late binding without incurring the overhead of parsing an XML document twice. This approach is helpful when you require some information from the document instance before determining which particular DataBean instance to bind.

To use this approach, use one of the previous methods to deserialize XML into a DataBeanOpaque object. This object provides methods to retrieve the root name, SYSTEM URI, and PUBLIC URI from the XML document instance. Then, using this information, you can bind a specific DataBean instance one of two ways:

The XML document is parsed only once with this approach.