Binding to Java Data Members

You can use the . (dot) operator to assign the values of Java data members to XML, and vice versa. In other words, in addition to using the . operator for public data members, XML maps enable you to use it with accessor pairs.

For each of the examples below, you can write a map that accesses the data using dot notation syntax like the following:

    <book_data>
        <book_title>{Book.title}</book_title>
        <in_print>{Book.isInPrint}</in_print>
    </book_data>

- Public data members such as fields, declared as follows:

    public class Book
    {
        public String title;
        public boolean inPrint;
    }

- Non-Boolean and boolean data exposed as properties through public accessor methods:

    public class Book
    {
        public String getTitle(){
            return title;
        }
        public void setTitle(String newTitle){
            title = newTitle;
        }
        public boolean isInPrint
        public setInPrint(boolean f)
    }

Related Topics

Matching XML Shapes

Database Control: Using a Database from Your Web Service

Making Simple Substitutions Using Curly Braces