XML attributes - leocadiotine/Dumbledroid GitHub Wiki

XML attributes are treated just like fields in Dumbledroid.

##How it works Let's take a look at a code excerpt from DumbledroidExample. Suppose you have an XML like this:

<sith side="Dark">
    <kills>354</kills>
</sith>

Dumbledroid will treat the side attribute just like a field. The class you should write is like this:

public class Sith extends AbstractModel {
	
	private String side;
	private int kills;
	
	public Sith() {
		super(URL);
	}
	
	@Override
	protected DataType getDataType() {
		return DataType.XML;
	}    	
}
⚠️ **GitHub.com Fallback** ⚠️