/*********************************************************************************
* *
* WARNING: File automatically generated by DMXmlJson. DON'T CHANGE IT manually! *
* *
*********************************************************************************/
package it.bz.tis.sasabus.backend.shared;
public class SASAbusUnmarshaller_Helper extends bz.davide.dmxmljson.unmarshalling.Unmarshaller
{
protected SASAbusUnmarshaller_Helper()
{
this.emptyObjectCheck.put("it.bz.tis.sasabus.backend.shared.AreaList", new bz.davide.dmxmljson.unmarshalling.EmptyFieldChecker<it.bz.tis.sasabus.backend.shared.AreaList>() {
@Override public void check(it.bz.tis.sasabus.backend.shared.AreaList ret){
// areas
if (ret.areas != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.AreaList.areas");
// lastModified
if (ret.lastModified != 0)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.AreaList.lastModified");
}
});
this.putInstanceFactory("it.bz.tis.sasabus.backend.shared.AreaList", new bz.davide.dmxmljson.unmarshalling.InstanceFactory() {
@Override public Object newInstance() throws Exception {
it.bz.tis.sasabus.backend.shared.AreaList ret = new it.bz.tis.sasabus.backend.shared.AreaList();
return ret;
}
});
this.putClassUnmarshaller("it.bz.tis.sasabus.backend.shared.AreaList", new bz.davide.dmxmljson.unmarshalling.ClassUnmarshaller() {
@Override public void unmarshall(bz.davide.dmxmljson.unmarshalling.Structure structure, Object obj, java.util.HashMap<String, Object> identities) throws Exception {
structure.open();
String id = structure.getId();
if (id != null)
identities.put(id, obj);
bz.davide.dmxmljson.unmarshalling.Value value;
// areas
if ((value = structure.property("areas")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.AreaList)obj).areas = null;
else
{
bz.davide.dmxmljson.unmarshalling.Array arr = value.array();
arr.open();
it.bz.tis.sasabus.backend.shared.Area[] arrayList = new it.bz.tis.sasabus.backend.shared.Area[arr.length()];
for (int i = 0; i < arrayList.length; i++) {
value = arr.nextItem();
if (value.isNull())
arrayList[i] = null;
else
{
bz.davide.dmxmljson.unmarshalling.Structure tmpStructure = value.structure();
String refid = tmpStructure.getRefId();
if (refid != null)
arrayList[i] = (it.bz.tis.sasabus.backend.shared.Area)(identities.get(refid));
else {
Object o = newInstance(tmpStructure.getRuntimeClassName("Area"));
internalUnmarschall(tmpStructure, o.getClass().getName(), o, identities);
arrayList[i] = (it.bz.tis.sasabus.backend.shared.Area)(o);
}
}
}
arr.close();
((it.bz.tis.sasabus.backend.shared.AreaList)obj).areas = arrayList;
}
// lastModified
if ((value = structure.property("lastModified")) != null)
if (value.isNull())
new RuntimeException("Impossibile value for primitive type");
else
{
((it.bz.tis.sasabus.backend.shared.AreaList)obj).lastModified = value.integer();
}
structure.close();
}
});
this.emptyObjectCheck.put("it.bz.tis.sasabus.backend.shared.Area", new bz.davide.dmxmljson.unmarshalling.EmptyFieldChecker<it.bz.tis.sasabus.backend.shared.Area>() {
@Override public void check(it.bz.tis.sasabus.backend.shared.Area ret){
// bounds
if (ret.bounds != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.Area.bounds");
// busLines
if (ret.busLines != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.Area.busLines");
// id
if (ret.id != 0)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.Area.id");
// name_de
if (ret.name_de != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.Area.name_de");
// name_it
if (ret.name_it != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.Area.name_it");
}
});
this.putInstanceFactory("it.bz.tis.sasabus.backend.shared.Area", new bz.davide.dmxmljson.unmarshalling.InstanceFactory() {
@Override public Object newInstance() throws Exception {
it.bz.tis.sasabus.backend.shared.Area ret = new it.bz.tis.sasabus.backend.shared.Area();
return ret;
}
});
this.putClassUnmarshaller("it.bz.tis.sasabus.backend.shared.Area", new bz.davide.dmxmljson.unmarshalling.ClassUnmarshaller() {
@Override public void unmarshall(bz.davide.dmxmljson.unmarshalling.Structure structure, Object obj, java.util.HashMap<String, Object> identities) throws Exception {
structure.open();
String id = structure.getId();
if (id != null)
identities.put(id, obj);
bz.davide.dmxmljson.unmarshalling.Value value;
// bounds
if ((value = structure.property("bounds")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.Area)obj).bounds = null;
else
{
bz.davide.dmxmljson.unmarshalling.Array arr = value.array();
arr.open();
it.bz.tis.sasabus.backend.shared.LatLng[] arrayList = new it.bz.tis.sasabus.backend.shared.LatLng[arr.length()];
for (int i = 0; i < arrayList.length; i++) {
value = arr.nextItem();
if (value.isNull())
arrayList[i] = null;
else
{
bz.davide.dmxmljson.unmarshalling.Structure tmpStructure = value.structure();
String refid = tmpStructure.getRefId();
if (refid != null)
arrayList[i] = (it.bz.tis.sasabus.backend.shared.LatLng)(identities.get(refid));
else {
Object o = newInstance(tmpStructure.getRuntimeClassName("LatLng"));
internalUnmarschall(tmpStructure, o.getClass().getName(), o, identities);
arrayList[i] = (it.bz.tis.sasabus.backend.shared.LatLng)(o);
}
}
}
arr.close();
((it.bz.tis.sasabus.backend.shared.Area)obj).bounds = arrayList;
}
// busLines
if ((value = structure.property("busLines")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.Area)obj).busLines = null;
else
{
bz.davide.dmxmljson.unmarshalling.Array arr = value.array();
arr.open();
it.bz.tis.sasabus.backend.shared.BusLine[] arrayList = new it.bz.tis.sasabus.backend.shared.BusLine[arr.length()];
for (int i = 0; i < arrayList.length; i++) {
value = arr.nextItem();
if (value.isNull())
arrayList[i] = null;
else
{
bz.davide.dmxmljson.unmarshalling.Structure tmpStructure = value.structure();
String refid = tmpStructure.getRefId();
if (refid != null)
arrayList[i] = (it.bz.tis.sasabus.backend.shared.BusLine)(identities.get(refid));
else {
Object o = newInstance(tmpStructure.getRuntimeClassName("BusLine"));
internalUnmarschall(tmpStructure, o.getClass().getName(), o, identities);
arrayList[i] = (it.bz.tis.sasabus.backend.shared.BusLine)(o);
}
}
}
arr.close();
((it.bz.tis.sasabus.backend.shared.Area)obj).busLines = arrayList;
}
// id
if ((value = structure.property("id")) != null)
if (value.isNull())
new RuntimeException("Impossibile value for primitive type");
else
{
((it.bz.tis.sasabus.backend.shared.Area)obj).id = (int)value.integer();
}
// name_de
if ((value = structure.property("name_de")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.Area)obj).name_de = null;
else
{
((it.bz.tis.sasabus.backend.shared.Area)obj).name_de = value.string();
}
// name_it
if ((value = structure.property("name_it")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.Area)obj).name_it = null;
else
{
((it.bz.tis.sasabus.backend.shared.Area)obj).name_it = value.string();
}
structure.close();
}
});
this.emptyObjectCheck.put("it.bz.tis.sasabus.backend.shared.LatLng", new bz.davide.dmxmljson.unmarshalling.EmptyFieldChecker<it.bz.tis.sasabus.backend.shared.LatLng>() {
@Override public void check(it.bz.tis.sasabus.backend.shared.LatLng ret){
// lat
if (ret.lat != 0)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.LatLng.lat");
// lon
if (ret.lon != 0)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.LatLng.lon");
}
});
this.putInstanceFactory("it.bz.tis.sasabus.backend.shared.LatLng", new bz.davide.dmxmljson.unmarshalling.InstanceFactory() {
@Override public Object newInstance() throws Exception {
it.bz.tis.sasabus.backend.shared.LatLng ret = new it.bz.tis.sasabus.backend.shared.LatLng();
return ret;
}
});
this.putClassUnmarshaller("it.bz.tis.sasabus.backend.shared.LatLng", new bz.davide.dmxmljson.unmarshalling.ClassUnmarshaller() {
@Override public void unmarshall(bz.davide.dmxmljson.unmarshalling.Structure structure, Object obj, java.util.HashMap<String, Object> identities) throws Exception {
structure.open();
String id = structure.getId();
if (id != null)
identities.put(id, obj);
bz.davide.dmxmljson.unmarshalling.Value value;
// lat
if ((value = structure.property("lat")) != null)
if (value.isNull())
new RuntimeException("Impossibile value for primitive type");
else
{
((it.bz.tis.sasabus.backend.shared.LatLng)obj).lat = value.decimal();
}
// lon
if ((value = structure.property("lon")) != null)
if (value.isNull())
new RuntimeException("Impossibile value for primitive type");
else
{
((it.bz.tis.sasabus.backend.shared.LatLng)obj).lon = value.decimal();
}
structure.close();
}
});
this.emptyObjectCheck.put("it.bz.tis.sasabus.backend.shared.BusLine", new bz.davide.dmxmljson.unmarshalling.EmptyFieldChecker<it.bz.tis.sasabus.backend.shared.BusLine>() {
@Override public void check(it.bz.tis.sasabus.backend.shared.BusLine ret){
// area
if (ret.area != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusLine.area");
// busStops
if (ret.busStops != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusLine.busStops");
// id
if (ret.id != 0)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusLine.id");
// number
if (ret.number != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusLine.number");
}
});
this.putInstanceFactory("it.bz.tis.sasabus.backend.shared.BusLine", new bz.davide.dmxmljson.unmarshalling.InstanceFactory() {
@Override public Object newInstance() throws Exception {
it.bz.tis.sasabus.backend.shared.BusLine ret = new it.bz.tis.sasabus.backend.shared.BusLine();
return ret;
}
});
this.putClassUnmarshaller("it.bz.tis.sasabus.backend.shared.BusLine", new bz.davide.dmxmljson.unmarshalling.ClassUnmarshaller() {
@Override public void unmarshall(bz.davide.dmxmljson.unmarshalling.Structure structure, Object obj, java.util.HashMap<String, Object> identities) throws Exception {
structure.open();
String id = structure.getId();
if (id != null)
identities.put(id, obj);
bz.davide.dmxmljson.unmarshalling.Value value;
// area
if ((value = structure.property("area")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.BusLine)obj).area = null;
else
{
String refid = value.structure().getRefId();
if (refid != null)
((it.bz.tis.sasabus.backend.shared.BusLine)obj).area = (it.bz.tis.sasabus.backend.shared.Area)identities.get(refid);
else {
Object o = newInstance(value.structure().getRuntimeClassName("Area"));
internalUnmarschall(value.structure(), o.getClass().getName(), o, identities);
((it.bz.tis.sasabus.backend.shared.BusLine)obj).area = (it.bz.tis.sasabus.backend.shared.Area)o;
}
}
// busStops
if ((value = structure.property("busStops")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.BusLine)obj).busStops = null;
else
{
bz.davide.dmxmljson.unmarshalling.Array arr = value.array();
arr.open();
it.bz.tis.sasabus.backend.shared.BusStop[] arrayList = new it.bz.tis.sasabus.backend.shared.BusStop[arr.length()];
for (int i = 0; i < arrayList.length; i++) {
value = arr.nextItem();
if (value.isNull())
arrayList[i] = null;
else
{
bz.davide.dmxmljson.unmarshalling.Structure tmpStructure = value.structure();
String refid = tmpStructure.getRefId();
if (refid != null)
arrayList[i] = (it.bz.tis.sasabus.backend.shared.BusStop)(identities.get(refid));
else {
Object o = newInstance(tmpStructure.getRuntimeClassName("BusStop"));
internalUnmarschall(tmpStructure, o.getClass().getName(), o, identities);
arrayList[i] = (it.bz.tis.sasabus.backend.shared.BusStop)(o);
}
}
}
arr.close();
((it.bz.tis.sasabus.backend.shared.BusLine)obj).busStops = arrayList;
}
// id
if ((value = structure.property("id")) != null)
if (value.isNull())
new RuntimeException("Impossibile value for primitive type");
else
{
((it.bz.tis.sasabus.backend.shared.BusLine)obj).id = (int)value.integer();
}
// number
if ((value = structure.property("number")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.BusLine)obj).number = null;
else
{
((it.bz.tis.sasabus.backend.shared.BusLine)obj).number = value.string();
}
structure.close();
}
});
this.emptyObjectCheck.put("it.bz.tis.sasabus.backend.shared.BusStop", new bz.davide.dmxmljson.unmarshalling.EmptyFieldChecker<it.bz.tis.sasabus.backend.shared.BusStop>() {
@Override public void check(it.bz.tis.sasabus.backend.shared.BusStop ret){
// busStation
if (ret.busStation != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusStop.busStation");
// id
if (ret.id != 0)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusStop.id");
// lat
if (ret.lat != 0)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusStop.lat");
// lon
if (ret.lon != 0)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusStop.lon");
}
});
this.putInstanceFactory("it.bz.tis.sasabus.backend.shared.BusStop", new bz.davide.dmxmljson.unmarshalling.InstanceFactory() {
@Override public Object newInstance() throws Exception {
it.bz.tis.sasabus.backend.shared.BusStop ret = new it.bz.tis.sasabus.backend.shared.BusStop();
return ret;
}
});
this.putClassUnmarshaller("it.bz.tis.sasabus.backend.shared.BusStop", new bz.davide.dmxmljson.unmarshalling.ClassUnmarshaller() {
@Override public void unmarshall(bz.davide.dmxmljson.unmarshalling.Structure structure, Object obj, java.util.HashMap<String, Object> identities) throws Exception {
structure.open();
String id = structure.getId();
if (id != null)
identities.put(id, obj);
bz.davide.dmxmljson.unmarshalling.Value value;
// busStation
if ((value = structure.property("busStation")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.BusStop)obj).busStation = null;
else
{
String refid = value.structure().getRefId();
if (refid != null)
((it.bz.tis.sasabus.backend.shared.BusStop)obj).busStation = (it.bz.tis.sasabus.backend.shared.BusStation)identities.get(refid);
else {
Object o = newInstance(value.structure().getRuntimeClassName("BusStation"));
internalUnmarschall(value.structure(), o.getClass().getName(), o, identities);
((it.bz.tis.sasabus.backend.shared.BusStop)obj).busStation = (it.bz.tis.sasabus.backend.shared.BusStation)o;
}
}
// id
if ((value = structure.property("id")) != null)
if (value.isNull())
new RuntimeException("Impossibile value for primitive type");
else
{
((it.bz.tis.sasabus.backend.shared.BusStop)obj).id = (int)value.integer();
}
// lat
if ((value = structure.property("lat")) != null)
if (value.isNull())
new RuntimeException("Impossibile value for primitive type");
else
{
((it.bz.tis.sasabus.backend.shared.BusStop)obj).lat = value.decimal();
}
// lon
if ((value = structure.property("lon")) != null)
if (value.isNull())
new RuntimeException("Impossibile value for primitive type");
else
{
((it.bz.tis.sasabus.backend.shared.BusStop)obj).lon = value.decimal();
}
structure.close();
}
});
this.emptyObjectCheck.put("it.bz.tis.sasabus.backend.shared.BusStation", new bz.davide.dmxmljson.unmarshalling.EmptyFieldChecker<it.bz.tis.sasabus.backend.shared.BusStation>() {
@Override public void check(it.bz.tis.sasabus.backend.shared.BusStation ret){
// busLines
if (ret.busLines != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusStation.busLines");
// busStops
if (ret.busStops != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusStation.busStops");
// id
if (ret.id != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusStation.id");
// name_de
if (ret.name_de != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusStation.name_de");
// name_it
if (ret.name_it != null)
throw new RuntimeException("The constructor initialized the field it.bz.tis.sasabus.backend.shared.BusStation.name_it");
}
});
this.putInstanceFactory("it.bz.tis.sasabus.backend.shared.BusStation", new bz.davide.dmxmljson.unmarshalling.InstanceFactory() {
@Override public Object newInstance() throws Exception {
it.bz.tis.sasabus.backend.shared.BusStation ret = new it.bz.tis.sasabus.backend.shared.BusStation();
return ret;
}
});
this.putClassUnmarshaller("it.bz.tis.sasabus.backend.shared.BusStation", new bz.davide.dmxmljson.unmarshalling.ClassUnmarshaller() {
@Override public void unmarshall(bz.davide.dmxmljson.unmarshalling.Structure structure, Object obj, java.util.HashMap<String, Object> identities) throws Exception {
structure.open();
String id = structure.getId();
if (id != null)
identities.put(id, obj);
bz.davide.dmxmljson.unmarshalling.Value value;
// busLines
if ((value = structure.property("busLines")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.BusStation)obj).busLines = null;
else
{
bz.davide.dmxmljson.unmarshalling.Array arr = value.array();
arr.open();
it.bz.tis.sasabus.backend.shared.BusLine[] arrayList = new it.bz.tis.sasabus.backend.shared.BusLine[arr.length()];
for (int i = 0; i < arrayList.length; i++) {
value = arr.nextItem();
if (value.isNull())
arrayList[i] = null;
else
{
bz.davide.dmxmljson.unmarshalling.Structure tmpStructure = value.structure();
String refid = tmpStructure.getRefId();
if (refid != null)
arrayList[i] = (it.bz.tis.sasabus.backend.shared.BusLine)(identities.get(refid));
else {
Object o = newInstance(tmpStructure.getRuntimeClassName("BusLine"));
internalUnmarschall(tmpStructure, o.getClass().getName(), o, identities);
arrayList[i] = (it.bz.tis.sasabus.backend.shared.BusLine)(o);
}
}
}
arr.close();
((it.bz.tis.sasabus.backend.shared.BusStation)obj).busLines = arrayList;
}
// busStops
if ((value = structure.property("busStops")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.BusStation)obj).busStops = null;
else
{
bz.davide.dmxmljson.unmarshalling.Array arr = value.array();
arr.open();
it.bz.tis.sasabus.backend.shared.BusStop[] arrayList = new it.bz.tis.sasabus.backend.shared.BusStop[arr.length()];
for (int i = 0; i < arrayList.length; i++) {
value = arr.nextItem();
if (value.isNull())
arrayList[i] = null;
else
{
bz.davide.dmxmljson.unmarshalling.Structure tmpStructure = value.structure();
String refid = tmpStructure.getRefId();
if (refid != null)
arrayList[i] = (it.bz.tis.sasabus.backend.shared.BusStop)(identities.get(refid));
else {
Object o = newInstance(tmpStructure.getRuntimeClassName("BusStop"));
internalUnmarschall(tmpStructure, o.getClass().getName(), o, identities);
arrayList[i] = (it.bz.tis.sasabus.backend.shared.BusStop)(o);
}
}
}
arr.close();
((it.bz.tis.sasabus.backend.shared.BusStation)obj).busStops = arrayList;
}
// id
if ((value = structure.property("id")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.BusStation)obj).id = null;
else
{
((it.bz.tis.sasabus.backend.shared.BusStation)obj).id = value.string();
}
// name_de
if ((value = structure.property("name_de")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.BusStation)obj).name_de = null;
else
{
((it.bz.tis.sasabus.backend.shared.BusStation)obj).name_de = value.string();
}
// name_it
if ((value = structure.property("name_it")) != null)
if (value.isNull())
((it.bz.tis.sasabus.backend.shared.BusStation)obj).name_it = null;
else
{
((it.bz.tis.sasabus.backend.shared.BusStation)obj).name_it = value.string();
}
structure.close();
}
});
}
}