com.sencha.gxt.data.client.loader.XmlReader Maven / Gradle / Ivy
/**
* Sencha GXT 3.1.1 - Sencha for GWT
* Copyright(c) 2007-2014, Sencha, Inc.
* [email protected]
*
* http://www.sencha.com/products/gxt/license/
*/
package com.sencha.gxt.data.client.loader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Node;
import com.google.gwt.dom.client.NodeList;
import com.google.gwt.dom.client.Text;
import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.XMLParser;
import com.google.web.bindery.autobean.shared.AutoBean;
import com.google.web.bindery.autobean.shared.AutoBeanFactory;
import com.google.web.bindery.autobean.shared.Splittable;
import com.sencha.gxt.core.client.GXT;
import com.sencha.gxt.core.client.dom.DomQuery;
import com.sencha.gxt.core.shared.FastMap;
import com.sencha.gxt.data.shared.loader.AbstractAutoBeanReader;
/**
* A DataReader
implementation that reads XML data and build it
* into the given {@link AutoBean} type, using other types from the given
* factory.
*
*
* These AutoBean interfaces should use
* {@link com.google.web.bindery.autobean.shared.AutoBean.PropertyName} to
* specify the path to properties. Collections can be referenced by specifying
* the path to the items.
*
*
* Subclasses can override {@link #createReturnData(Object, Object)} to control
* what object is returned by the reader.
*
* @param
* the model type to return from the reader
* @param
* an intermediate type that represents the data passed in as XML.
* May be the same as M
*/
public class XmlReader extends AbstractAutoBeanReader {
/**
* A {@link Splittable} for XML data.
*/
public final static class XmlSplittable implements Splittable {
private final Node node;
private final NodeList nodes;
private final Map reifiedData = new FastMap