{"version":3,"file":"scripts.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,yDAAyD,gBAAgB;AACzE;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,sBAAsB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,yBAAyB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,sBAAsB,oBAAoB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,sBAAsB,gBAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,qBAAqB;AAC5D,0CAA0C,qBAAqB;AAC/D,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA,2CAA2C;AAC3C,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,WAAW,qBAAqB;AAChC,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,kBAAkB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,sBAAsB,sBAAsB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,sBAAsB;AAC5C;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,wBAAwB;AACjD;AACA;AACA;AACA,yBAAyB,yDAAyD;AAClF;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,2CAA2C,IAAI,4BAA4B;AAC7K;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gCAAgC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,yBAAyB,gCAAgC;AACzD;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gCAAgC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA,sBAAsB,4BAA4B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,sBAAsB,4BAA4B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,wBAAwB,wBAAwB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,uBAAuB,wBAAwB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qBAAqB;AAC3C;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,sBAAsB,sCAAsC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,sBAAsB,sCAAsC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,sBAAsB,sCAAsC;AAC5D;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,0BAA0B,+BAA+B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,+BAA+B;AACzD;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,uBAAuB,oCAAoC;AAC3D;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,qBAAqB;AAC3C;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,sBAAsB,sCAAsC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,sBAAsB,sCAAsC;AAC5D;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,kBAAkB,iCAAiC;AACnD;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,kBAAkB,oCAAoC;AACtD;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;AACF;AACA,sBAAsB,+BAA+B;AACrD;AACA;AACA;AACA,EAAE;AACF;AACA,sBAAsB,+BAA+B;AACrD;AACA;AACA;AACA,EAAE;AACF;AACA,sBAAsB,kCAAkC;AACxD;AACA;AACA;AACA,EAAE;AACF;AACA,sBAAsB,kCAAkC;AACxD;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,YAAY;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,YAAY;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA,4EAA4E,EAAE;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,EAAE;AACzC,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,EAAE;AACzC,MAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,kFAAkF,EAAE;AACpF,oFAAoF,EAAE;AACtF,gFAAgF,EAAE;AAClF,kFAAkF,EAAE;AACpF,sFAAsF,EAAE;AACxF,qFAAqF,EAAE;AACvF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB,2CAA2C;AAChE,qBAAqB,4CAA4C;AACjE,qBAAqB,0CAA0C;AAC/D,sBAAsB,4CAA4C;AAClE,sBAAsB,8CAA8C;AACpE,sBAAsB,wCAAwC;AAC9D;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,yBAAyB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA,yBAAyB,sCAAsC;AAC/D;AACA;AACA,IAAI;AACJ;AACA;AACA,oBAAoB,6BAA6B;AACjD;AACA;AACA;AACA,oBAAoB,6BAA6B;AACjD;AACA;AACA;AACA,oBAAoB,6BAA6B;AACjD;AACA;AACA;AACA,oBAAoB,6BAA6B;AACjD;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["node_modules\\jsonix\\jsonix.js"],"sourcesContent":["var _jsonix_factory = function(_jsonix_xmldom, _jsonix_xmlhttprequest, _jsonix_fs)\r\n{\r\n\t// Complete Jsonix script is included below \nvar Jsonix = {\r\n\tsingleFile : true\r\n};\nJsonix.Util = {};\r\n\r\nJsonix.Util.extend = function(destination, source) {\r\n\tdestination = destination || {};\r\n\tif (source) {\r\n\t\t/*jslint forin: true */\r\n\t\tfor ( var property in source) {\r\n\t\t\tvar value = source[property];\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tdestination[property] = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * IE doesn't include the toString property when iterating over an\r\n\t\t * object's properties with the for(property in object) syntax.\r\n\t\t * Explicitly check if the source has its own toString property.\r\n\t\t */\r\n\r\n\t\t/*\r\n\t\t * FF/Windows < 2.0.0.13 reports \"Illegal operation on WrappedNative\r\n\t\t * prototype object\" when calling hawOwnProperty if the source object is\r\n\t\t * an instance of window.Event.\r\n\t\t */\r\n\r\n\t\t// REWORK\r\n\t\t// Node.js\r\n\t\tsourceIsEvt = typeof window !== 'undefined' && window !== null && typeof window.Event === \"function\" && source instanceof window.Event;\r\n\r\n\t\tif (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty('toString')) {\r\n\t\t\tdestination.toString = source.toString;\r\n\t\t}\r\n\t}\r\n\treturn destination;\r\n};\nJsonix.Class = function() {\r\n\tvar Class = function() {\r\n\t\tthis.initialize.apply(this, arguments);\r\n\t};\r\n\tvar extended = {};\r\n\tvar empty = function() {\r\n\t};\r\n\tvar parent, initialize, Type;\r\n\tfor (var i = 0, len = arguments.length; i < len; ++i) {\r\n\t\tType = arguments[i];\r\n\t\tif (typeof Type == \"function\") {\r\n\t\t\t// make the class passed as the first argument the superclass\r\n\t\t\tif (i === 0 && len > 1) {\r\n\t\t\t\tinitialize = Type.prototype.initialize;\r\n\t\t\t\t// replace the initialize method with an empty function,\r\n\t\t\t\t// because we do not want to create a real instance here\r\n\t\t\t\tType.prototype.initialize = empty;\r\n\t\t\t\t// the line below makes sure that the new class has a\r\n\t\t\t\t// superclass\r\n\t\t\t\textended = new Type();\r\n\t\t\t\t// restore the original initialize method\r\n\t\t\t\tif (initialize === undefined) {\r\n\t\t\t\t\tdelete Type.prototype.initialize;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tType.prototype.initialize = initialize;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// get the prototype of the superclass\r\n\t\t\tparent = Type.prototype;\r\n\t\t} else {\r\n\t\t\t// in this case we're extending with the prototype\r\n\t\t\tparent = Type;\r\n\t\t}\r\n\t\tJsonix.Util.extend(extended, parent);\r\n\t}\r\n\tClass.prototype = extended;\r\n\treturn Class;\r\n};\r\n\nJsonix.XML = {\r\n\t\tXMLNS_NS : 'http://www.w3.org/2000/xmlns/',\r\n\t\tXMLNS_P : 'xmlns'\r\n};\r\n\r\n\nJsonix.DOM = {\r\n\tisDomImplementationAvailable : function () {\r\n\t\tif (typeof _jsonix_xmldom !== 'undefined')\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t} else if (typeof document !== 'undefined' && Jsonix.Util.Type.exists(document.implementation) && Jsonix.Util.Type.isFunction(document.implementation.createDocument)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n\tcreateDocument : function() {\r\n\t\t// REWORK\r\n\t\t// Node.js\r\n\t\tif (typeof _jsonix_xmldom !== 'undefined')\r\n\t\t{\r\n\t\t\treturn new (_jsonix_xmldom.DOMImplementation)().createDocument();\r\n\t\t} else if (typeof document !== 'undefined' && Jsonix.Util.Type.exists(document.implementation) && Jsonix.Util.Type.isFunction(document.implementation.createDocument)) {\r\n\t\t\treturn document.implementation.createDocument('', '', null);\r\n\t\t} else if (typeof ActiveXObject !== 'undefined') {\r\n\t\t\treturn new ActiveXObject('MSXML2.DOMDocument');\r\n\t\t} else {\r\n\t\t\tthrow new Error('Error created the DOM document.');\r\n\t\t}\r\n\t},\r\n\tserialize : function(node) {\r\n\t\tJsonix.Util.Ensure.ensureExists(node);\r\n\t\t// REWORK\r\n\t\t// Node.js\r\n\t\tif (typeof _jsonix_xmldom !== 'undefined')\r\n\t\t{\r\n\t\t\treturn (new (_jsonix_xmldom).XMLSerializer()).serializeToString(node);\r\n\t\t} else if (Jsonix.Util.Type.exists(XMLSerializer)) {\r\n\t\t\treturn (new XMLSerializer()).serializeToString(node);\r\n\t\t} else if (Jsonix.Util.Type.exists(node.xml)) {\r\n\t\t\treturn node.xml;\r\n\t\t} else {\r\n\t\t\tthrow new Error('Could not serialize the node, neither XMLSerializer nor the [xml] property were found.');\r\n\t\t}\r\n\t},\r\n\tparse : function(text) {\r\n\t\tJsonix.Util.Ensure.ensureExists(text);\r\n\t\tif (typeof _jsonix_xmldom !== 'undefined')\r\n\t\t{\r\n\t\t\treturn (new (_jsonix_xmldom).DOMParser()).parseFromString(text, 'application/xml');\r\n\t\t} else if (typeof DOMParser != 'undefined') {\r\n\t\t\treturn (new DOMParser()).parseFromString(text, 'application/xml');\r\n\t\t} else if (typeof ActiveXObject != 'undefined') {\r\n\t\t\tvar doc = Jsonix.DOM.createDocument('', '');\r\n\t\t\tdoc.loadXML(text);\r\n\t\t\treturn doc;\r\n\t\t} else {\r\n\t\t\tvar url = 'data:text/xml;charset=utf-8,' + encodeURIComponent(text);\r\n\t\t\tvar request = new XMLHttpRequest();\r\n\t\t\trequest.open('GET', url, false);\r\n\t\t\tif (request.overrideMimeType) {\r\n\t\t\t\trequest.overrideMimeType(\"text/xml\");\r\n\t\t\t}\r\n\t\t\trequest.send(null);\r\n\t\t\treturn request.responseXML;\r\n\t\t}\r\n\t},\r\n\tload : function(url, callback, options) {\r\n\r\n\t\tvar request = Jsonix.Request.INSTANCE;\r\n\r\n\t\trequest.issue(\r\n\t\t\t\t\t\turl,\r\n\t\t\t\t\t\tfunction(transport) {\r\n\t\t\t\t\t\t\tvar result;\r\n\t\t\t\t\t\t\tif (Jsonix.Util.Type.exists(transport.responseXML) && Jsonix.Util.Type.exists(transport.responseXML.documentElement)) {\r\n\t\t\t\t\t\t\t\tresult = transport.responseXML;\r\n\t\t\t\t\t\t\t} else if (Jsonix.Util.Type.isString(transport.responseText)) {\r\n\t\t\t\t\t\t\t\tresult = Jsonix.DOM.parse(transport.responseText);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tthrow new Error('Response does not have valid [responseXML] or [responseText].');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcallback(result);\r\n\r\n\t\t\t\t\t\t}, function(transport) {\r\n\t\t\t\t\t\t\tthrow new Error('Could not retrieve XML from URL [' + url\t+ '].');\r\n\r\n\t\t\t\t\t\t}, options);\r\n\t},\r\n\txlinkFixRequired : null,\r\n\tisXlinkFixRequired : function ()\r\n\t{\r\n\t\tif (Jsonix.DOM.xlinkFixRequired === null)\r\n\t\t{\r\n\t\t\tif (typeof navigator === 'undefined')\r\n\t\t\t{\r\n\t\t\t\tJsonix.DOM.xlinkFixRequired = false;\r\n\t\t\t}\r\n\t\t\telse if (!!navigator.userAgent && (/Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor)))\r\n\t\t\t{\r\n\t\t\t\tvar doc = Jsonix.DOM.createDocument();\r\n\t\t\t\tvar el = doc.createElement('test');\r\n\t\t\t\tel.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', 'urn:test');\r\n\t\t\t\tdoc.appendChild(el);\r\n\t\t\t\tvar testString = Jsonix.DOM.serialize(doc);\r\n\t\t\t\tJsonix.DOM.xlinkFixRequired = (testString.indexOf('xmlns:xlink') === -1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tJsonix.DOM.xlinkFixRequired = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn Jsonix.DOM.xlinkFixRequired;\r\n\t}\r\n};\nJsonix.Request = Jsonix\r\n\t\t.Class({\r\n\t\t\t// REWORK\r\n\t\t\tfactories : [ function() {\r\n\t\t\t\treturn new XMLHttpRequest();\r\n\t\t\t}, function() {\r\n\t\t\t\treturn new ActiveXObject('Msxml2.XMLHTTP');\r\n\t\t\t}, function() {\r\n\t\t\t\treturn new ActiveXObject(\"Msxml2.XMLHTTP.6.0\");\r\n\t\t\t}, function() {\r\n\t\t\t\treturn new ActiveXObject(\"Msxml2.XMLHTTP.3.0\");\r\n\t\t\t}, function() {\r\n\t\t\t\treturn new ActiveXObject('Microsoft.XMLHTTP');\r\n\t\t\t}, function() {\r\n\t\t\t\t// Node.js\r\n\t\t\t\tif (typeof _jsonix_xmlhttprequest !== 'undefined')\r\n\t\t\t\t{\r\n\t\t\t\t\tvar XMLHttpRequest = _jsonix_xmlhttprequest.XMLHttpRequest;\r\n\t\t\t\t\treturn new XMLHttpRequest();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}],\r\n\t\t\tinitialize : function() {\r\n\t\t\t},\r\n\t\t\tissue : function(url, onSuccess, onFailure, options) {\r\n\t\t\t\tJsonix.Util.Ensure.ensureString(url);\r\n\t\t\t\tif (Jsonix.Util.Type.exists(onSuccess)) {\r\n\t\t\t\t\tJsonix.Util.Ensure.ensureFunction(onSuccess);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tonSuccess = function() {\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t\tif (Jsonix.Util.Type.exists(onFailure)) {\r\n\t\t\t\t\tJsonix.Util.Ensure.ensureFunction(onFailure);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tonFailure = function() {\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t\tif (Jsonix.Util.Type.exists(options)) {\r\n\t\t\t\t\tJsonix.Util.Ensure.ensureObject(options);\r\n\t\t\t\t} else {\r\n\t\t\t\t\toptions = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar transport = this.createTransport();\r\n\r\n\t\t\t\tvar method = Jsonix.Util.Type.isString(options.method) ? options.method\r\n\t\t\t\t\t\t: 'GET';\r\n\t\t\t\tvar async = Jsonix.Util.Type.isBoolean(options.async) ? options.async\r\n\t\t\t\t\t\t: true;\r\n\t\t\t\tvar proxy = Jsonix.Util.Type.isString(options.proxy) ? options.proxy\r\n\t\t\t\t\t\t: Jsonix.Request.PROXY;\r\n\r\n\t\t\t\tvar user = Jsonix.Util.Type.isString(options.user) ? options.user\r\n\t\t\t\t\t\t: null;\r\n\t\t\t\tvar password = Jsonix.Util.Type.isString(options.password) ? options.password\r\n\t\t\t\t\t\t: null;\r\n\r\n\t\t\t\tif (Jsonix.Util.Type.isString(proxy) && (url.indexOf(\"http\") === 0)) {\r\n\t\t\t\t\turl = proxy + encodeURIComponent(url);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (Jsonix.Util.Type.isString(user)) {\r\n\t\t\t\t\ttransport.open(method, url, async, user, password);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttransport.open(method, url, async);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (Jsonix.Util.Type.isObject(options.headers)) {\r\n\r\n\t\t\t\t\tfor ( var header in options.headers) {\r\n\t\t\t\t\t\tif (options.headers.hasOwnProperty(header)) {\r\n\t\t\t\t\t\t\ttransport.setRequestHeader(header,\r\n\t\t\t\t\t\t\t\t\toptions.headers[header]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar data = Jsonix.Util.Type.exists(options.data) ? options.data\r\n\t\t\t\t\t\t: null;\r\n\t\t\t\tif (!async) {\r\n\t\t\t\t\ttransport.send(data);\r\n\t\t\t\t\tthis.handleTransport(transport, onSuccess, onFailure);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar that = this;\r\n\t\t\t\t\tif (typeof window !== 'undefined') {\r\n\r\n\t\t\t\t\t\ttransport.onreadystatechange = function() {\r\n\t\t\t\t\t\t\tthat.handleTransport(transport, onSuccess,\r\n\t\t\t\t\t\t\t\t\tonFailure);\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\twindow.setTimeout(function() {\r\n\t\t\t\t\t\t\ttransport.send(data);\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\ttransport.onreadystatechange = function() {\r\n\t\t\t\t\t\t\tthat.handleTransport(transport, onSuccess, onFailure);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\ttransport.send(data);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn transport;\r\n\r\n\t\t\t},\r\n\t\t\thandleTransport : function(transport, onSuccess, onFailure) {\r\n\t\t\t\tif (transport.readyState == 4) {\r\n\t\t\t\t\tif (!transport.status || (transport.status >= 200 && transport.status < 300)) {\r\n\t\t\t\t\t\tonSuccess(transport);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (transport.status && (transport.status < 200 || transport.status >= 300)) {\r\n\t\t\t\t\t\tonFailure(transport);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tcreateTransport : function() {\r\n\t\t\t\tfor ( var index = 0, length = this.factories.length; index < length; index++) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tvar transport = this.factories[index]();\r\n\t\t\t\t\t\tif (transport !== null) {\r\n\t\t\t\t\t\t\treturn transport;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\t// TODO log\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthrow new Error('Could not create XML HTTP transport.');\r\n\t\t\t},\r\n\t\t\tCLASS_NAME : 'Jsonix.Request'\r\n\t\t});\r\nJsonix.Request.INSTANCE = new Jsonix.Request();\r\nJsonix.Request.PROXY = null;\nJsonix.Schema = {};\nJsonix.Model = {};\nJsonix.Util.Type = {\r\n\texists : function(value) {\r\n\t\treturn (typeof value !== 'undefined' && value !== null);\r\n\t},\r\n\tisUndefined : function(value) {\r\n\t\treturn typeof value === 'undefined';\r\n\t},\r\n\tisString : function(value) {\r\n\t\treturn typeof value === 'string';\r\n\t},\r\n\tisBoolean : function(value) {\r\n\t\treturn typeof value === 'boolean';\r\n\t},\r\n\tisObject : function(value) {\r\n\t\treturn typeof value === 'object';\r\n\t},\r\n\tisFunction : function(value) {\r\n\t\treturn typeof value === 'function';\r\n\t},\r\n\tisNumber : function(value) {\r\n\t\treturn (typeof value === 'number') && !isNaN(value);\r\n\t},\r\n\tisNumberOrNaN : function(value) {\r\n\t\treturn (value === +value) || (Object.prototype.toString.call(value) === '[object Number]');\r\n\t},\r\n\tisNaN : function(value) {\r\n\t\treturn Jsonix.Util.Type.isNumberOrNaN(value) && isNaN(value);\r\n\t},\r\n\tisArray : function(value) {\r\n\t\t// return value instanceof Array;\r\n\t\treturn !!(value && value.concat && value.unshift && !value.callee);\r\n\t},\r\n\tisDate : function(value) {\r\n\t\treturn !!(value && value.getTimezoneOffset && value.setUTCFullYear);\r\n\t},\r\n\tisRegExp : function(value) {\r\n\t\treturn !!(value && value.test && value.exec && (value.ignoreCase || value.ignoreCase === false));\r\n\t},\r\n\tisNode : function(value) {\r\n\t\treturn (typeof Node === \"object\" || typeof Node === \"function\") ? (value instanceof Node) : (value && (typeof value === \"object\") && (typeof value.nodeType === \"number\") && (typeof value.nodeName===\"string\"));\r\n\t},\r\n\tisEqual : function(a, b, report) {\r\n\t\tvar doReport = Jsonix.Util.Type.isFunction(report);\r\n\t\t// TODO rework\r\n\t\tvar _range = function(start, stop, step) {\r\n\t\t\tvar args = slice.call(arguments);\r\n\t\t\tvar solo = args.length <= 1;\r\n\t\t\tvar start_ = solo ? 0 : args[0];\r\n\t\t\tvar stop_ = solo ? args[0] : args[1];\r\n\t\t\tvar step_ = args[2] || 1;\r\n\t\t\tvar len = Math.max(Math.ceil((stop_ - start_) / step_), 0);\r\n\t\t\tvar idx = 0;\r\n\t\t\tvar range = new Array(len);\r\n\t\t\twhile (idx < len) {\r\n\t\t\t\trange[idx++] = start_;\r\n\t\t\t\tstart_ += step_;\r\n\t\t\t}\r\n\t\t\treturn range;\r\n\t\t};\r\n\r\n\t\tvar _keys = Object.keys || function(obj) {\r\n\t\t\tif (Jsonix.Util.Type.isArray(obj)) {\r\n\t\t\t\treturn _range(0, obj.length);\r\n\t\t\t}\r\n\t\t\tvar keys = [];\r\n\t\t\tfor ( var key in obj) {\r\n\t\t\t\tif (obj.hasOwnProperty(key)) {\r\n\t\t\t\t\tkeys[keys.length] = key;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn keys;\r\n\t\t};\r\n\r\n\t\t// Check object identity.\r\n\t\tif (a === b) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// Check if both are NaNs\r\n\t\tif (Jsonix.Util.Type.isNaN(a) && Jsonix.Util.Type.isNaN(b)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t// Different types?\r\n\t\tvar atype = typeof a;\r\n\t\tvar btype = typeof b;\r\n\t\tif (atype != btype) {\r\n\t\t\tif (doReport) {\r\n\t\t\t\treport('Types differ [' + atype + '], [' + btype + '].');\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// Basic equality test (watch out for coercions).\r\n\t\tif (a == b) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t// One is falsy and the other truthy.\r\n\t\tif ((!a && b) || (a && !b)) {\r\n\t\t\tif (doReport) {\r\n\t\t\t\treport('One is falsy, the other is truthy.');\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// Check dates' integer values.\r\n\t\tif (Jsonix.Util.Type.isDate(a) && Jsonix.Util.Type.isDate(b)) {\r\n\t\t\treturn a.getTime() === b.getTime();\r\n\t\t}\r\n\t\t// Both are NaN?\r\n\t\tif (Jsonix.Util.Type.isNaN(a) && Jsonix.Util.Type.isNaN(b)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// Compare regular expressions.\r\n\t\tif (Jsonix.Util.Type.isRegExp(a) && Jsonix.Util.Type.isRegExp(b)) {\r\n\t\t\treturn a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline;\r\n\t\t}\r\n\t\t\r\n\t\tif (Jsonix.Util.Type.isNode(a) && Jsonix.Util.Type.isNode(b))\r\n\t\t{\r\n\t\t\tvar aSerialized = Jsonix.DOM.serialize(a);\r\n\t\t\tvar bSerialized = Jsonix.DOM.serialize(b);\r\n\t\t\tif (aSerialized !== bSerialized)\r\n\t\t\t{\r\n\t\t\t\tif (doReport)\r\n\t\t\t\t{\r\n\t\t\t\t\treport('Nodes differ.');\r\n\t\t\t\t\treport('A=' + aSerialized);\r\n\t\t\t\t\treport('B=' + bSerialized);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// If a is not an object by this point, we can't handle it.\r\n\t\tif (atype !== 'object') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// Check for different array lengths before comparing contents.\r\n\t\tif (Jsonix.Util.Type.isArray(a) && (a.length !== b.length)) {\r\n\t\t\tif (doReport) {\r\n\t\t\t\t\treport('Lengths differ.');\r\n\t\t\t\t\treport('A.length=' + a.length);\r\n\t\t\t\t\treport('B.length=' + b.length);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// Nothing else worked, deep compare the contents.\r\n\t\tvar aKeys = _keys(a);\r\n\t\tvar bKeys = _keys(b);\r\n\t\t// Different object sizes?\r\n\t\tif (aKeys.length !== bKeys.length) {\r\n\t\t\tif (doReport) {\r\n\t\t\t\treport('Different number of properties [' + aKeys.length + '], [' + bKeys.length + '].');\r\n\t\t\t}\r\n\t\t\tfor ( var andex = 0; andex < aKeys.length; andex++) {\r\n\t\t\t\tif (doReport) {\r\n\t\t\t\t\treport('A [' + aKeys[andex] + ']=' + a[aKeys[andex]]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor ( var bndex = 0; bndex < bKeys.length; bndex++) {\r\n\t\t\t\tif (doReport) {\r\n\t\t\t\t\treport('B [' + bKeys[bndex] + ']=' + b[bKeys[bndex]]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// Recursive comparison of contents.\r\n\t\tfor (var kndex = 0; kndex < aKeys.length; kndex++) {\r\n\t\t\tvar key = aKeys[kndex];\r\n\t\t\tif (!(key in b) || !Jsonix.Util.Type.isEqual(a[key], b[key], report)) {\r\n\t\t\t\tif (doReport) {\r\n\t\t\t\t\treport('One of the properties differ.');\r\n\t\t\t\t\treport('Key: [' + key + '].');\r\n\t\t\t\t\treport('Left: [' + a[key] + '].');\r\n\t\t\t\t\treport('Right: [' + b[key] + '].');\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\tcloneObject : function (source, target)\r\n\t{\r\n\t\ttarget = target || {};\r\n\t\tfor (var p in source)\r\n\t\t{\r\n\t\t\tif (source.hasOwnProperty(p))\r\n\t\t\t{\r\n\t\t\t\ttarget[p] = source[p];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t},\r\n\tdefaultValue : function()\r\n\t{\r\n\t\tvar args = arguments;\r\n\t\tif (args.length === 0)\r\n\t\t{\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tvar defaultValue = args[args.length - 1];\r\n\t\t\tvar typeOfDefaultValue = typeof defaultValue;\r\n\t\t\tfor (var index = 0; index < args.length - 1; index++)\r\n\t\t\t{\r\n\t\t\t\tvar candidateValue = args[index];\r\n\t\t\t\tif (typeof candidateValue === typeOfDefaultValue)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn candidateValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn defaultValue;\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n};\nJsonix.Util.NumberUtils = {\r\n\tisInteger : function(value) {\r\n\t\treturn Jsonix.Util.Type.isNumber(value) && ((value % 1) === 0);\r\n\t}\r\n};\nJsonix.Util.StringUtils = {\r\n\ttrim : (!!String.prototype.trim) ?\r\n\tfunction(str) {\r\n\t\tJsonix.Util.Ensure.ensureString(str);\r\n\t\treturn str.trim();\r\n\t} :\r\n\tfunction(str) {\r\n\t\tJsonix.Util.Ensure.ensureString(str);\r\n\t\treturn str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n\t},\r\n\t/* isEmpty : function(str) {\r\n\t\tvar wcm = Jsonix.Util.StringUtils.whitespaceCharactersMap;\r\n\t\tfor (var index = 0; index < str.length; index++)\r\n\t\t{\r\n\t\t\tif (!wcm[str[index]])\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}, */\r\n\tisEmpty : function(str) {\r\n\t\tvar length = str.length;\r\n\t\tif (!length) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tfor (var index = 0; index < length; index++)\r\n\t\t{\r\n\t\t\tvar c = str[index];\r\n\t\t\tif (c === ' ')\r\n\t\t\t{\r\n\t\t\t\t// skip\r\n\t\t\t}\r\n\t\t\telse if (c > '\\u000D' && c < '\\u0085')\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse if (c < '\\u00A0')\r\n\t\t\t{\r\n\t\t\t\tif (c < '\\u0009')\r\n\t\t\t\t{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\telse if (c > '\\u0085')\r\n\t\t\t\t{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (c > '\\u00A0')\r\n\t\t\t{\r\n\t\t\t\tif (c < '\\u2028')\r\n\t\t\t\t{\r\n\t\t\t\t\tif (c < '\\u180E')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (c < '\\u1680')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(c > '\\u1680')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (c > '\\u180E')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (c < '\\u2000')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (c > '\\u200A')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (c > '\\u2029')\r\n\t\t\t\t{\r\n\t\t\t\t\tif (c < '\\u205F')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (c < '\\u202F')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (c > '\\u202F')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (c > '\\u205F')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (c < '\\u3000')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (c > '\\u3000')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\tisNotBlank : function(str) {\r\n\t\treturn Jsonix.Util.Type.isString(str) && !Jsonix.Util.StringUtils.isEmpty(str);\r\n\t},\r\n\twhitespaceCharacters: '\\u0009\\u000A\\u000B\\u000C\\u000D \\u0085\\u00A0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000',\r\n\twhitespaceCharactersMap: {\r\n\t\t'\\u0009' : true,\r\n\t\t'\\u000A' : true,\r\n\t\t'\\u000B' : true,\r\n\t\t'\\u000C' : true,\r\n\t\t'\\u000D' : true,\r\n\t\t' ' : true,\r\n\t\t'\\u0085' : true,\r\n\t\t'\\u00A0' : true,\r\n\t\t'\\u1680' : true,\r\n\t\t'\\u180E' : true,\r\n\t\t'\\u2000' : true,\r\n\t\t'\\u2001' : true,\r\n\t\t'\\u2002' : true,\r\n\t\t'\\u2003' : true,\r\n\t\t'\\u2004' : true,\r\n\t\t'\\u2005' : true,\r\n\t\t'\\u2006' : true,\r\n\t\t'\\u2007' : true,\r\n\t\t'\\u2008' : true,\r\n\t\t'\\u2009' : true,\r\n\t\t'\\u200A' : true,\r\n\t\t'\\u2028' : true,\r\n\t\t'\\u2029' : true,\r\n\t\t'\\u202F' : true,\r\n\t\t'\\u205F' : true,\r\n\t\t'\\u3000' : true\r\n\t},\r\n\tsplitBySeparatorChars : function(str, separatorChars) {\r\n\t\tJsonix.Util.Ensure.ensureString(str);\r\n\t\tJsonix.Util.Ensure.ensureString(separatorChars);\r\n\t\tvar len = str.length;\r\n\t\tif (len === 0) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\t\tif (separatorChars.length === 1)\r\n\t\t{\r\n\t\t\treturn str.split(separatorChars);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tvar list = [];\r\n\t\t\tvar sizePlus1 = 1;\r\n\t\t\tvar i = 0;\r\n\t\t\tvar start = 0;\r\n\t\t\tvar match = false;\r\n\t\t\tvar lastMatch = false;\r\n\t\t\tvar max = -1;\r\n\t\t\tvar preserveAllTokens = false;\r\n\t\t\t// standard case\r\n\t\t\t\twhile (i < len) {\r\n\t\t\t\t\t\tif (separatorChars.indexOf(str.charAt(i)) >= 0) {\r\n\t\t\t\t\t\t\t\tif (match || preserveAllTokens) {\r\n\t\t\t\t\t\t\t\t\t\tlastMatch = true;\r\n\t\t\t\t\t\t\t\t\t\tif (sizePlus1++ == max) {\r\n\t\t\t\t\t\t\t\t\t\t\t\ti = len;\r\n\t\t\t\t\t\t\t\t\t\t\t\tlastMatch = false;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tlist.push(str.substring(start, i));\r\n\t\t\t\t\t\t\t\t\t\tmatch = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstart = ++i;\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlastMatch = false;\r\n\t\t\t\t\t\tmatch = true;\r\n\t\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t\tif (match || (preserveAllTokens && lastMatch)) {\r\n\t\t\t\t\tlist.push(str.substring(start, i));\r\n\t\t\t}\r\n\t\t\treturn list;\r\n\t\t}\r\n\t}\r\n};\nJsonix.Util.Ensure = {\r\n\tensureBoolean : function(value) {\r\n\t\tif (!Jsonix.Util.Type.isBoolean(value)) {\r\n\t\t\tthrow new Error('Argument [' + value + '] must be a boolean.');\r\n\t\t}\r\n\t},\r\n\tensureString : function(value) {\r\n\t\tif (!Jsonix.Util.Type.isString(value)) {\r\n\t\t\tthrow new Error('Argument [' + value + '] must be a string.');\r\n\t\t}\r\n\t},\r\n\tensureNumber : function(value) {\r\n\t\tif (!Jsonix.Util.Type.isNumber(value)) {\r\n\t\t\tthrow new Error('Argument [' + value + '] must be a number.');\r\n\t\t}\r\n\t},\r\n\tensureNumberOrNaN : function(value) {\r\n\t\tif (!Jsonix.Util.Type.isNumberOrNaN(value)) {\r\n\t\t\tthrow new Error('Argument [' + value + '] must be a number or NaN.');\r\n\t\t}\r\n\t},\r\n\tensureInteger : function(value) {\r\n\t\tif (!Jsonix.Util.Type.isNumber(value)) {\r\n\t\t\tthrow new Error('Argument [' + value + '] must be an integer, but it is not a number.');\r\n\t\t} else if (!Jsonix.Util.NumberUtils.isInteger(value)) {\r\n\t\t\tthrow new Error('Argument [' + value + '] must be an integer.');\r\n\t\t}\r\n\t},\r\n\tensureDate : function(value) {\r\n\t\tif (!(value instanceof Date)) {\r\n\t\t\tthrow new Error('Argument [' + value + '] must be a date.');\r\n\t\t}\r\n\t},\r\n\tensureObject : function(value) {\r\n\t\tif (!Jsonix.Util.Type.isObject(value)) {\r\n\t\t\tthrow new Error('Argument [' + value + '] must be an object.');\r\n\t\t}\r\n\t},\r\n\tensureArray : function(value) {\r\n\t\tif (!Jsonix.Util.Type.isArray(value)) {\r\n\t\t\tthrow new Error('Argument [' + value + '] must be an array.');\r\n\t\t}\r\n\t},\r\n\tensureFunction : function(value) {\r\n\t\tif (!Jsonix.Util.Type.isFunction(value)) {\r\n\t\t\tthrow new Error('Argument [' + value + '] must be a function.');\r\n\t\t}\r\n\t},\r\n\tensureExists : function(value) {\r\n\t\tif (!Jsonix.Util.Type.exists(value)) {\r\n\t\t\tthrow new Error('Argument [' + value + '] does not exist.');\r\n\t\t}\r\n\t}\r\n};\nJsonix.XML.QName = Jsonix.Class({\r\n\tkey : null,\r\n\tnamespaceURI : null,\r\n\tlocalPart : null,\r\n\tprefix : null,\r\n\tstring : null,\r\n\tinitialize : function(one, two, three) {\r\n\t\tvar namespaceURI;\r\n\t\tvar localPart;\r\n\t\tvar prefix;\r\n\t\tvar key;\r\n\t\tvar string;\r\n\r\n\t\tif (!Jsonix.Util.Type.exists(two)) {\r\n\t\t\tnamespaceURI = '';\r\n\t\t\tlocalPart = one;\r\n\t\t\tprefix = '';\r\n\t\t} else if (!Jsonix.Util.Type.exists(three)) {\r\n\t\t\tnamespaceURI = Jsonix.Util.Type.exists(one) ? one : '';\r\n\t\t\tlocalPart = two;\r\n\t\t\tvar colonPosition = two.indexOf(':');\r\n\t\t\tif (colonPosition > 0 && colonPosition < two.length) {\r\n\t\t\t\tprefix = two.substring(0, colonPosition);\r\n\t\t\t\tlocalPart = two.substring(colonPosition + 1);\r\n\t\t\t} else {\r\n\t\t\t\tprefix = '';\r\n\t\t\t\tlocalPart = two;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tnamespaceURI = Jsonix.Util.Type.exists(one) ? one : '';\r\n\t\t\tlocalPart = two;\r\n\t\t\tprefix = Jsonix.Util.Type.exists(three) ? three : '';\r\n\t\t}\r\n\t\tthis.namespaceURI = namespaceURI;\r\n\t\tthis.localPart = localPart;\r\n\t\tthis.prefix = prefix;\r\n\r\n\t\tthis.key = (namespaceURI !== '' ? ('{' + namespaceURI + '}') : '') + localPart;\r\n\t\tthis.string = (namespaceURI !== '' ? ('{' + namespaceURI + '}') : '') + (prefix !== '' ? (prefix + ':') : '') + localPart;\r\n\t},\r\n\ttoString : function() {\r\n\t\treturn this.string;\r\n\t},\r\n\t// foo:bar\r\n\ttoCanonicalString: function(namespaceContext) {\r\n\t\tvar canonicalPrefix = namespaceContext ? namespaceContext.getPrefix(this.namespaceURI, this.prefix) : this.prefix;\r\n\t\treturn this.prefix + (this.prefix === '' ? '' : ':') + this.localPart;\r\n\t},\r\n\tclone : function() {\r\n\t\treturn new Jsonix.XML.QName(this.namespaceURI, this.localPart, this.prefix);\r\n\t},\r\n\tequals : function(that) {\r\n\t\tif (!that) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn (this.namespaceURI == that.namespaceURI) && (this.localPart == that.localPart);\r\n\t\t}\r\n\r\n\t},\r\n\tCLASS_NAME : \"Jsonix.XML.QName\"\r\n});\r\nJsonix.XML.QName.fromString = function(qNameAsString, namespaceContext, defaultNamespaceURI) {\r\n\tvar leftBracket = qNameAsString.indexOf('{');\r\n\tvar rightBracket = qNameAsString.lastIndexOf('}');\r\n\tvar namespaceURI;\r\n\tvar prefixedName;\r\n\tif ((leftBracket === 0) && (rightBracket > 0) && (rightBracket < qNameAsString.length)) {\r\n\t\tnamespaceURI = qNameAsString.substring(1, rightBracket);\r\n\t\tprefixedName = qNameAsString.substring(rightBracket + 1);\r\n\t} else {\r\n\t\tnamespaceURI = null;\r\n\t\tprefixedName = qNameAsString;\r\n\t}\r\n\tvar colonPosition = prefixedName.indexOf(':');\r\n\tvar prefix;\r\n\tvar localPart;\r\n\tif (colonPosition > 0 && colonPosition < prefixedName.length) {\r\n\t\tprefix = prefixedName.substring(0, colonPosition);\r\n\t\tlocalPart = prefixedName.substring(colonPosition + 1);\r\n\t} else {\r\n\t\tprefix = '';\r\n\t\tlocalPart = prefixedName;\r\n\t}\r\n\t// If namespace URI was not set and we have a namespace context, try to find the namespace URI via this context\r\n\tif (namespaceURI === null)\r\n\t{\r\n\t\tif (prefix === '' && Jsonix.Util.Type.isString(defaultNamespaceURI))\r\n\t\t{\r\n\t\t\tnamespaceURI = defaultNamespaceURI;\r\n\t\t}\r\n\t\telse if (namespaceContext)\r\n\t\t{\r\n\t\t\tnamespaceURI = namespaceContext.getNamespaceURI(prefix);\r\n\t\t}\r\n\t}\r\n\t// If we don't have a namespace URI, assume '' by default\r\n\t// TODO document the assumption\r\n\tif (!Jsonix.Util.Type.isString(namespaceURI))\r\n\t{\r\n\t\tnamespaceURI = defaultNamespaceURI || '';\r\n\t}\r\n\treturn new Jsonix.XML.QName(namespaceURI, localPart, prefix);\r\n};\r\nJsonix.XML.QName.fromObject = function(object) {\r\n\tJsonix.Util.Ensure.ensureObject(object);\r\n\tif (object instanceof Jsonix.XML.QName || (Jsonix.Util.Type.isString(object.CLASS_NAME) && object.CLASS_NAME === 'Jsonix.XML.QName')) {\r\n\t\treturn object;\r\n\t}\r\n\tvar localPart = object.localPart||object.lp||null;\r\n\tJsonix.Util.Ensure.ensureString(localPart);\r\n\tvar namespaceURI = object.namespaceURI||object.ns||'';\r\n\tvar prefix = object.prefix||object.p||'';\r\n\treturn new Jsonix.XML.QName(namespaceURI, localPart, prefix);\r\n};\r\nJsonix.XML.QName.fromObjectOrString = function(value, namespaceContext, defaultNamespaceURI) {\r\n\tif (Jsonix.Util.Type.isString(value))\r\n\t{\r\n\t\treturn Jsonix.XML.QName.fromString(value, namespaceContext, defaultNamespaceURI);\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn Jsonix.XML.QName.fromObject(value);\r\n\t}\r\n};\r\nJsonix.XML.QName.key = function(namespaceURI, localPart) {\r\n\tJsonix.Util.Ensure.ensureString(localPart);\r\n\tif (namespaceURI) {\r\n\t\tvar colonPosition = localPart.indexOf(':');\r\n\t\tvar localName;\r\n\t\tif (colonPosition > 0 && colonPosition < localPart.length) {\r\n\t\t\tlocalName = localPart.substring(colonPosition + 1);\r\n\t\t} else {\r\n\t\t\tlocalName = localPart;\r\n\t\t}\r\n\t\treturn '{' + namespaceURI + '}' + localName;\r\n\t} else {\r\n\t\treturn localPart;\r\n\t}\r\n};\nJsonix.XML.Calendar = Jsonix.Class({\r\n\tyear : NaN,\r\n\tmonth : NaN,\r\n\tday : NaN,\r\n\thour : NaN,\r\n\tminute : NaN,\r\n\tsecond : NaN,\r\n\tfractionalSecond : NaN,\r\n\ttimezone : NaN,\r\n\tdate : null,\r\n\tinitialize : function(data) {\r\n\t\tJsonix.Util.Ensure.ensureObject(data);\r\n\t\t// Year\r\n\t\tif (Jsonix.Util.Type.exists(data.year)) {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(data.year);\r\n\t\t\tJsonix.XML.Calendar.validateYear(data.year);\r\n\t\t\tthis.year = data.year;\r\n\t\t} else {\r\n\t\t\tthis.year = NaN;\r\n\t\t}\r\n\t\t// Month\r\n\t\tif (Jsonix.Util.Type.exists(data.month)) {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(data.month);\r\n\t\t\tJsonix.XML.Calendar.validateMonth(data.month);\r\n\t\t\tthis.month = data.month;\r\n\t\t} else {\r\n\t\t\tthis.month = NaN;\r\n\t\t}\r\n\t\t// Day\r\n\t\tif (Jsonix.Util.Type.exists(data.day)) {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(data.day);\r\n\t\t\tif (Jsonix.Util.NumberUtils.isInteger(data.year) && Jsonix.Util.NumberUtils.isInteger(data.month)) {\r\n\t\t\t\tJsonix.XML.Calendar.validateYearMonthDay(data.year, data.month, data.day);\r\n\t\t\t} else if (Jsonix.Util.NumberUtils.isInteger(data.month)) {\r\n\t\t\t\tJsonix.XML.Calendar.validateMonthDay(data.month, data.day);\r\n\t\t\t} else {\r\n\t\t\t\tJsonix.XML.Calendar.validateDay(data.day);\r\n\t\t\t}\r\n\t\t\tthis.day = data.day;\r\n\t\t} else {\r\n\t\t\tthis.day = NaN;\r\n\t\t}\r\n\t\t// Hour\r\n\t\tif (Jsonix.Util.Type.exists(data.hour)) {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(data.hour);\r\n\t\t\tJsonix.XML.Calendar.validateHour(data.hour);\r\n\t\t\tthis.hour = data.hour;\r\n\t\t} else {\r\n\t\t\tthis.hour = NaN;\r\n\t\t}\r\n\t\t// Minute\r\n\t\tif (Jsonix.Util.Type.exists(data.minute)) {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(data.minute);\r\n\t\t\tJsonix.XML.Calendar.validateMinute(data.minute);\r\n\t\t\tthis.minute = data.minute;\r\n\t\t} else {\r\n\t\t\tthis.minute = NaN;\r\n\t\t}\r\n\t\t// Second\r\n\t\tif (Jsonix.Util.Type.exists(data.second)) {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(data.second);\r\n\t\t\tJsonix.XML.Calendar.validateSecond(data.second);\r\n\t\t\tthis.second = data.second;\r\n\t\t} else {\r\n\t\t\tthis.second = NaN;\r\n\t\t}\r\n\t\t// Fractional second\r\n\t\tif (Jsonix.Util.Type.exists(data.fractionalSecond)) {\r\n\t\t\tJsonix.Util.Ensure.ensureNumber(data.fractionalSecond);\r\n\t\t\tJsonix.XML.Calendar.validateFractionalSecond(data.fractionalSecond);\r\n\t\t\tthis.fractionalSecond = data.fractionalSecond;\r\n\t\t} else {\r\n\t\t\tthis.fractionalSecond = NaN;\r\n\t\t}\r\n\t\t// Timezone\r\n\t\tif (Jsonix.Util.Type.exists(data.timezone)) {\r\n\t\t\tif (Jsonix.Util.Type.isNaN(data.timezone)) {\r\n\t\t\t\tthis.timezone = NaN;\r\n\t\t\t} else {\r\n\t\t\t\tJsonix.Util.Ensure.ensureInteger(data.timezone);\r\n\t\t\t\tJsonix.XML.Calendar.validateTimezone(data.timezone);\r\n\t\t\t\tthis.timezone = data.timezone;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthis.timezone = NaN;\r\n\t\t}\r\n\r\n\t\tvar initialDate = new Date(0);\r\n\t\tinitialDate.setUTCFullYear(this.year || 1970);\r\n\t\tinitialDate.setUTCMonth(this.month - 1 || 0);\r\n\t\tinitialDate.setUTCDate(this.day || 1);\r\n\t\tinitialDate.setUTCHours(this.hour || 0);\r\n\t\tinitialDate.setUTCMinutes(this.minute || 0);\r\n\t\tinitialDate.setUTCSeconds(this.second || 0);\r\n\t\tinitialDate.setUTCMilliseconds((this.fractionalSecond || 0) * 1000);\r\n\t\tvar timezoneOffset = -60000 * (this.timezone || 0);\r\n\t\tthis.date = new Date(initialDate.getTime() + timezoneOffset);\r\n\t},\r\n\tCLASS_NAME : \"Jsonix.XML.Calendar\"\r\n});\r\nJsonix.XML.Calendar.MIN_TIMEZONE = -14 * 60;\r\nJsonix.XML.Calendar.MAX_TIMEZONE = 14 * 60;\r\nJsonix.XML.Calendar.DAYS_IN_MONTH = [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];\r\nJsonix.XML.Calendar.fromObject = function(object) {\r\n\tJsonix.Util.Ensure.ensureObject(object);\r\n\tif (Jsonix.Util.Type.isString(object.CLASS_NAME) && object.CLASS_NAME === 'Jsonix.XML.Calendar') {\r\n\t\treturn object;\r\n\t}\r\n\treturn new Jsonix.XML.Calendar(object);\r\n};\r\nJsonix.XML.Calendar.validateYear = function(year) {\r\n\tif (year === 0) {\r\n\t\tthrow new Error('Invalid year [' + year + ']. Year must not be [0].');\r\n\t}\r\n};\r\nJsonix.XML.Calendar.validateMonth = function(month) {\r\n\tif (month < 1 || month > 12) {\r\n\t\tthrow new Error('Invalid month [' + month + ']. Month must be in range [1, 12].');\r\n\t}\r\n};\r\nJsonix.XML.Calendar.validateDay = function(day) {\r\n\tif (day < 1 || day > 31) {\r\n\t\tthrow new Error('Invalid day [' + day + ']. Day must be in range [1, 31].');\r\n\t}\r\n};\r\nJsonix.XML.Calendar.validateMonthDay = function(month, day) {\r\n\tJsonix.XML.Calendar.validateMonth(month);\r\n\tvar maxDaysInMonth = Jsonix.XML.Calendar.DAYS_IN_MONTH[month - 1];\r\n\tif (day < 1 || day > Jsonix.XML.Calendar.DAYS_IN_MONTH[month - 1]) {\r\n\t\tthrow new Error('Invalid day [' + day + ']. Day must be in range [1, ' + maxDaysInMonth + '].');\r\n\t}\r\n};\r\nJsonix.XML.Calendar.validateYearMonthDay = function(year, month, day) {\r\n\t// #93 TODO proper validation of 28/29 02\r\n\tJsonix.XML.Calendar.validateYear(year);\r\n\tJsonix.XML.Calendar.validateMonthDay(month, day);\r\n};\r\nJsonix.XML.Calendar.validateHour = function(hour) {\r\n\tif (hour < 0 || hour > 23) {\r\n\t\tthrow new Error('Invalid hour [' + hour + ']. Hour must be in range [0, 23].');\r\n\t}\r\n};\r\nJsonix.XML.Calendar.validateMinute = function(minute) {\r\n\tif (minute < 0 || minute > 59) {\r\n\t\tthrow new Error('Invalid minute [' + minute + ']. Minute must be in range [0, 59].');\r\n\t}\r\n};\r\nJsonix.XML.Calendar.validateSecond = function(second) {\r\n\tif (second < 0 || second > 59) {\r\n\t\tthrow new Error('Invalid second [' + second + ']. Second must be in range [0, 59].');\r\n\t}\r\n};\r\nJsonix.XML.Calendar.validateFractionalSecond = function(fractionalSecond) {\r\n\tif (fractionalSecond < 0 || fractionalSecond > 59) {\r\n\t\tthrow new Error('Invalid fractional second [' + fractionalSecond + ']. Fractional second must be in range [0, 1).');\r\n\t}\r\n};\r\nJsonix.XML.Calendar.validateTimezone = function(timezone) {\r\n\tif (timezone < Jsonix.XML.Calendar.MIN_TIMEZONE || timezone > Jsonix.XML.Calendar.MAX_TIMEZONE) {\r\n\t\tthrow new Error('Invalid timezone [' + timezone + ']. Timezone must not be in range [' + Jsonix.XML.Calendar.MIN_TIMEZONE + ', ' + Jsonix.XML.Calendar.MAX_TIMEZONE + '].');\r\n\t}\r\n};\nJsonix.XML.Input = Jsonix.Class({\r\n\troot : null,\r\n\tnode : null,\r\n\tattributes : null,\r\n\teventType : null,\r\n\tpns : null,\r\n\tinitialize : function(node) {\r\n\t\tJsonix.Util.Ensure.ensureExists(node);\r\n\t\tthis.root = node;\r\n\t\tvar rootPnsItem =\r\n\t\t{\r\n\t\t\t'' : ''\r\n\t\t};\r\n\t\trootPnsItem[Jsonix.XML.XMLNS_P] = Jsonix.XML.XMLNS_NS;\r\n\t\tthis.pns = [rootPnsItem];\r\n\t},\r\n\thasNext : function() {\r\n\t\t// No current node, we've not started yet\r\n\t\tif (this.node === null) {\r\n\t\t\treturn true;\r\n\t\t} else if (this.node === this.root) {\r\n\t\t\tvar nodeType = this.node.nodeType;\r\n\t\t\t// Root node is document, last event type is END_DOCUMENT\r\n\t\t\tif (nodeType === 9 && this.eventType === 8) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Root node is element, last event type is END_ELEMENT\r\n\t\t\telse if (nodeType === 1 && this.eventType === 2) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t},\r\n\tnext : function() {\r\n\t\tif (this.eventType === null) {\r\n\t\t\treturn this.enter(this.root);\r\n\t\t}\r\n\t\t// START_DOCUMENT\r\n\t\tif (this.eventType === 7) {\r\n\t\t\tvar documentElement = this.node.documentElement;\r\n\t\t\tif (documentElement) {\r\n\t\t\t\treturn this.enter(documentElement);\r\n\t\t\t} else {\r\n\t\t\t\treturn this.leave(this.node);\r\n\t\t\t}\r\n\t\t} else if (this.eventType === 1) {\r\n\t\t\tvar firstChild = this.node.firstChild;\r\n\t\t\tif (firstChild) {\r\n\t\t\t\treturn this.enter(firstChild);\r\n\t\t\t} else {\r\n\t\t\t\treturn this.leave(this.node);\r\n\t\t\t}\r\n\t\t} else if (this.eventType === 2) {\r\n\t\t\tvar nextSibling = this.node.nextSibling;\r\n\t\t\tif (nextSibling) {\r\n\t\t\t\treturn this.enter(nextSibling);\r\n\t\t\t} else {\r\n\t\t\t\treturn this.leave(this.node);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn this.leave(this.node);\r\n\t\t}\r\n\t},\r\n\tenter : function(node) {\r\n\t\tvar nodeType = node.nodeType;\r\n\t\tthis.node = node;\r\n\t\tthis.attributes = null;\r\n\t\t// Document node\r\n\t\tif (nodeType === 1) {\r\n\t\t\t// START_ELEMENT\r\n\t\t\tthis.eventType = 1;\r\n\t\t\tthis.pushNS(node);\r\n\t\t\treturn this.eventType;\r\n\t\t} else if (nodeType === 2) {\r\n\t\t\t// ATTRIBUTE\r\n\t\t\tthis.eventType = 10;\r\n\t\t\treturn this.eventType;\r\n\t\t} else if (nodeType === 3) {\r\n\t\t\tvar nodeValue = node.nodeValue;\r\n\t\t\tif (Jsonix.Util.StringUtils.isEmpty(nodeValue)) {\r\n\t\t\t\t// SPACE\r\n\t\t\t\tthis.eventType = 6;\r\n\t\t\t} else {\r\n\t\t\t\t// CHARACTERS\r\n\t\t\t\tthis.eventType = 4;\r\n\t\t\t}\r\n\t\t\treturn this.eventType;\r\n\t\t} else if (nodeType === 4) {\r\n\t\t\t// CDATA\r\n\t\t\tthis.eventType = 12;\r\n\t\t\treturn this.eventType;\r\n\t\t} else if (nodeType === 5) {\r\n\t\t\t// ENTITY_REFERENCE_NODE = 5\r\n\t\t\t// ENTITY_REFERENCE\r\n\t\t\tthis.eventType = 9;\r\n\t\t\treturn this.eventType;\r\n\t\t} else if (nodeType === 6) {\r\n\t\t\t// ENTITY_DECLARATION\r\n\t\t\tthis.eventType = 15;\r\n\t\t\treturn this.eventType;\r\n\t\t} else if (nodeType === 7) {\r\n\t\t\t// PROCESSING_INSTRUCTION\r\n\t\t\tthis.eventType = 3;\r\n\t\t\treturn this.eventType;\r\n\t\t} else if (nodeType === 8) {\r\n\t\t\t// COMMENT\r\n\t\t\tthis.eventType = 5;\r\n\t\t\treturn this.eventType;\r\n\t\t} else if (nodeType === 9) {\r\n\t\t\t// START_DOCUMENT\r\n\t\t\tthis.eventType = 7;\r\n\t\t\treturn this.eventType;\r\n\t\t} else if (nodeType === 10) {\r\n\t\t\t// DTD\r\n\t\t\tthis.eventType = 12;\r\n\t\t\treturn this.eventType;\r\n\t\t} else if (nodeType === 12) {\r\n\t\t\t// NOTATION_DECLARATION\r\n\t\t\tthis.eventType = 14;\r\n\t\t\treturn this.eventType;\r\n\t\t} else {\r\n\t\t\t// DOCUMENT_FRAGMENT_NODE = 11\r\n\t\t\tthrow new Error(\"Node type [\" + nodeType + '] is not supported.');\r\n\t\t}\r\n\t},\r\n\tleave : function(node) {\r\n\t\tif (node.nodeType === 9) {\r\n\t\t\tif (this.eventType == 8) {\r\n\t\t\t\tthrow new Error(\"Invalid state.\");\r\n\t\t\t} else {\r\n\t\t\t\tthis.node = node;\r\n\t\t\t\tthis.attributes = null;\r\n\t\t\t\t// END_ELEMENT\r\n\t\t\t\tthis.eventType = 8;\r\n\t\t\t\treturn this.eventType;\r\n\t\t\t}\r\n\t\t} else if (node.nodeType === 1) {\r\n\t\t\tif (this.eventType == 2) {\r\n\t\t\t\tvar nextSibling = node.nextSibling;\r\n\t\t\t\tif (nextSibling) {\r\n\t\t\t\t\treturn this.enter(nextSibling);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthis.node = node;\r\n\t\t\t\tthis.attributes = null;\r\n\t\t\t\t// END_ELEMENT\r\n\t\t\t\tthis.eventType = 2;\r\n\t\t\t\tthis.popNS();\r\n\t\t\t\treturn this.eventType;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar nextSibling1 = node.nextSibling;\r\n\t\tif (nextSibling1) {\r\n\t\t\treturn this.enter(nextSibling1);\r\n\t\t} else {\r\n\t\t\tvar parentNode = node.parentNode;\r\n\t\t\tthis.node = parentNode;\r\n\t\t\tthis.attributes = null;\r\n\t\t\tif (parentNode.nodeType === 9) {\r\n\t\t\t\tthis.eventType = 8;\r\n\t\t\t} else {\r\n\t\t\t\tthis.eventType = 2;\r\n\t\t\t}\r\n\t\t\treturn this.eventType;\r\n\t\t}\r\n\t},\r\n\tgetName : function() {\r\n\t\tvar node = this.node;\r\n\t\tif (Jsonix.Util.Type.isString(node.nodeName)) {\r\n\t\t\tif (Jsonix.Util.Type.isString(node.namespaceURI)) {\r\n\t\t\t\treturn new Jsonix.XML.QName(node.namespaceURI, node.nodeName);\r\n\t\t\t} else {\r\n\t\t\t\treturn new Jsonix.XML.QName(node.nodeName);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t},\r\n\tgetNameKey : function() {\r\n\t\tvar node = this.node;\r\n\t\tif (Jsonix.Util.Type.isString(node.nodeName)) {\r\n\t\t\treturn Jsonix.XML.QName.key(node.namespaceURI, node.nodeName);\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t},\r\n\tgetText : function() {\r\n\t\treturn this.node.nodeValue;\r\n\t},\r\n\tnextTag : function() {\r\n\t\tvar et = this.next();\r\n\t\t// TODO isWhiteSpace\r\n\t\twhile (et === 7 || et === 4 || et === 12 || et === 6 || et === 3 || et === 5) {\r\n\t\t\tet = this.next();\r\n\t\t}\r\n\t\tif (et !== 1 && et !== 2) {\r\n\t\t\t// TODO location\r\n\t\t\tthrow new Error('Expected start or end tag.');\r\n\t\t}\r\n\t\treturn et;\r\n\t},\r\n\tskipElement : function() {\r\n\t\tif (this.eventType !== Jsonix.XML.Input.START_ELEMENT) {\r\n\t\t\tthrow new Error(\"Parser must be on START_ELEMENT to skip element.\");\r\n\t\t}\r\n\t\tvar numberOfOpenTags = 1;\r\n\t\tvar et;\r\n\t\tdo {\r\n\t\t\tet = this.nextTag();\r\n\t\t numberOfOpenTags += (et === Jsonix.XML.Input.START_ELEMENT) ? 1 : -1;\r\n\t\t } while (numberOfOpenTags > 0);\r\n\t\treturn et;\r\n\t},\t\r\n\tgetElementText : function() {\r\n\t\tif (this.eventType != 1) {\r\n\t\t\tthrow new Error(\"Parser must be on START_ELEMENT to read next text.\");\r\n\t\t}\r\n\t\tvar et = this.next();\r\n\t\tvar content = '';\r\n\t\twhile (et !== 2) {\r\n\t\t\tif (et === 4 || et === 12 || et === 6 || et === 9) {\r\n\t\t\t\tcontent = content + this.getText();\r\n\t\t\t} else if (et === 3 || et === 5) {\r\n\t\t\t\t// Skip PI or comment\r\n\t\t\t} else if (et === 8) {\r\n\t\t\t\t// End document\r\n\t\t\t\tthrow new Error(\"Unexpected end of document when reading element text content.\");\r\n\t\t\t} else if (et === 1) {\r\n\t\t\t\t// End element\r\n\t\t\t\t// TODO location\r\n\t\t\t\tthrow new Error(\"Element text content may not contain START_ELEMENT.\");\r\n\t\t\t} else {\r\n\t\t\t\t// TODO location\r\n\t\t\t\tthrow new Error(\"Unexpected event type [\" + et + \"].\");\r\n\t\t\t}\r\n\t\t\tet = this.next();\r\n\t\t}\r\n\t\treturn content;\r\n\t},\r\n\tretrieveElement : function () {\r\n\t\tvar element;\r\n\t\tif (this.eventType === 1) {\r\n\t\t\telement = this.node;\r\n\t\t} else if (this.eventType === 10) {\r\n\t\t\telement = this.node.parentNode;\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Element can only be retrieved for START_ELEMENT or ATTRIBUTE nodes.\");\r\n\t\t}\r\n\t\treturn element;\r\n\t},\r\n\tretrieveAttributes : function () {\r\n\t\tvar attributes;\r\n\t\tif (this.attributes)\r\n\t\t{\r\n\t\t\tattributes = this.attributes;\r\n\t\t} else if (this.eventType === 1) {\r\n\t\t\tattributes = this.node.attributes;\r\n\t\t\tthis.attributes = attributes;\r\n\t\t} else if (this.eventType === 10) {\r\n\t\t\tattributes = this.node.parentNode.attributes;\r\n\t\t\tthis.attributes = attributes;\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Attributes can only be retrieved for START_ELEMENT or ATTRIBUTE nodes.\");\r\n\t\t}\r\n\t\treturn attributes;\r\n\t},\r\n\tgetAttributeCount : function() {\r\n\t\tvar attributes = this.retrieveAttributes();\r\n\t\treturn attributes.length;\r\n\t},\r\n\tgetAttributeName : function(index) {\r\n\t\tvar attributes = this.retrieveAttributes();\r\n\t\tif (index < 0 || index >= attributes.length) {\r\n\t\t\tthrow new Error(\"Invalid attribute index [\" + index + \"].\");\r\n\t\t}\r\n\t\tvar attribute = attributes[index];\r\n\t\tif (Jsonix.Util.Type.isString(attribute.namespaceURI)) {\r\n\t\t\treturn new Jsonix.XML.QName(attribute.namespaceURI, attribute.nodeName);\r\n\t\t} else {\r\n\t\t\treturn new Jsonix.XML.QName(attribute.nodeName);\r\n\t\t}\r\n\t},\r\n\tgetAttributeNameKey : function(index) {\r\n\t\tvar attributes = this.retrieveAttributes();\r\n\t\tif (index < 0 || index >= attributes.length) {\r\n\t\t\tthrow new Error(\"Invalid attribute index [\" + index + \"].\");\r\n\t\t}\r\n\t\tvar attribute = attributes[index];\r\n\r\n\t\treturn Jsonix.XML.QName.key(attribute.namespaceURI, attribute.nodeName);\r\n\t},\r\n\tgetAttributeValue : function(index) {\r\n\t\tvar attributes = this.retrieveAttributes();\r\n\t\tif (index < 0 || index >= attributes.length) {\r\n\t\t\tthrow new Error(\"Invalid attribute index [\" + index + \"].\");\r\n\t\t}\r\n\t\tvar attribute = attributes[index];\r\n\t\treturn attribute.value;\r\n\t},\r\n\tgetAttributeValueNS : null,\r\n\tgetAttributeValueNSViaElement : function(namespaceURI, localPart) {\r\n\t\tvar element = this.retrieveElement();\r\n\t\treturn element.getAttributeNS(namespaceURI, localPart);\r\n\t},\r\n\tgetAttributeValueNSViaAttribute : function(namespaceURI, localPart) {\r\n\t\tvar attributeNode = this.getAttributeNodeNS(namespaceURI, localPart);\r\n\t\tif (Jsonix.Util.Type.exists(attributeNode)) {\r\n\t\t\treturn attributeNode.nodeValue;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t},\r\n\tgetAttributeNodeNS : null,\r\n\tgetAttributeNodeNSViaElement : function(namespaceURI, localPart) {\r\n\t\tvar element = this.retrieveElement();\r\n\t\treturn element.getAttributeNodeNS(namespaceURI, localPart);\r\n\t},\r\n\tgetAttributeNodeNSViaAttributes : function(namespaceURI, localPart) {\r\n\t\tvar attributeNode = null;\r\n\t\tvar attributes = this.retrieveAttributes();\r\n\t\tvar potentialNode, fullName;\r\n\t\tfor (var i = 0, len = attributes.length; i < len; ++i) {\r\n\t\t\tpotentialNode = attributes[i];\r\n\t\t\tif (potentialNode.namespaceURI === namespaceURI) {\r\n\t\t\t\tfullName = (potentialNode.prefix) ? (potentialNode.prefix + ':' + localPart) : localPart;\r\n\t\t\t\tif (fullName === potentialNode.nodeName) {\r\n\t\t\t\t\tattributeNode = potentialNode;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn attributeNode;\r\n\t},\r\n\tgetElement : function() {\r\n\t\tif (this.eventType === 1 || this.eventType === 2) {\r\n\t\t\t// Go to the END_ELEMENT\r\n\t\t\tthis.eventType = 2;\r\n\t\t\treturn this.node;\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Parser must be on START_ELEMENT or END_ELEMENT to return current element.\");\r\n\t\t}\r\n\t},\r\n\tpushNS : function (node) {\r\n\t\tvar pindex = this.pns.length - 1;\r\n\t\tvar parentPnsItem = this.pns[pindex];\r\n\t\tvar pnsItem = Jsonix.Util.Type.isObject(parentPnsItem) ? pindex : parentPnsItem;\r\n\t\tthis.pns.push(pnsItem);\r\n\t\tpindex++;\r\n\t\tvar reference = true;\r\n\t\tif (node.attributes)\r\n\t\t{\r\n\t\t\tvar attributes = node.attributes;\r\n\t\t\tvar alength = attributes.length;\r\n\t\t\tif (alength > 0)\r\n\t\t\t{\r\n\t\t\t\t// If given node has attributes\r\n\t\t\t\tfor (var aindex = 0; aindex < alength; aindex++)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar attribute = attributes[aindex];\r\n\t\t\t\t\tvar attributeName = attribute.nodeName;\r\n\t\t\t\t\tvar p = null;\r\n\t\t\t\t\tvar ns = null;\r\n\t\t\t\t\tvar isNS = false;\r\n\t\t\t\t\tif (attributeName === 'xmlns')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tp = '';\r\n\t\t\t\t\t\tns = attribute.value;\r\n\t\t\t\t\t\tisNS = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (attributeName.substring(0, 6) === 'xmlns:')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tp = attributeName.substring(6);\r\n\t\t\t\t\t\tns = attribute.value;\r\n\t\t\t\t\t\tisNS = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Attribute is a namespace declaration\r\n\t\t\t\t\tif (isNS)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (reference)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tpnsItem = Jsonix.Util.Type.cloneObject(this.pns[pnsItem], {});\r\n\t\t\t\t\t\t\tthis.pns[pindex] = pnsItem;\r\n\t\t\t\t\t\t\treference = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tpnsItem[p] = ns;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t},\r\n\tpopNS : function () {\r\n\t\tthis.pns.pop();\r\n\t},\r\n\tgetNamespaceURI : function (p) {\r\n\t\tvar pindex = this.pns.length - 1;\r\n\t\tvar pnsItem = this.pns[pindex];\r\n\t\tpnsItem = Jsonix.Util.Type.isObject(pnsItem) ? pnsItem : this.pns[pnsItem];\r\n\t\treturn pnsItem[p];\r\n\t},\r\n\tCLASS_NAME : \"Jsonix.XML.Input\"\r\n\r\n});\r\n\r\nJsonix.XML.Input.prototype.getAttributeValueNS = (Jsonix.DOM.isDomImplementationAvailable()) ? Jsonix.XML.Input.prototype.getAttributeValueNSViaElement : Jsonix.XML.Input.prototype.getAttributeValueNSViaAttribute;\r\nJsonix.XML.Input.prototype.getAttributeNodeNS = (Jsonix.DOM.isDomImplementationAvailable()) ? Jsonix.XML.Input.prototype.getAttributeNodeNSViaElement : Jsonix.XML.Input.prototype.getAttributeNodeNSViaAttributes;\r\n\r\nJsonix.XML.Input.START_ELEMENT = 1;\r\nJsonix.XML.Input.END_ELEMENT = 2;\r\nJsonix.XML.Input.PROCESSING_INSTRUCTION = 3;\r\nJsonix.XML.Input.CHARACTERS = 4;\r\nJsonix.XML.Input.COMMENT = 5;\r\nJsonix.XML.Input.SPACE = 6;\r\nJsonix.XML.Input.START_DOCUMENT = 7;\r\nJsonix.XML.Input.END_DOCUMENT = 8;\r\nJsonix.XML.Input.ENTITY_REFERENCE = 9;\r\nJsonix.XML.Input.ATTRIBUTE = 10;\r\nJsonix.XML.Input.DTD = 11;\r\nJsonix.XML.Input.CDATA = 12;\r\nJsonix.XML.Input.NAMESPACE = 13;\r\nJsonix.XML.Input.NOTATION_DECLARATION = 14;\r\nJsonix.XML.Input.ENTITY_DECLARATION = 15;\r\n\nJsonix.XML.Output = Jsonix.Class({\r\n\tdocument : null,\r\n\tdocumentElement : null,\r\n\tnode : null,\r\n\tnodes : null,\r\n\tnsp : null,\r\n\tpns : null,\r\n\tnamespacePrefixIndex : 0,\r\n\txmldom : null,\r\n\tinitialize : function(options) {\r\n\t\t// REWORK\r\n\t\tif (typeof ActiveXObject !== 'undefined') {\r\n\t\t\tthis.xmldom = new ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t} else {\r\n\t\t\tthis.xmldom = null;\r\n\t\t}\r\n\t\tthis.nodes = [];\r\n\t\tvar rootNspItem =\r\n\t\t{\r\n\t\t\t'' : ''\r\n\t\t};\r\n\t\trootNspItem[Jsonix.XML.XMLNS_NS] = Jsonix.XML.XMLNS_P;\r\n\t\tif (Jsonix.Util.Type.isObject(options)) {\r\n\t\t\tif (Jsonix.Util.Type.isObject(options.namespacePrefixes)) {\r\n\t\t\t\tJsonix.Util.Type.cloneObject(options.namespacePrefixes, rootNspItem);\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.nsp = [rootNspItem];\r\n\t\tvar rootPnsItem =\r\n\t\t{\r\n\t\t\t'' : ''\r\n\t\t};\r\n\t\trootPnsItem[Jsonix.XML.XMLNS_P] = Jsonix.XML.XMLNS_NS;\r\n\t\tthis.pns = [rootPnsItem];\r\n\t},\r\n\tdestroy : function() {\r\n\t\tthis.xmldom = null;\r\n\t},\r\n\twriteStartDocument : function() {\r\n\t\t// TODO Check\r\n\t\tvar doc = Jsonix.DOM.createDocument();\r\n\t\tthis.document = doc;\r\n\t\treturn this.push(doc);\r\n\t},\r\n\twriteEndDocument : function() {\r\n\t\treturn this.pop();\r\n\r\n\t},\r\n\twriteStartElement : function(name) {\r\n\t\tJsonix.Util.Ensure.ensureObject(name);\r\n\t\tvar localPart = name.localPart || name.lp || null;\r\n\t\tJsonix.Util.Ensure.ensureString(localPart);\r\n\t\tvar ns = name.namespaceURI || name.ns || null;\r\n\t\tvar namespaceURI = Jsonix.Util.Type.isString(ns) ? ns : '';\r\n\r\n\t\tvar p = name.prefix || name.p;\r\n\t\tvar prefix = this.getPrefix(namespaceURI, p);\r\n\r\n\t\tvar qualifiedName = (!prefix ? localPart : prefix + ':' + localPart);\r\n\r\n\t\tvar element;\r\n\t\tif (Jsonix.Util.Type.isFunction(this.document.createElementNS))\t{\r\n\t\t\telement = this.document.createElementNS(namespaceURI, qualifiedName);\r\n\t\t}\r\n\t\telse if (this.xmldom) {\r\n\t\t\telement = this.xmldom.createNode(1, qualifiedName, namespaceURI);\r\n\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Could not create an element node.\");\r\n\t\t}\r\n\t\tthis.peek().appendChild(element);\r\n\t\tthis.push(element);\r\n\t\tthis.declareNamespace(namespaceURI, prefix);\r\n\t\tif (this.documentElement === null)\r\n\t\t{\r\n\t\t\tthis.documentElement = element;\r\n\t\t\tthis.declareNamespaces();\r\n\t\t}\r\n\t\treturn element;\r\n\t},\r\n\twriteEndElement : function() {\r\n\t\treturn this.pop();\r\n\t},\r\n\twriteCharacters : function(text) {\r\n\t\tvar node;\r\n\t\tif (Jsonix.Util.Type.isFunction(this.document.createTextNode))\t{\r\n\t\t\tnode = this.document.createTextNode(text);\r\n\t\t}\r\n\t\telse if (this.xmldom) {\r\n\t\t\tnode = this.xmldom.createTextNode(text);\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Could not create a text node.\");\r\n\t\t}\r\n\t\tthis.peek().appendChild(node);\r\n\t\treturn node;\r\n\r\n\t},\r\n\twriteCdata : function(text) {\r\n\t\tvar parts = text.split(']]>');\r\n\t\tfor (var index = 0; index < parts.length; index++) {\r\n\t\t\tif (index + 1 < parts.length) {\r\n\t\t\t\tparts[index] = parts[index] + ']]';\r\n\t\t\t\tparts[index + 1] = '>' + parts[index + 1];\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar node;\r\n\t\tfor (var jndex = 0; jndex < parts.length; jndex ++) {\r\n\t\t\tnode = this.writeCdataWithoutCdend(parts[jndex]);\r\n\t\t}\r\n\t\treturn node;\r\n\t},\r\n\twriteCdataWithoutCdend : function(text) {\r\n\t\tvar node;\r\n\t\tif (Jsonix.Util.Type.isFunction(this.document.createCDATASection))\t{\r\n\t\t\tnode = this.document.createCDATASection(text);\r\n\t\t}\r\n\t\telse if (this.xmldom) {\r\n\t\t\tnode = this.xmldom.createCDATASection(text);\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Could not create a CDATA section node.\");\r\n\t\t}\r\n\t\tthis.peek().appendChild(node);\r\n\t\treturn node;\r\n\t},\r\n\twriteAttribute : function(name, value) {\r\n\t\tJsonix.Util.Ensure.ensureString(value);\r\n\t\tJsonix.Util.Ensure.ensureObject(name);\r\n\t\tvar localPart = name.localPart || name.lp || null;\r\n\t\tJsonix.Util.Ensure.ensureString(localPart);\r\n\t\tvar ns = name.namespaceURI || name.ns || null;\r\n\t\tvar namespaceURI = Jsonix.Util.Type.isString(ns) ? ns : '';\r\n\t\tvar p = name.prefix || name.p || null;\r\n\t\tvar prefix = this.getPrefix(namespaceURI, p);\r\n\r\n\t\tvar qualifiedName = (!prefix ? localPart : prefix + ':' + localPart);\r\n\r\n\t\tvar node = this.peek();\r\n\r\n\t\tif (namespaceURI === '') {\r\n\t\t\tnode.setAttribute(qualifiedName, value);\r\n\t\t} else {\r\n\t\t\tif (node.setAttributeNS) {\r\n\t\t\t\tnode.setAttributeNS(namespaceURI, qualifiedName, value);\r\n\t\t\t} else {\r\n\t\t\t\tif (this.xmldom) {\r\n\t\t\t\t\tvar attribute = this.document.createNode(2, qualifiedName, namespaceURI);\r\n\t\t\t\t\tattribute.nodeValue = value;\r\n\t\t\t\t\tnode.setAttributeNode(attribute);\r\n\t\t\t\t}\r\n\t\t\t\telse if (namespaceURI === Jsonix.XML.XMLNS_NS)\r\n\t\t\t\t{\r\n\t\t\t\t\t// XMLNS namespace may be processed unqualified\r\n\t\t\t\t\tnode.setAttribute(qualifiedName, value);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new Error(\"The [setAttributeNS] method is not implemented\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.declareNamespace(namespaceURI, prefix);\r\n\t\t}\r\n\r\n\t},\r\n\twriteNode : function(node) {\r\n\t\tvar importedNode;\r\n\t\tif (Jsonix.Util.Type.exists(this.document.importNode)) {\r\n\t\t\timportedNode = this.document.importNode(node, true);\r\n\t\t} else {\r\n\t\t\timportedNode = node;\r\n\t\t}\r\n\t\tthis.peek().appendChild(importedNode);\r\n\t\treturn importedNode;\r\n\t},\r\n\tpush : function(node) {\r\n\t\tthis.nodes.push(node);\r\n\t\tthis.pushNS();\r\n\t\treturn node;\r\n\t},\r\n\tpeek : function() {\r\n\t\treturn this.nodes[this.nodes.length - 1];\r\n\t},\r\n\tpop : function() {\r\n\t\tthis.popNS();\r\n\t\tvar result = this.nodes.pop();\r\n\t\treturn result;\r\n\t},\r\n\tpushNS : function ()\r\n\t{\r\n\t\tvar nindex = this.nsp.length - 1;\r\n\t\tvar pindex = this.pns.length - 1;\r\n\t\tvar parentNspItem = this.nsp[nindex];\r\n\t\tvar parentPnsItem = this.pns[pindex];\r\n\t\tvar nspItem = Jsonix.Util.Type.isObject(parentNspItem) ? nindex : parentNspItem;\r\n\t\tvar pnsItem = Jsonix.Util.Type.isObject(parentPnsItem) ? pindex : parentPnsItem;\r\n\t\tthis.nsp.push(nspItem);\r\n\t\tthis.pns.push(pnsItem);\r\n\t},\r\n\tpopNS : function ()\r\n\t{\r\n\t\tthis.nsp.pop();\r\n\t\tthis.pns.pop();\r\n\t},\r\n\tdeclareNamespaces : function ()\r\n\t{\r\n\t\tvar index = this.nsp.length - 1;\r\n\t\tvar nspItem = this.nsp[index];\r\n\t\tnspItem = Jsonix.Util.Type.isNumber(nspItem) ? this.nsp[nspItem] : nspItem;\r\n\t\tvar ns, p;\r\n\t\tfor (ns in nspItem)\r\n\t\t{\r\n\t\t\tif (nspItem.hasOwnProperty(ns))\r\n\t\t\t{\r\n\t\t\t\tp = nspItem[ns];\r\n\t\t\t\tthis.declareNamespace(ns, p);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdeclareNamespace : function (ns, p)\r\n\t{\r\n\t\tvar index = this.pns.length - 1;\r\n\t\tvar pnsItem = this.pns[index];\r\n\t\tvar reference;\r\n\t\tif (Jsonix.Util.Type.isNumber(pnsItem))\r\n\t\t{\r\n\t\t\t// Resolve the reference\r\n\t\t\treference = true;\r\n\t\t\tpnsItem = this.pns[pnsItem];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treference = false;\r\n\t\t}\r\n\t\t// If this prefix is mapped to a different namespace and must be redeclared\r\n\t\tif (pnsItem[p] !== ns)\r\n\t\t{\r\n\t\t\tif (p === '')\r\n\t\t\t{\r\n\t\t\t\tthis.writeAttribute({lp : Jsonix.XML.XMLNS_P}, ns);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tthis.writeAttribute({ns : Jsonix.XML.XMLNS_NS, lp : p, p : Jsonix.XML.XMLNS_P}, ns);\r\n\t\t\t}\r\n\t\t\tif (reference)\r\n\t\t\t{\r\n\t\t\t\t// If this was a reference, clone it and replace the reference\r\n\t\t\t\tpnsItem = Jsonix.Util.Type.cloneObject(pnsItem, {});\r\n\t\t\t\tthis.pns[index] = pnsItem;\r\n\t\t\t}\r\n\t\t\tpnsItem[p] = ns;\r\n\t\t}\r\n\t},\r\n\tgetPrefix : function (ns, p)\r\n\t{\r\n\t\tvar index = this.nsp.length - 1;\r\n\t\tvar nspItem = this.nsp[index];\r\n\t\tvar reference;\r\n\t\tif (Jsonix.Util.Type.isNumber(nspItem))\r\n\t\t{\r\n\t\t\t// This is a reference, the item is the index of the parent item\r\n\t\t\treference = true;\r\n\t\t\tnspItem = this.nsp[nspItem];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treference = false;\r\n\t\t}\r\n\t\tif (Jsonix.Util.Type.isString(p))\r\n\t\t{\r\n\t\t\tvar oldp = nspItem[ns];\r\n\t\t\t// If prefix is already declared and equals the proposed prefix\r\n\t\t\tif (p === oldp)\r\n\t\t\t{\r\n\t\t\t\t// Nothing to do\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// If this was a reference, we have to clone it now\r\n\t\t\t\tif (reference)\r\n\t\t\t\t{\r\n\t\t\t\t\tnspItem = Jsonix.Util.Type.cloneObject(nspItem, {});\r\n\t\t\t\t\tthis.nsp[index] = nspItem;\r\n\t\t\t\t}\r\n\t\t\t\tnspItem[ns] = p;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tp = nspItem[ns];\r\n\t\t\tif (!Jsonix.Util.Type.exists(p)) {\r\n\t\t\t\tp = 'p' + (this.namespacePrefixIndex++);\r\n\t\t\t\t// If this was a reference, we have to clone it now\r\n\t\t\t\tif (reference)\r\n\t\t\t\t{\r\n\t\t\t\t\tnspItem = Jsonix.Util.Type.cloneObject(nspItem, {});\r\n\t\t\t\t\tthis.nsp[index] = nspItem;\r\n\t\t\t\t}\r\n\t\t\t\tnspItem[ns] = p;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t},\r\n\tgetNamespaceURI : function (p) {\r\n\t\tvar pindex = this.pns.length - 1;\r\n\t\tvar pnsItem = this.pns[pindex];\r\n\t\tpnsItem = Jsonix.Util.Type.isObject(pnsItem) ? pnsItem : this.pns[pnsItem];\r\n\t\treturn pnsItem[p];\r\n\t},\r\n\tCLASS_NAME : \"Jsonix.XML.Output\"\r\n});\r\n\nJsonix.Mapping = {};\nJsonix.Mapping.Style = Jsonix.Class({\r\n\tmarshaller : null,\r\n\tunmarshaller : null,\r\n\tmodule : null,\r\n\telementInfo : null,\r\n\tclassInfo : null,\r\n\tenumLeafInfo : null,\r\n\tanyAttributePropertyInfo : null,\r\n\tanyElementPropertyInfo : null,\r\n\tattributePropertyInfo : null,\r\n\telementMapPropertyInfo : null,\r\n\telementPropertyInfo : null,\r\n\telementsPropertyInfo : null,\r\n\telementRefPropertyInfo : null,\r\n\telementRefsPropertyInfo : null,\r\n\tvaluePropertyInfo : null,\r\n\tinitialize : function() {\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Mapping.Style'\r\n});\r\n\r\nJsonix.Mapping.Style.STYLES = {};\nJsonix.Mapping.Styled = Jsonix.Class({\r\n\tmappingStyle : null,\r\n\tinitialize : function(options) {\r\n\t\tif (Jsonix.Util.Type.exists(options)) {\r\n\t\t\tJsonix.Util.Ensure.ensureObject(options);\r\n\t\t\tif (Jsonix.Util.Type.isString(options.mappingStyle)) {\r\n\t\t\t\tvar mappingStyle = Jsonix.Mapping.Style.STYLES[options.mappingStyle];\r\n\t\t\t\tif (!mappingStyle) {\r\n\t\t\t\t\tthrow new Error(\"Mapping style [\" + options.mappingStyle + \"] is not known.\");\r\n\t\t\t\t}\r\n\t\t\t\tthis.mappingStyle = mappingStyle;\r\n\t\t\t} else if (Jsonix.Util.Type.isObject(options.mappingStyle)) {\r\n\t\t\t\tthis.mappingStyle = options.mappingStyle;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!this.mappingStyle) {\r\n\t\t\tthis.mappingStyle = Jsonix.Mapping.Style.STYLES.standard;\r\n\t\t}\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Mapping.Styled'\r\n});\nJsonix.Binding = {};\nJsonix.Binding.Marshalls = {\r\n};\r\n\r\nJsonix.Binding.Marshalls.Element = Jsonix.Class({\r\n\tmarshalElement : function(value, context, output, scope) {\r\n\t\tvar elementValue = this.convertToTypedNamedValue(value, context, output, scope);\r\n\t\tvar declaredTypeInfo = elementValue.typeInfo;\r\n\t\tvar actualTypeInfo = undefined;\r\n\t\tif (context.supportXsiType && Jsonix.Util.Type.exists(elementValue.value))\r\n\t\t{\r\n\t\t\tvar typeInfoByValue = context.getTypeInfoByValue(elementValue.value);\r\n\t\t\tif (typeInfoByValue && typeInfoByValue.typeName)\r\n\t\t\t{\r\n\t\t\t\tactualTypeInfo = typeInfoByValue;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar typeInfo = actualTypeInfo || declaredTypeInfo;\r\n\t\tif (typeInfo) {\r\n\t\t\toutput.writeStartElement(elementValue.name);\r\n\t\t\tif (actualTypeInfo && declaredTypeInfo !== actualTypeInfo) {\r\n\t\t\t\tvar xsiTypeName = actualTypeInfo.typeName;\r\n\t\t\t\tvar xsiType = Jsonix.Schema.XSD.QName.INSTANCE.print(xsiTypeName, context, output, scope);\r\n\t\t\t\toutput.writeAttribute(Jsonix.Schema.XSI.TYPE_QNAME, xsiType);\r\n\t\t\t}\r\n\t\t\tif (Jsonix.Util.Type.exists(elementValue.value)) {\r\n\t\t\t\ttypeInfo.marshal(elementValue.value, context, output, scope);\r\n\t\t\t}\r\n\t\t\toutput.writeEndElement();\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Element [\" + elementValue.name.key + \"] is not known in this context, could not determine its type.\");\r\n\t\t}\r\n\t},\r\n\tgetTypeInfoByElementName : function(name, context, scope) {\r\n\t\tvar elementInfo = context.getElementInfo(name, scope);\r\n\t\tif (Jsonix.Util.Type.exists(elementInfo)) {\r\n\t\t\treturn elementInfo.typeInfo;\r\n\t\t} else {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t}\r\n});\r\nJsonix.Binding.Marshalls.Element.AsElementRef = Jsonix.Class({\r\n\tconvertToTypedNamedValue : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tvar elementValue = this.convertToNamedValue(value, context, output, scope);\r\n\t\treturn {\r\n\t\t\tname : elementValue.name,\r\n\t\t\tvalue : elementValue.value,\r\n\t\t\ttypeInfo : this.getTypeInfoByElementName(elementValue.name, context, scope)\r\n\t\t};\r\n\t},\r\n\tconvertToNamedValue : function(elementValue, context, output, scope) {\r\n\t\tvar name;\r\n\t\tvar value;\r\n\t\tif (Jsonix.Util.Type.exists(elementValue.name) && !Jsonix.Util.Type.isUndefined(elementValue.value)) {\r\n\t\t\tname = Jsonix.XML.QName.fromObjectOrString(elementValue.name, context);\r\n\t\t\tvalue = Jsonix.Util.Type.exists(elementValue.value) ? elementValue.value : null;\r\n\t\t\treturn {\r\n\t\t\t\tname : name,\r\n\t\t\t\tvalue : value\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tfor ( var propertyName in elementValue) {\r\n\t\t\t\tif (elementValue.hasOwnProperty(propertyName)) {\r\n\t\t\t\t\tname = Jsonix.XML.QName.fromObjectOrString(propertyName, context);\r\n\t\t\t\t\tvalue = elementValue[propertyName];\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tname : name,\r\n\t\t\t\t\t\tvalue : value\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthrow new Error(\"Invalid element value [\" + elementValue + \"]. Element values must either have {name:'myElementName', value: elementValue} or {myElementName:elementValue} structure.\");\r\n\t}\r\n});\r\n\nJsonix.Binding.Unmarshalls = {};\r\n\r\nJsonix.Binding.Unmarshalls.WrapperElement = Jsonix.Class({\r\n\tmixed : false,\r\n\tunmarshalWrapperElement : function(context, input, scope, callback) {\r\n\t\tvar et = input.next();\r\n\t\twhile (et !== Jsonix.XML.Input.END_ELEMENT) {\r\n\t\t\tif (et === Jsonix.XML.Input.START_ELEMENT) {\r\n\t\t\t\tthis.unmarshalElement(context, input, scope, callback);\r\n\t\t\t} else\r\n\t\t\t// Characters\r\n\t\t\tif (this.mixed && (et === Jsonix.XML.Input.CHARACTERS || et === Jsonix.XML.Input.CDATA || et === Jsonix.XML.Input.ENTITY_REFERENCE)) {\r\n\t\t\t\tcallback(input.getText());\r\n\t\t\t} else if (et === Jsonix.XML.Input.SPACE || et === Jsonix.XML.Input.COMMENT || et === Jsonix.XML.Input.PROCESSING_INSTRUCTION) {\r\n\t\t\t\t// Skip whitespace\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(\"Illegal state: unexpected event type [\" + et + \"].\");\r\n\t\t\t}\r\n\t\t\tet = input.next();\r\n\t\t}\r\n\t}\r\n});\r\n\r\nJsonix.Binding.Unmarshalls.Element = Jsonix.Class({\r\n\tallowTypedObject : true,\r\n\tallowDom : false,\r\n\tunmarshalElement : function(context, input, scope, callback) {\r\n\t\tif (input.eventType != 1) {\r\n\t\t\tthrow new Error(\"Parser must be on START_ELEMENT to read next element.\");\r\n\t\t}\r\n\t\tvar typeInfo = this.getTypeInfoByInputElement(context, input, scope);\r\n\t\tvar name = input.getName();\r\n\t\tvar elementValue;\r\n\t\tif (this.allowTypedObject) {\r\n\t\t\tif (Jsonix.Util.Type.exists(typeInfo)) {\r\n\t\t\t\tvar value = typeInfo.unmarshal(context, input, scope);\r\n\t\t\t\tvar typedNamedValue = {\r\n\t\t\t\t\tname : name,\r\n\t\t\t\t\tvalue : value,\r\n\t\t\t\t\ttypeInfo : typeInfo\r\n\t\t\t\t};\r\n\t\t\t\telementValue = this.convertFromTypedNamedValue(typedNamedValue, context, input, scope);\r\n\t\t\t} else if (this.allowDom) {\r\n\t\t\t\telementValue = input.getElement();\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(\"Element [\" + name.toString() + \"] could not be unmarshalled as is not known in this context and the property does not allow DOM content.\");\r\n\t\t\t}\r\n\t\t} else if (this.allowDom) {\r\n\t\t\telementValue = input.getElement();\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Element [\" + name.toString() + \"] could not be unmarshalled as the property neither allows typed objects nor DOM as content. This is a sign of invalid mappings, do not use [allowTypedObject : false] and [allowDom : false] at the same time.\");\r\n\t\t}\r\n\t\tcallback(elementValue);\r\n\t},\r\n\tgetTypeInfoByInputElement : function(context, input, scope) {\r\n\t\tvar xsiTypeInfo = null;\r\n\t\tif (context.supportXsiType) {\r\n\t\t\tvar xsiType = input.getAttributeValueNS(Jsonix.Schema.XSI.NAMESPACE_URI, Jsonix.Schema.XSI.TYPE);\r\n\t\t\tif (Jsonix.Util.StringUtils.isNotBlank(xsiType)) {\r\n\t\t\t\tvar xsiTypeName = Jsonix.Schema.XSD.QName.INSTANCE.parse(xsiType, context, input, scope);\r\n\t\t\t\txsiTypeInfo = context.getTypeInfoByTypeNameKey(xsiTypeName.key);\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar name = input.getName();\r\n\t\tvar typeInfo = xsiTypeInfo ? xsiTypeInfo : this.getTypeInfoByElementName(name, context, scope);\r\n\t\treturn typeInfo;\r\n\t},\r\n\tgetTypeInfoByElementName : function(name, context, scope) {\r\n\t\tvar elementInfo = context.getElementInfo(name, scope);\r\n\t\tif (Jsonix.Util.Type.exists(elementInfo)) {\r\n\t\t\treturn elementInfo.typeInfo;\r\n\t\t} else {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t}\r\n});\r\n\r\nJsonix.Binding.Unmarshalls.Element.AsElementRef = Jsonix.Class({\r\n\tconvertFromTypedNamedValue : function(typedNamedValue, context, input, scope) {\r\n\t\treturn {\r\n\t\t\tname : typedNamedValue.name,\r\n\t\t\tvalue : typedNamedValue.value\r\n\t\t};\r\n\t}\r\n});\r\n\r\nJsonix.Binding.Unmarshalls.Element.AsSimplifiedElementRef = Jsonix.Class({\r\n\tconvertFromTypedNamedValue : function(typedNamedValue, context, input, scope) {\r\n\t\tvar propertyName = typedNamedValue.name.toCanonicalString(context);\r\n\t\tvar value = {};\r\n\t\tvalue[propertyName] = typedNamedValue.value;\r\n\t\treturn value;\r\n\t}\r\n});\nJsonix.Binding.Marshaller = Jsonix.Class(Jsonix.Binding.Marshalls.Element, Jsonix.Binding.Marshalls.Element.AsElementRef, {\r\n\tcontext : null,\r\n\tinitialize : function(context) {\r\n\t\tJsonix.Util.Ensure.ensureObject(context);\r\n\t\tthis.context = context;\r\n\t},\r\n\tmarshalString : function(value) {\r\n\t\tvar doc = this.marshalDocument(value);\r\n\t\tvar text = Jsonix.DOM.serialize(doc);\r\n\t\treturn text;\r\n\t},\r\n\tmarshalDocument : function(value) {\r\n\t\tvar output = new Jsonix.XML.Output({\r\n\t\t\tnamespacePrefixes : this.context.namespacePrefixes\r\n\t\t});\r\n\r\n\t\tvar doc = output.writeStartDocument();\r\n\t\tthis.marshalElement(value, this.context, output, undefined);\r\n\t\toutput.writeEndDocument();\r\n\t\treturn doc;\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Binding.Marshaller'\r\n});\r\nJsonix.Binding.Marshaller.Simplified = Jsonix.Class(Jsonix.Binding.Marshaller, {\r\n\tCLASS_NAME : 'Jsonix.Binding.Marshaller.Simplified'\r\n});\nJsonix.Binding.Unmarshaller = Jsonix.Class(Jsonix.Binding.Unmarshalls.Element, Jsonix.Binding.Unmarshalls.Element.AsElementRef, {\r\n\tcontext : null,\r\n\tallowTypedObject : true,\r\n\tallowDom : false,\r\n\tinitialize : function(context) {\r\n\t\tJsonix.Util.Ensure.ensureObject(context);\r\n\t\tthis.context = context;\r\n\t},\r\n\tunmarshalString : function(text) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\tvar doc = Jsonix.DOM.parse(text);\r\n\t\treturn this.unmarshalDocument(doc);\r\n\t},\r\n\tunmarshalURL : function(url, callback, options) {\r\n\t\tJsonix.Util.Ensure.ensureString(url);\r\n\t\tJsonix.Util.Ensure.ensureFunction(callback);\r\n\t\tif (Jsonix.Util.Type.exists(options)) {\r\n\t\t\tJsonix.Util.Ensure.ensureObject(options);\r\n\t\t}\r\n\t\tthat = this;\r\n\t\tJsonix.DOM.load(url, function(doc) {\r\n\t\t\tcallback(that.unmarshalDocument(doc));\r\n\t\t}, options);\r\n\t},\r\n\tunmarshalFile : function(fileName, callback, options) {\r\n\t\tif (typeof _jsonix_fs === 'undefined') {\r\n\t\t\tthrow new Error(\"File unmarshalling is only available in environments which support file systems.\");\r\n\t\t}\r\n\t\tJsonix.Util.Ensure.ensureString(fileName);\r\n\t\tJsonix.Util.Ensure.ensureFunction(callback);\r\n\t\tif (Jsonix.Util.Type.exists(options)) {\r\n\t\t\tJsonix.Util.Ensure.ensureObject(options);\r\n\t\t}\r\n\t\tthat = this;\r\n\t\tvar fs = _jsonix_fs;\r\n\t\tfs.readFile(fileName, options, function(err, data) {\r\n\t\t\tif (err) {\r\n\t\t\t\tthrow err;\r\n\t\t\t} else {\r\n\t\t\t\tvar text = data.toString();\r\n\t\t\t\tvar doc = Jsonix.DOM.parse(text);\r\n\t\t\t\tcallback(that.unmarshalDocument(doc));\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\tunmarshalDocument : function(doc, scope) {\r\n\t\tvar input = new Jsonix.XML.Input(doc);\r\n\t\tvar result = null;\r\n\t\tvar callback = function(_result) {\r\n\t\t\tresult = _result;\r\n\t\t};\r\n\t\tinput.nextTag();\r\n\t\tthis.unmarshalElement(this.context, input, scope, callback);\r\n\t\treturn result;\r\n\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Binding.Unmarshaller'\r\n});\r\nJsonix.Binding.Unmarshaller.Simplified = Jsonix.Class(Jsonix.Binding.Unmarshaller, Jsonix.Binding.Unmarshalls.Element.AsSimplifiedElementRef, {\r\n\tCLASS_NAME : 'Jsonix.Binding.Unmarshaller.Simplified'\r\n});\nJsonix.Model.TypeInfo = Jsonix.Class({\r\n\tmodule: null,\t\t\t\r\n\tname : null,\r\n\tbaseTypeInfo : null,\r\n\tinitialize : function() {\r\n\t},\r\n\tisBasedOn : function(typeInfo) {\r\n\t\tvar currentTypeInfo = this;\r\n\t\twhile (currentTypeInfo) {\r\n\t\t\tif (typeInfo === currentTypeInfo) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tcurrentTypeInfo = currentTypeInfo.baseTypeInfo;\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.TypeInfo'\r\n});\nJsonix.Model.ClassInfo = Jsonix\r\n\t\t.Class(Jsonix.Model.TypeInfo, Jsonix.Mapping.Styled, {\r\n\t\t\tname : null,\r\n\t\t\tlocalName : null,\r\n\t\t\ttypeName : null,\r\n\t\t\tinstanceFactory : null,\r\n\t\t\tproperties : null,\r\n\t\t\tpropertiesMap : null,\r\n\t\t\tstructure : null,\r\n\t\t\ttargetNamespace : '',\r\n\t\t\tdefaultElementNamespaceURI : '',\r\n\t\t\tdefaultAttributeNamespaceURI : '',\r\n\t\t\tbuilt : false,\r\n\t\t\tinitialize : function(mapping, options) {\r\n\t\t\t\tJsonix.Model.TypeInfo.prototype.initialize.apply(this, []);\r\n\t\t\t\tJsonix.Mapping.Styled.prototype.initialize.apply(this, [options]);\r\n\t\t\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\t\t\tvar n = mapping.name||mapping.n||undefined;\r\n\t\t\t\tJsonix.Util.Ensure.ensureString(n);\r\n\t\t\t\tthis.name = n;\r\n\t\t\t\t\r\n\t\t\t\tvar ln = mapping.localName||mapping.ln||null;\r\n\t\t\t\tthis.localName = ln;\r\n\r\n\t\t\t\tvar dens = mapping.defaultElementNamespaceURI||mapping.dens||mapping.targetNamespace||mapping.tns||'';\r\n\t\t\t\tthis.defaultElementNamespaceURI = dens;\r\n\t\t\t\t\r\n\t\t\t\tvar tns = mapping.targetNamespace||mapping.tns||mapping.defaultElementNamespaceURI||mapping.dens||this.defaultElementNamespaceURI;\r\n\t\t\t\tthis.targetNamespace = tns;\r\n\r\n\t\t\t\tvar dans = mapping.defaultAttributeNamespaceURI||mapping.dans||'';\r\n\t\t\t\tthis.defaultAttributeNamespaceURI = dans;\r\n\t\t\t\t\r\n\t\t\t\tvar bti = mapping.baseTypeInfo||mapping.bti||null;\r\n\t\t\t\tthis.baseTypeInfo = bti;\r\n\t\t\t\t\r\n\t\t\t\tvar inF = mapping.instanceFactory||mapping.inF||undefined;\r\n\t\t\t\tif (Jsonix.Util.Type.exists(inF)) {\r\n\t\t\t\t\t// TODO: should we support instanceFactory as functions?\r\n\t\t\t\t\t// For the pure JSON configuration?\r\n\t\t\t\t\tJsonix.Util.Ensure.ensureFunction(inF);\r\n\t\t\t\t\tthis.instanceFactory = inF;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tvar tn = mapping.typeName||mapping.tn||undefined;\r\n\t\t\t\t\r\n\t\t\t\tif (Jsonix.Util.Type.exists(tn))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (Jsonix.Util.Type.isString(tn))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthis.typeName = new Jsonix.XML.QName(this.targetNamespace, tn);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthis.typeName = Jsonix.XML.QName.fromObject(tn);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (Jsonix.Util.Type.exists(ln))\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.typeName = new Jsonix.XML.QName(tns, ln);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.properties = [];\r\n\t\t\t\tthis.propertiesMap = {};\r\n\t\t\t\tvar ps = mapping.propertyInfos||mapping.ps||[];\r\n\t\t\t\tJsonix.Util.Ensure.ensureArray(ps);\r\n\t\t\t\tfor ( var index = 0; index < ps.length; index++) {\r\n\t\t\t\t\tthis.p(ps[index]);\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t},\r\n\t\t\tgetPropertyInfoByName : function(name) {\r\n\t\t\t\treturn this.propertiesMap[name];\r\n\t\t\t},\r\n\t\t\t// Obsolete\r\n\t\t\tdestroy : function() {\r\n\t\t\t},\r\n\t\t\tbuild : function(context) {\r\n\t\t\t\tif (!this.built) {\r\n\t\t\t\t\tthis.baseTypeInfo = context.resolveTypeInfo(this.baseTypeInfo, this.module);\r\n\t\t\t\t\tif (Jsonix.Util.Type.exists(this.baseTypeInfo)) {\r\n\t\t\t\t\t\tthis.baseTypeInfo.build(context);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Build properties in this context\r\n\t\t\t\t\tfor ( var index = 0; index < this.properties.length; index++) {\r\n\t\t\t\t\t\tvar propertyInfo = this.properties[index];\r\n\t\t\t\t\t\tpropertyInfo.build(context, this.module);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Build the structure\r\n\t\t\t\t\tvar structure = {\r\n\t\t\t\t\t\telements : null,\r\n\t\t\t\t\t\tattributes : {},\r\n\t\t\t\t\t\tanyAttribute : null,\r\n\t\t\t\t\t\tvalue : null,\r\n\t\t\t\t\t\tany : null\r\n\t\t\t\t\t};\r\n\t\t\t\t\tthis.buildStructure(context, structure);\r\n\t\t\t\t\tthis.structure = structure;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tbuildStructure : function(context, structure) {\r\n\t\t\t\tif (Jsonix.Util.Type.exists(this.baseTypeInfo)) {\r\n\t\t\t\t\tthis.baseTypeInfo.buildStructure(context, structure);\r\n\t\t\t\t}\r\n\t\t\t\tfor ( var index = 0; index < this.properties.length; index++) {\r\n\t\t\t\t\tvar propertyInfo = this.properties[index];\r\n\t\t\t\t\tpropertyInfo.buildStructure(context, structure);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tunmarshal : function(context, input) {\r\n\t\t\t\tthis.build(context);\r\n\t\t\t\tvar result;\r\n\t\t\t\t\r\n\t\t\t\tif (this.instanceFactory) {\r\n\t\t\t\t\tresult = new this.instanceFactory();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tresult = { TYPE_NAME : this.name }; \r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (input.eventType !== 1) {\r\n\t\t\t\t\tthrow new Error(\"Parser must be on START_ELEMENT to read a class info.\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Read attributes\r\n\t\t\t\tif (Jsonix.Util.Type.exists(this.structure.attributes)) {\r\n\t\t\t\t\tvar attributeCount = input.getAttributeCount();\r\n\t\t\t\t\tif (attributeCount !== 0) {\r\n\t\t\t\t\t\tfor ( var index = 0; index < attributeCount; index++) {\r\n\t\t\t\t\t\t\tvar attributeNameKey = input\r\n\t\t\t\t\t\t\t\t\t.getAttributeNameKey(index);\r\n\t\t\t\t\t\t\tif (Jsonix.Util.Type\r\n\t\t\t\t\t\t\t\t\t.exists(this.structure.attributes[attributeNameKey])) {\r\n\t\t\t\t\t\t\t\tvar attributeValue = input\r\n\t\t\t\t\t\t\t\t\t\t.getAttributeValue(index);\r\n\t\t\t\t\t\t\t\tif (Jsonix.Util.Type.isString(attributeValue)) {\r\n\t\t\t\t\t\t\t\t\tvar attributePropertyInfo = this.structure.attributes[attributeNameKey];\r\n\t\t\t\t\t\t\t\t\tthis.unmarshalPropertyValue(context, input,\r\n\t\t\t\t\t\t\t\t\t\t\tattributePropertyInfo, result,\r\n\t\t\t\t\t\t\t\t\t\t\tattributeValue);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Read any attribute\r\n\t\t\t\tif (Jsonix.Util.Type.exists(this.structure.anyAttribute)) {\r\n\t\t\t\t\tvar propertyInfo = this.structure.anyAttribute;\r\n\t\t\t\t\tthis\r\n\t\t\t\t\t\t\t.unmarshalProperty(context, input, propertyInfo,\r\n\t\t\t\t\t\t\t\t\tresult);\r\n\t\t\t\t}\r\n\t\t\t\t// Read elements\r\n\t\t\t\tif (Jsonix.Util.Type.exists(this.structure.elements)) {\r\n\r\n\t\t\t\t\tvar et = input.next();\r\n\t\t\t\t\twhile (et !== Jsonix.XML.Input.END_ELEMENT) {\r\n\t\t\t\t\t\tif (et === Jsonix.XML.Input.START_ELEMENT) {\r\n\t\t\t\t\t\t\t// New sub-element starts\r\n\t\t\t\t\t\t\tvar elementNameKey = input.getNameKey();\r\n\t\t\t\t\t\t\tif (Jsonix.Util.Type\r\n\t\t\t\t\t\t\t\t\t.exists(this.structure.elements[elementNameKey])) {\r\n\t\t\t\t\t\t\t\tvar elementPropertyInfo = this.structure.elements[elementNameKey];\r\n\t\t\t\t\t\t\t\tthis.unmarshalProperty(context, input,\r\n\t\t\t\t\t\t\t\t\t\telementPropertyInfo, result);\r\n\t\t\t\t\t\t\t} else if (Jsonix.Util.Type\r\n\t\t\t\t\t\t\t\t\t.exists(this.structure.any)) {\r\n\t\t\t\t\t\t\t\t// TODO Refactor\r\n\r\n\t\t\t\t\t\t\t\tvar anyPropertyInfo = this.structure.any;\r\n\t\t\t\t\t\t\t\tthis.unmarshalProperty(context, input,\r\n\t\t\t\t\t\t\t\t\t\tanyPropertyInfo, result);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// TODO optionally report a validation error that the element is not expected\r\n\t\t\t\t\t\t\t\tet = input.skipElement();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if ((et === Jsonix.XML.Input.CHARACTERS || et === Jsonix.XML.Input.CDATA || et === Jsonix.XML.Input.ENTITY_REFERENCE)) {\r\n\t\t\t\t\t\t\tif (Jsonix.Util.Type.exists(this.structure.mixed))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// Characters and structure has a mixed property\r\n\t\t\t\t\t\t\t\tvar mixedPropertyInfo = this.structure.mixed;\r\n\t\t\t\t\t\t\t\tthis.unmarshalProperty(context, input,\r\n\t\t\t\t\t\t\t\t\t\tmixedPropertyInfo, result);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (et === Jsonix.XML.Input.SPACE || et === Jsonix.XML.Input.COMMENT\t|| et === Jsonix.XML.Input.PROCESSING_INSTRUCTION) {\r\n\t\t\t\t\t\t\t// Ignore\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthrow new Error(\"Illegal state: unexpected event type [\" + et\t+ \"].\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tet = input.next();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (Jsonix.Util.Type.exists(this.structure.value)) {\r\n\t\t\t\t\tvar valuePropertyInfo = this.structure.value;\r\n\t\t\t\t\tthis.unmarshalProperty(context, input, valuePropertyInfo,\r\n\t\t\t\t\t\t\tresult);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Just skip everything\r\n\t\t\t\t\tinput.nextTag();\r\n\t\t\t\t}\r\n\t\t\t\tif (input.eventType !== 2) {\r\n\t\t\t\t\tthrow new Error(\"Illegal state: must be END_ELEMENT.\");\r\n\t\t\t\t}\r\n\t\t\t\treturn result;\r\n\t\t\t},\r\n\t\t\tunmarshalProperty : function(context, input, propertyInfo, result) {\r\n\t\t\t\tvar propertyValue = propertyInfo\r\n\t\t\t\t\t\t.unmarshal(context, input, this);\r\n\t\t\t\tpropertyInfo.setProperty(result, propertyValue);\r\n\t\t\t},\r\n\t\t\tunmarshalPropertyValue : function(context, input, propertyInfo,\r\n\t\t\t\t\tresult, value) {\r\n\t\t\t\tvar propertyValue = propertyInfo.unmarshalValue(value, context, input, this);\r\n\t\t\t\tpropertyInfo.setProperty(result, propertyValue);\r\n\t\t\t},\r\n\t\t\tmarshal : function(value, context, output, scope) {\r\n\t\t\t\tif (this.isMarshallable(value, context, scope))\r\n\t\t\t\t{\r\n\t\t\t\t\t// TODO This must be reworked\r\n\t\t\t\t\tif (Jsonix.Util.Type.exists(this.baseTypeInfo)) {\r\n\t\t\t\t\t\tthis.baseTypeInfo.marshal(value, context, output);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfor ( var index = 0; index < this.properties.length; index++) {\r\n\t\t\t\t\t\tvar propertyInfo = this.properties[index];\r\n\t\t\t\t\t\tvar propertyValue = value[propertyInfo.name];\r\n\t\t\t\t\t\tif (Jsonix.Util.Type.exists(propertyValue)) {\r\n\t\t\t\t\t\t\tpropertyInfo.marshal(propertyValue, context, output, this);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// Otherwise if there is just one property, use this property to marshal\r\n\t\t\t\t\tif (this.structure.value)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar valuePropertyInfo = this.structure.value;\r\n\t\t\t\t\t\tvaluePropertyInfo.marshal(value, context, output, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (this.properties.length === 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar singlePropertyInfo = this.properties[0];\r\n\t\t\t\t\t\tsinglePropertyInfo.marshal(value, context, output, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// TODO throw an error\r\n\t\t\t\t\t\tthrow new Error(\"The passed value [\" + value + \"] is not an object and there is no single suitable property to marshal it.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t// Checks if the value is marshallable\r\n\t\t\tisMarshallable : function(value, context, scope) {\r\n\t\t\t\treturn this.isInstance(value, context, scope) || (Jsonix.Util.Type.isObject(value) && !Jsonix.Util.Type.isArray(value));\r\n\t\t\t},\r\n\t\t\tisInstance : function(value, context, scope) {\r\n\t\t\t\tif (this.instanceFactory) {\r\n\t\t\t\t\treturn value instanceof this.instanceFactory;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn Jsonix.Util.Type.isObject(value) && Jsonix.Util.Type.isString(value.TYPE_NAME) && value.TYPE_NAME === this.name;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// Obsolete, left for backwards compatibility\r\n\t\t\tb : function(baseTypeInfo) {\r\n\t\t\t\tJsonix.Util.Ensure.ensureObject(baseTypeInfo);\r\n\t\t\t\tthis.baseTypeInfo = baseTypeInfo;\r\n\t\t\t\treturn this;\r\n\t\t\t},\r\n\t\t\t// Obsolete, left for backwards compatibility\r\n\t\t\tps : function() {\r\n\t\t\t\treturn this;\r\n\t\t\t},\r\n\t\t\tp : function(mapping) {\r\n\t\t\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\t\t\t// If mapping is an instance of the property class\r\n\t\t\t\tif (mapping instanceof Jsonix.Model.PropertyInfo) {\r\n\t\t\t\t\tthis.addProperty(mapping);\r\n\t\t\t\t}\r\n\t\t\t\t// Else create it via generic mapping configuration\r\n\t\t\t\telse {\r\n\t\t\t\t\tmapping = Jsonix.Util.Type.cloneObject(mapping);\r\n\t\t\t\t\tvar type = mapping.type||mapping.t||'element';\r\n\t\t\t\t\t// Locate the creator function\r\n\t\t\t\t\tif (Jsonix.Util.Type\r\n\t\t\t\t\t\t\t.isFunction(this.propertyInfoCreators[type])) {\r\n\t\t\t\t\t\tvar propertyInfoCreator = this.propertyInfoCreators[type];\r\n\t\t\t\t\t\t// Call the creator function\r\n\t\t\t\t\t\tpropertyInfoCreator.call(this, mapping);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthrow new Error(\"Unknown property info type [\" + type + \"].\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\taa : function(mapping) {\r\n\t\t\t\tthis.addDefaultNamespaces(mapping);\r\n\t\t\t\treturn this\r\n\t\t\t\t\t\t.addProperty(new this.mappingStyle.anyAttributePropertyInfo(\r\n\t\t\t\t\t\t\t\tmapping, {\r\n\t\t\t\t\t\t\t\t\tmappingStyle : this.mappingStyle\r\n\t\t\t\t\t\t\t\t}));\r\n\t\t\t},\r\n\t\t\tae : function(mapping) {\r\n\t\t\t\tthis.addDefaultNamespaces(mapping);\r\n\t\t\t\treturn this\r\n\t\t\t\t\t\t.addProperty(new this.mappingStyle.anyElementPropertyInfo(\r\n\t\t\t\t\t\t\t\tmapping, {\r\n\t\t\t\t\t\t\t\t\tmappingStyle : this.mappingStyle\r\n\t\t\t\t\t\t\t\t}));\r\n\t\t\t},\r\n\t\t\ta : function(mapping) {\r\n\t\t\t\tthis.addDefaultNamespaces(mapping);\r\n\t\t\t\treturn this.addProperty(new this.mappingStyle.attributePropertyInfo(\r\n\t\t\t\t\t\tmapping, {\r\n\t\t\t\t\t\t\tmappingStyle : this.mappingStyle\r\n\t\t\t\t\t\t}));\r\n\t\t\t},\r\n\t\t\tem : function(mapping) {\r\n\t\t\t\tthis.addDefaultNamespaces(mapping);\r\n\t\t\t\treturn this\r\n\t\t\t\t\t\t.addProperty(new this.mappingStyle.elementMapPropertyInfo(\r\n\t\t\t\t\t\t\t\tmapping, {\r\n\t\t\t\t\t\t\t\t\tmappingStyle : this.mappingStyle\r\n\t\t\t\t\t\t\t\t}));\r\n\t\t\t},\r\n\t\t\te : function(mapping) {\r\n\t\t\t\tthis.addDefaultNamespaces(mapping);\r\n\t\t\t\treturn this.addProperty(new this.mappingStyle.elementPropertyInfo(\r\n\t\t\t\t\t\tmapping, {\r\n\t\t\t\t\t\t\tmappingStyle : this.mappingStyle\r\n\t\t\t\t\t\t}));\r\n\t\t\t},\r\n\t\t\tes : function(mapping) {\r\n\t\t\t\tthis.addDefaultNamespaces(mapping);\r\n\t\t\t\treturn this.addProperty(new this.mappingStyle.elementsPropertyInfo(\r\n\t\t\t\t\t\tmapping, {\r\n\t\t\t\t\t\t\tmappingStyle : this.mappingStyle\r\n\t\t\t\t\t\t}));\r\n\t\t\t},\r\n\t\t\ter : function(mapping) {\r\n\t\t\t\tthis.addDefaultNamespaces(mapping);\r\n\t\t\t\treturn this\r\n\t\t\t\t\t\t.addProperty(new this.mappingStyle.elementRefPropertyInfo(\r\n\t\t\t\t\t\t\t\tmapping, {\r\n\t\t\t\t\t\t\t\t\tmappingStyle : this.mappingStyle\r\n\t\t\t\t\t\t\t\t}));\r\n\t\t\t},\r\n\t\t\ters : function(mapping) {\r\n\t\t\t\tthis.addDefaultNamespaces(mapping);\r\n\t\t\t\treturn this\r\n\t\t\t\t\t\t.addProperty(new this.mappingStyle.elementRefsPropertyInfo(\r\n\t\t\t\t\t\t\t\tmapping, {\r\n\t\t\t\t\t\t\t\t\tmappingStyle : this.mappingStyle\r\n\t\t\t\t\t\t\t\t}));\r\n\t\t\t},\r\n\t\t\tv : function(mapping) {\r\n\t\t\t\tthis.addDefaultNamespaces(mapping);\r\n\t\t\t\treturn this.addProperty(new this.mappingStyle.valuePropertyInfo(\r\n\t\t\t\t\t\tmapping, {\r\n\t\t\t\t\t\t\tmappingStyle : this.mappingStyle\r\n\t\t\t\t\t\t}));\r\n\t\t\t},\r\n\t\t\taddDefaultNamespaces : function(mapping) {\r\n\t\t\t\tif (Jsonix.Util.Type.isObject(mapping)) {\r\n\t\t\t\t\tif (!Jsonix.Util.Type\r\n\t\t\t\t\t\t\t.isString(mapping.defaultElementNamespaceURI)) {\r\n\t\t\t\t\t\tmapping.defaultElementNamespaceURI = this.defaultElementNamespaceURI;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!Jsonix.Util.Type\r\n\t\t\t\t\t\t\t.isString(mapping.defaultAttributeNamespaceURI)) {\r\n\t\t\t\t\t\tmapping.defaultAttributeNamespaceURI = this.defaultAttributeNamespaceURI;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\taddProperty : function(property) {\r\n\t\t\t\tthis.properties.push(property);\r\n\t\t\t\tthis.propertiesMap[property.name] = property;\r\n\t\t\t\treturn this;\r\n\t\t\t},\r\n\t\t\tCLASS_NAME : 'Jsonix.Model.ClassInfo'\r\n\t\t});\r\nJsonix.Model.ClassInfo.prototype.propertyInfoCreators = {\r\n\t\"aa\" : Jsonix.Model.ClassInfo.prototype.aa,\r\n\t\"anyAttribute\" : Jsonix.Model.ClassInfo.prototype.aa,\r\n\t\"ae\" : Jsonix.Model.ClassInfo.prototype.ae,\r\n\t\"anyElement\" : Jsonix.Model.ClassInfo.prototype.ae,\r\n\t\"a\" : Jsonix.Model.ClassInfo.prototype.a,\r\n\t\"attribute\" : Jsonix.Model.ClassInfo.prototype.a,\r\n\t\"em\" : Jsonix.Model.ClassInfo.prototype.em,\r\n\t\"elementMap\" : Jsonix.Model.ClassInfo.prototype.em,\r\n\t\"e\" : Jsonix.Model.ClassInfo.prototype.e,\r\n\t\"element\" : Jsonix.Model.ClassInfo.prototype.e,\r\n\t\"es\" : Jsonix.Model.ClassInfo.prototype.es,\r\n\t\"elements\" : Jsonix.Model.ClassInfo.prototype.es,\r\n\t\"er\" : Jsonix.Model.ClassInfo.prototype.er,\r\n\t\"elementRef\" : Jsonix.Model.ClassInfo.prototype.er,\r\n\t\"ers\" : Jsonix.Model.ClassInfo.prototype.ers,\r\n\t\"elementRefs\" : Jsonix.Model.ClassInfo.prototype.ers,\r\n\t\"v\" : Jsonix.Model.ClassInfo.prototype.v,\r\n\t\"value\" : Jsonix.Model.ClassInfo.prototype.v\r\n};\nJsonix.Model.EnumLeafInfo = Jsonix.Class(Jsonix.Model.TypeInfo, {\r\n\tname : null,\r\n\tbaseTypeInfo : 'String',\r\n\tentries : null,\r\n\tkeys : null,\r\n\tvalues : null,\r\n\tbuilt : false,\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Model.TypeInfo.prototype.initialize.apply(this, []);\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\t\r\n\t\tvar n = mapping.name||mapping.n||undefined;\r\n\t\tJsonix.Util.Ensure.ensureString(n);\r\n\t\tthis.name = n;\r\n\t\t\r\n\t\tvar bti = mapping.baseTypeInfo||mapping.bti||'String';\r\n\t\tthis.baseTypeInfo = bti;\r\n\t\t\r\n\t\tvar vs = mapping.values||mapping.vs||undefined;\r\n\t\tJsonix.Util.Ensure.ensureExists(vs);\r\n\t\tif (!(Jsonix.Util.Type.isObject(vs) || Jsonix.Util.Type.isArray(vs))) {\r\n\t\t\tthrow new Error('Enum values must be either an array or an object.');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.entries = vs;\r\n\t\t}\t\t\r\n\t},\r\n\tbuild : function(context) {\r\n\t\tif (!this.built) {\r\n\t\t\tthis.baseTypeInfo = context.resolveTypeInfo(this.baseTypeInfo, this.module);\r\n\t\t\tthis.baseTypeInfo.build(context);\r\n\t\t\tvar items = this.entries;\r\n\t\t\tvar entries = {};\r\n\t\t\tvar keys = [];\r\n\t\t\tvar values = [];\r\n\t\t\tvar index = 0;\r\n\t\t\tvar key;\r\n\t\t\tvar value;\r\n\t\t\t// If values is an array, process individual items\r\n\t\t\tif (Jsonix.Util.Type.isArray(items))\r\n\t\t\t{\r\n\t\t\t\t// Build properties in this context\r\n\t\t\t\tfor (index = 0; index < items.length; index++) {\r\n\t\t\t\t\tvalue = items[index];\r\n\t\t\t\t\tif (Jsonix.Util.Type.isString(value)) {\r\n\t\t\t\t\t\tkey = value;\r\n\t\t\t\t\t\tif (!(Jsonix.Util.Type.isFunction(this.baseTypeInfo.parse)))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tthrow new Error('Enum value is provided as string but the base type ['+this.baseTypeInfo.name+'] of the enum info [' + this.name + '] does not implement the parse method.');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Using null as input since input is not available\r\n\t\t\t\t\t\tvalue = this.baseTypeInfo.parse(value, context, null, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (this.baseTypeInfo.isInstance(value, context, this))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (!(Jsonix.Util.Type.isFunction(this.baseTypeInfo.print)))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tthrow new Error('The base type ['+this.baseTypeInfo.name+'] of the enum info [' + this.name + '] does not implement the print method, unable to produce the enum key as string.');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Using null as output since output is not available at this moment\r\n\t\t\t\t\t\t\tkey = this.baseTypeInfo.print(value, context, null, this);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tthrow new Error('Enum value [' + value + '] is not an instance of the enum base type [' + this.baseTypeInfo.name + '].');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tentries[key] = value;\r\n\t\t\t\t\tkeys[index] = key;\r\n\t\t\t\t\tvalues[index] = value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (Jsonix.Util.Type.isObject(items))\r\n\t\t\t{\r\n\t\t\t\tfor (key in items) {\r\n\t\t\t\t\tif (items.hasOwnProperty(key)) {\r\n\t\t\t\t\t\tvalue = items[key];\r\n\t\t\t\t\t\tif (Jsonix.Util.Type.isString(value)) {\r\n\t\t\t\t\t\t\tif (!(Jsonix.Util.Type.isFunction(this.baseTypeInfo.parse)))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tthrow new Error('Enum value is provided as string but the base type ['+this.baseTypeInfo.name+'] of the enum info [' + this.name + '] does not implement the parse method.');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Using null as input since input is not available\r\n\t\t\t\t\t\t\tvalue = this.baseTypeInfo.parse(value, context, null, this);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (!this.baseTypeInfo.isInstance(value, context, this))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tthrow new Error('Enum value [' + value + '] is not an instance of the enum base type [' + this.baseTypeInfo.name + '].');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tentries[key] = value;\r\n\t\t\t\t\t\tkeys[index] = key;\r\n\t\t\t\t\t\tvalues[index] = value;\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthrow new Error('Enum values must be either an array or an object.');\r\n\t\t\t}\r\n\t\t\tthis.entries = entries;\r\n\t\t\tthis.keys = keys;\r\n\t\t\tthis.values = values;\r\n\t\t\tthis.built = true;\r\n\t\t}\r\n\t},\r\n\tunmarshal : function(context, input, scope) {\r\n\t\tvar text = input.getElementText();\r\n\t\treturn this.parse(text, context, input, scope);\r\n\t},\r\n\tmarshal : function(value, context, output, scope) {\r\n\t\tif (Jsonix.Util.Type.exists(value)) {\r\n\t\t\toutput.writeCharacters(this.reprint(value, context, output, scope));\r\n\t\t}\r\n\t},\r\n\treprint : function(value, context, output, scope) {\r\n\t\tif (Jsonix.Util.Type.isString(value) && !this.isInstance(value, context, scope)) {\r\n\t\t\t// Using null as input since input is not available\r\n\t\t\treturn this.print(this.parse(value, context, null, scope), context, output, scope);\r\n\t\t} else {\r\n\t\t\treturn this.print(value, context, output, scope);\r\n\t\t}\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\tfor (var index = 0; index < this.values.length; index++)\r\n\t\t{\r\n\t\t\tif (this.values[index] === value)\r\n\t\t\t{\r\n\t\t\t\treturn this.keys[index];\r\n\t\t\t}\r\n\t\t}\r\n\t\tthrow new Error('Value [' + value + '] is invalid for the enum type [' + this.name + '].');\r\n\t},\r\n\tparse : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\tif (this.entries.hasOwnProperty(text))\r\n\t\t{\r\n\t\t\treturn this.entries[text];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new Error('Value [' + text + '] is invalid for the enum type [' + this.name + '].');\r\n\t\t}\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\tfor (var index = 0; index < this.values.length; index++)\r\n\t\t{\r\n\t\t\tif (this.values[index] === value)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.EnumLeafInfo'\r\n});\nJsonix.Model.ElementInfo = Jsonix.Class({\r\n\tmodule: null,\t\t\t\r\n\telementName : null,\r\n\ttypeInfo : null,\r\n\tsubstitutionHead : null,\r\n\tscope : null,\r\n\tbuilt : false,\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\t\r\n\t\tvar dens = mapping.defaultElementNamespaceURI||mapping.dens||'';\r\n\t\tthis.defaultElementNamespaceURI = dens;\r\n\t\t\r\n\t\tvar en = mapping.elementName || mapping.en||undefined;\r\n\t\tif (Jsonix.Util.Type.isObject(en)) {\r\n\t\t\tthis.elementName = Jsonix.XML.QName.fromObject(en);\r\n\t\t} else {\r\n\t\t\tJsonix.Util.Ensure.ensureString(en);\r\n\t\t\tthis.elementName = new Jsonix.XML.QName(this.defaultElementNamespaceURI, en);\r\n\t\t}\r\n\t\t\r\n\t\tvar ti = mapping.typeInfo||mapping.ti||'String';\r\n\t\tthis.typeInfo = ti;\r\n\t\t\r\n\t\tvar sh = mapping.substitutionHead||mapping.sh||null;\r\n\t\tthis.substitutionHead = sh;\r\n\t\t\r\n\t\tvar sc = mapping.scope||mapping.sc||null;\r\n\t\tthis.scope = sc;\r\n\t},\r\n\tbuild : function(context) {\r\n\t\t// If element info is not yet built\r\n\t\tif (!this.built) {\r\n\t\t\tthis.typeInfo = context.resolveTypeInfo(this.typeInfo, this.module);\r\n\t\t\tthis.scope = context.resolveTypeInfo(this.scope, this.module);\r\n\t\t\tthis.built = true;\r\n\t\t}\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.ElementInfo'\r\n});\nJsonix.Model.PropertyInfo = Jsonix.Class({\r\n\tname : null,\r\n\tcollection : false,\r\n\ttargetNamespace : '',\r\n\tdefaultElementNamespaceURI : '',\r\n\tdefaultAttributeNamespaceURI : '',\r\n\tbuilt : false,\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tvar n = mapping.name || mapping.n || undefined;\r\n\t\tJsonix.Util.Ensure.ensureString(n);\r\n\t\tthis.name = n;\r\n\t\tvar dens = mapping.defaultElementNamespaceURI || mapping.dens || mapping.targetNamespace || mapping.tns || '';\r\n\t\tthis.defaultElementNamespaceURI = dens;\r\n\t\tvar tns = mapping.targetNamespace || mapping.tns || mapping.defaultElementNamespaceURI || mapping.dens || this.defaultElementNamespaceURI;\r\n\t\tthis.targetNamespace = tns;\r\n\t\tvar dans = mapping.defaultAttributeNamespaceURI || mapping.dans || '';\r\n\t\tthis.defaultAttributeNamespaceURI = dans;\r\n\t\tvar col = mapping.collection || mapping.col || false;\r\n\t\tthis.collection = col;\r\n\t\tvar rq = mapping.required || mapping.rq || false;\r\n\t\tthis.required = rq;\r\n\t\tif (this.collection) {\r\n\t\t\tvar mno;\r\n\t\t\tif (Jsonix.Util.Type.isNumber(mapping.minOccurs)) {\r\n\t\t\t\tmno = mapping.minOccurs;\r\n\t\t\t}\r\n\t\t\telse if (Jsonix.Util.Type.isNumber(mapping.mno)) {\r\n\t\t\t\tmno = mapping.mno;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tmno = 1;\r\n\t\t\t}\r\n\t\t\tthis.minOccurs = mno;\r\n\t\t\tvar mxo;\r\n\t\t\tif (Jsonix.Util.Type.isNumber(mapping.maxOccurs)) {\r\n\t\t\t\tmxo = mapping.maxOccurs;\r\n\t\t\t}\r\n\t\t\telse if (Jsonix.Util.Type.isNumber(mapping.mxo)) {\r\n\t\t\t\tmxo = mapping.mxo;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tmxo = null;\r\n\t\t\t}\r\n\t\t\tthis.maxOccurs = mxo;\r\n\t\t}\r\n\t},\r\n\tbuild : function(context, module) {\r\n\t\tif (!this.built) {\r\n\t\t\tthis.doBuild(context, module);\r\n\t\t\tthis.built = true;\r\n\t\t}\r\n\t},\r\n\tdoBuild : function(context, module) {\r\n\t\tthrow new Error(\"Abstract method [doBuild].\");\r\n\t},\r\n\tbuildStructure : function(context, structure) {\r\n\t\tthrow new Error(\"Abstract method [buildStructure].\");\r\n\t},\r\n\tsetProperty : function(object, value) {\r\n\t\tif (Jsonix.Util.Type.exists(value)) {\r\n\t\t\tif (this.collection) {\r\n\t\t\t\tJsonix.Util.Ensure.ensureArray(value, 'Collection property requires an array value.');\r\n\t\t\t\tif (!Jsonix.Util.Type.exists(object[this.name])) {\r\n\t\t\t\t\tobject[this.name] = [];\r\n\t\t\t\t}\r\n\t\t\t\tfor (var index = 0; index < value.length; index++) {\r\n\t\t\t\t\tobject[this.name].push(value[index]);\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\tobject[this.name] = value;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.PropertyInfo'\r\n});\nJsonix.Model.AnyAttributePropertyInfo = Jsonix.Class(Jsonix.Model.PropertyInfo, {\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tJsonix.Model.PropertyInfo.prototype.initialize.apply(this, [ mapping ]);\r\n\t},\r\n\tunmarshal : function(context, input, scope) {\r\n\t\tvar attributeCount = input.getAttributeCount();\r\n\t\tif (attributeCount === 0) {\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\tvar result = {};\r\n\t\t\tfor ( var index = 0; index < attributeCount; index++) {\r\n\t\t\t\tvar value = input.getAttributeValue(index);\r\n\t\t\t\tif (Jsonix.Util.Type.isString(value)) {\r\n\t\t\t\t\tvar propertyName = this.convertFromAttributeName(input.getAttributeName(index), context, input, scope);\r\n\t\t\t\t\tresult[propertyName] = value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t}\r\n\t},\r\n\tmarshal : function(value, context, output, scope) {\r\n\t\tif (!Jsonix.Util.Type.isObject(value)) {\r\n\t\t\t// Nothing to do\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfor ( var propertyName in value) {\r\n\t\t\tif (value.hasOwnProperty(propertyName)) {\r\n\t\t\t\tvar propertyValue = value[propertyName];\r\n\t\t\t\tif (Jsonix.Util.Type.isString(propertyValue)) {\r\n\t\t\t\t\tvar attributeName = this.convertToAttributeName(propertyName, context, output, scope);\r\n\t\t\t\t\toutput.writeAttribute(attributeName, propertyValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tconvertFromAttributeName : function(attributeName, context, input, scope) {\r\n\t\treturn attributeName.key;\r\n\t},\r\n\tconvertToAttributeName : function(propertyName, context, output, scope) {\r\n\t\treturn Jsonix.XML.QName.fromObjectOrString(propertyName, context);\r\n\t},\r\n\tdoBuild : function(context, module)\t{\r\n\t\t// Nothing to do\r\n\t},\r\n\tbuildStructure : function(context, structure) {\r\n\t\tJsonix.Util.Ensure.ensureObject(structure);\r\n\t\t// if (Jsonix.Util.Type.exists(structure.anyAttribute))\r\n\t\t// {\r\n\t\t// // TODO better exception\r\n\t\t// throw new Error(\"The structure already defines an any attribute\r\n\t\t// property.\");\r\n\t\t// } else\r\n\t\t// {\r\n\t\tstructure.anyAttribute = this;\r\n\t\t// }\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.AnyAttributePropertyInfo'\r\n});\r\nJsonix.Model.AnyAttributePropertyInfo.Simplified = Jsonix.Class(Jsonix.Model.AnyAttributePropertyInfo, {\r\n\tconvertFromAttributeName : function(attributeName, context, input, scope)\r\n\t{\r\n\t\treturn attributeName.toCanonicalString(context);\r\n\t}\r\n});\r\n\nJsonix.Model.SingleTypePropertyInfo = Jsonix.Class(Jsonix.Model.PropertyInfo, {\r\n\ttypeInfo : 'String',\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tJsonix.Model.PropertyInfo.prototype.initialize.apply(this, [ mapping ]);\r\n\t\tvar ti = mapping.typeInfo || mapping.ti || 'String';\r\n\t\tthis.typeInfo = ti;\r\n\t},\r\n\tdoBuild : function(context, module) {\r\n\t\tthis.typeInfo = context.resolveTypeInfo(this.typeInfo, module);\r\n\t},\r\n\tunmarshalValue : function(value, context, input, scope) {\r\n\t\treturn this.parse(value, context, input, scope);\r\n\t},\r\n\tparse : function(value, context, input, scope) {\r\n\t\treturn this.typeInfo.parse(value, context, input, scope);\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\treturn this.typeInfo.reprint(value, context, output, scope);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.SingleTypePropertyInfo'\r\n});\r\n\nJsonix.Model.AttributePropertyInfo = Jsonix.Class(Jsonix.Model.SingleTypePropertyInfo, {\r\n\tattributeName : null,\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tJsonix.Model.SingleTypePropertyInfo.prototype.initialize.apply(this, [ mapping ]);\r\n\t\tvar an = mapping.attributeName||mapping.an||undefined;\r\n\t\tif (Jsonix.Util.Type.isObject(an)) {\r\n\t\t\tthis.attributeName = Jsonix.XML.QName.fromObject(an);\r\n\t\t} else if (Jsonix.Util.Type.isString(an)) {\r\n\t\t\tthis.attributeName = new Jsonix.XML.QName(this.defaultAttributeNamespaceURI, an);\r\n\t\t} else {\r\n\t\t\tthis.attributeName = new Jsonix.XML.QName(this.defaultAttributeNamespaceURI, this.name);\r\n\t\t}\r\n\t},\r\n\tunmarshal : function(context, input, scope) {\r\n\t\tvar attributeCount = input.getAttributeCount();\r\n\t\tvar result = null;\r\n\t\tfor ( var index = 0; index < attributeCount; index++) {\r\n\t\t\tvar attributeNameKey = input.getAttributeNameKey(index);\r\n\t\t\tif (this.attributeName.key === attributeNameKey) {\r\n\t\t\t\tvar attributeValue = input.getAttributeValue(index);\r\n\t\t\t\tif (Jsonix.Util.Type.isString(attributeValue)) {\r\n\t\t\t\t\tresult = this.unmarshalValue(attributeValue, context, input, scope);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tmarshal : function(value, context, output, scope) {\r\n\t\tif (Jsonix.Util.Type.exists(value)) {\r\n\t\t\toutput.writeAttribute(this.attributeName, this.print(value, context, output, scope));\r\n\t\t}\r\n\r\n\t},\r\n\tbuildStructure : function(context, structure) {\r\n\t\tJsonix.Util.Ensure.ensureObject(structure);\r\n\t\tJsonix.Util.Ensure.ensureObject(structure.attributes);\r\n\t\tvar key = this.attributeName.key;\r\n\t\t// if (Jsonix.Util.Type.exists(structure.attributes[key])) {\r\n\t\t// // TODO better exception\r\n\t\t// throw new Error(\"The structure already defines an attribute for the key\r\n\t\t// [\"\r\n\t\t// + key + \"].\");\r\n\t\t// } else\r\n\t\t// {\r\n\t\tstructure.attributes[key] = this;\r\n\t\t// }\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.AttributePropertyInfo'\r\n});\r\n\nJsonix.Model.ValuePropertyInfo = Jsonix.Class(Jsonix.Model.SingleTypePropertyInfo, {\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tJsonix.Model.SingleTypePropertyInfo.prototype.initialize.apply(this, [ mapping ]);\r\n\r\n\t\tvar cdata = mapping.asCDATA || mapping.cdata || false;\r\n\t\tthis.asCDATA = cdata;\r\n\t},\r\n\tunmarshal : function(context, input, scope) {\r\n\t\tvar text = input.getElementText();\r\n\t\treturn this.unmarshalValue(text, context, input, scope);\r\n\t},\r\n\tmarshal : function(value, context, output, scope) {\r\n\t\tif (!Jsonix.Util.Type.exists(value)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this.asCDATA) {\r\n\t\t\toutput.writeCdata(this.print(value, context, output, scope));\r\n\t\t} else {\r\n\t\t\toutput.writeCharacters(this.print(value, context, output, scope));\r\n\t\t}\r\n\t},\r\n\tbuildStructure : function(context, structure) {\r\n\t\tJsonix.Util.Ensure.ensureObject(structure);\r\n\t\t// if (Jsonix.Util.Type.exists(structure.value)) {\r\n\t\t// // TODO better exception\r\n\t\t// throw new Error(\"The structure already defines a value\r\n\t\t// property.\");\r\n\t\t// } else\r\n\t\tif (Jsonix.Util.Type.exists(structure.elements)) {\r\n\t\t\t// TODO better exception\r\n\t\t\tthrow new Error(\"The structure already defines element mappings, it cannot define a value property.\");\r\n\t\t} else {\r\n\t\t\tstructure.value = this;\r\n\t\t}\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.ValuePropertyInfo'\r\n});\r\n\nJsonix.Model.AbstractElementsPropertyInfo = Jsonix.Class(Jsonix.Binding.Unmarshalls.Element, Jsonix.Binding.Unmarshalls.WrapperElement, Jsonix.Model.PropertyInfo, {\r\n\twrapperElementName : null,\r\n\tallowDom : false,\r\n\tallowTypedObject : true,\r\n\tmixed : false,\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tJsonix.Model.PropertyInfo.prototype.initialize.apply(this, [ mapping ]);\r\n\t\tvar wen = mapping.wrapperElementName||mapping.wen||undefined;\r\n\t\tif (Jsonix.Util.Type.isObject(wen)) {\r\n\t\t\tthis.wrapperElementName = Jsonix.XML.QName.fromObject(wen);\r\n\t\t} else if (Jsonix.Util.Type.isString(wen)) {\r\n\t\t\tthis.wrapperElementName = new Jsonix.XML.QName(this.defaultElementNamespaceURI, wen);\r\n\t\t} else {\r\n\t\t\tthis.wrapperElementName = null;\r\n\t\t}\r\n\t},\r\n\tunmarshal : function(context, input, scope) {\r\n\t\tvar result = null;\r\n\t\tvar that = this;\r\n\t\tvar callback = function(value) {\r\n\t\t\tif (that.collection) {\r\n\t\t\t\tif (result === null) {\r\n\t\t\t\t\tresult = [];\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(value);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (result === null) {\r\n\t\t\t\t\tresult = value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// TODO Report validation error\r\n\t\t\t\t\tthrow new Error(\"Value already set.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tif (Jsonix.Util.Type.exists(this.wrapperElementName)) {\r\n\t\t\tthis.unmarshalWrapperElement(context, input, scope, callback);\r\n\t\t} else {\r\n\t\t\tthis.unmarshalElement(context, input, scope, callback);\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tmarshal : function(value, context, output, scope) {\r\n\r\n\t\tif (!Jsonix.Util.Type.exists(value)) {\r\n\t\t\t// Do nothing\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (Jsonix.Util.Type.exists(this.wrapperElementName)) {\r\n\t\t\toutput.writeStartElement(this.wrapperElementName);\r\n\t\t}\r\n\r\n\t\tif (!this.collection) {\r\n\t\t\tthis.marshalElement(value, context, output, scope);\r\n\t\t} else {\r\n\t\t\tJsonix.Util.Ensure.ensureArray(value);\r\n\t\t\t// TODO Exception if not array\r\n\t\t\tfor ( var index = 0; index < value.length; index++) {\r\n\t\t\t\tvar item = value[index];\r\n\t\t\t\t// TODO Exception if item does not exist\r\n\t\t\t\tthis.marshalElement(item, context, output, scope);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (Jsonix.Util.Type.exists(this.wrapperElementName)) {\r\n\t\t\toutput.writeEndElement();\r\n\t\t}\r\n\t},\r\n\tconvertFromTypedNamedValue : function(elementValue, context, input, scope) {\r\n\t\treturn elementValue.value;\r\n\t},\r\n\tbuildStructure : function(context, structure) {\r\n\t\tJsonix.Util.Ensure.ensureObject(structure);\r\n\t\tif (Jsonix.Util.Type.exists(structure.value)) {\r\n\t\t\t// TODO better exception\r\n\t\t\tthrow new Error(\"The structure already defines a value property.\");\r\n\t\t} else if (!Jsonix.Util.Type.exists(structure.elements)) {\r\n\t\t\tstructure.elements = {};\r\n\t\t}\r\n\r\n\t\tif (Jsonix.Util.Type.exists(this.wrapperElementName)) {\r\n\t\t\tstructure.elements[this.wrapperElementName.key] = this;\r\n\t\t} else {\r\n\t\t\tthis.buildStructureElements(context, structure);\r\n\t\t}\r\n\t},\r\n\tbuildStructureElements : function(context, structure) {\r\n\t\tthrow new Error(\"Abstract method [buildStructureElements].\");\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.AbstractElementsPropertyInfo'\r\n});\r\n\nJsonix.Model.ElementPropertyInfo = Jsonix.Class(Jsonix.Model.AbstractElementsPropertyInfo, Jsonix.Binding.Marshalls.Element, {\r\n\ttypeInfo : 'String',\r\n\telementName : null,\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tJsonix.Model.AbstractElementsPropertyInfo.prototype.initialize.apply(this, [ mapping ]);\r\n\t\tvar ti = mapping.typeInfo || mapping.ti || 'String';\r\n\t\tif (Jsonix.Util.Type.isObject(ti)) {\r\n\t\t\tthis.typeInfo = ti;\r\n\t\t} else {\r\n\t\t\tJsonix.Util.Ensure.ensureString(ti);\r\n\t\t\tthis.typeInfo = ti;\r\n\t\t}\r\n\t\tvar en = mapping.elementName || mapping.en || undefined;\r\n\t\tif (Jsonix.Util.Type.isObject(en)) {\r\n\t\t\tthis.elementName = Jsonix.XML.QName.fromObject(en);\r\n\t\t} else if (Jsonix.Util.Type.isString(en)) {\r\n\t\t\tthis.elementName = new Jsonix.XML.QName(this.defaultElementNamespaceURI, en);\r\n\t\t} else {\r\n\t\t\tthis.elementName = new Jsonix.XML.QName(this.defaultElementNamespaceURI, this.name);\r\n\t\t}\r\n\t},\r\n\tgetTypeInfoByElementName : function(elementName, context, scope) {\r\n\t\treturn this.typeInfo;\r\n\t},\r\n\tconvertToTypedNamedValue : function(value, context, output, scope) {\r\n\t\treturn {\r\n\t\t\tname : this.elementName,\r\n\t\t\tvalue : value,\r\n\t\t\ttypeInfo : this.typeInfo\r\n\t\t};\r\n\t},\r\n\tdoBuild : function(context, module) {\r\n\t\tthis.typeInfo = context.resolveTypeInfo(this.typeInfo, module);\r\n\t},\r\n\tbuildStructureElements : function(context, structure) {\r\n\t\tstructure.elements[this.elementName.key] = this;\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.ElementPropertyInfo'\r\n});\r\n\nJsonix.Model.ElementsPropertyInfo = Jsonix.Class(Jsonix.Model.AbstractElementsPropertyInfo, Jsonix.Binding.Marshalls.Element, {\r\n\telementTypeInfos : null,\r\n\telementTypeInfosMap : null,\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tJsonix.Model.AbstractElementsPropertyInfo.prototype.initialize.apply(this, [ mapping ]);\r\n\t\tvar etis = mapping.elementTypeInfos || mapping.etis || [];\r\n\t\tJsonix.Util.Ensure.ensureArray(etis);\r\n\t\tthis.elementTypeInfos = [];\r\n\t\tfor (var index = 0; index < etis.length; index++) {\r\n\t\t\tthis.elementTypeInfos[index] = Jsonix.Util.Type.cloneObject(etis[index]);\r\n\t\t}\r\n\t},\r\n\tgetTypeInfoByElementName : function(elementName, context, scope) {\r\n\t\treturn this.elementTypeInfosMap[elementName.key];\r\n\t},\r\n\tconvertToTypedNamedValue : function(value, context, output, scope) {\r\n\t\tfor (var index = 0; index < this.elementTypeInfos.length; index++) {\r\n\t\t\tvar elementTypeInfo = this.elementTypeInfos[index];\r\n\t\t\tvar typeInfo = elementTypeInfo.typeInfo;\r\n\t\t\tif (typeInfo.isInstance(value, context, scope)) {\r\n\t\t\t\tvar elementName = elementTypeInfo.elementName;\r\n\t\t\t\treturn {\r\n\t\t\t\t\tname : elementName,\r\n\t\t\t\t\tvalue : value,\r\n\t\t\t\t\ttypeInfo : typeInfo\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\t\t// If xsi:type is supported\r\n\t\tif (context.supportXsiType) {\r\n\t\t\t// Find the actual type\r\n\t\t\tvar actualTypeInfo = context.getTypeInfoByValue(value);\r\n\t\t\tif (actualTypeInfo && actualTypeInfo.typeName) {\r\n\t\t\t\tfor (var jndex = 0; jndex < this.elementTypeInfos.length; jndex++) {\r\n\t\t\t\t\tvar eti = this.elementTypeInfos[jndex];\r\n\t\t\t\t\tvar ti = eti.typeInfo;\r\n\t\t\t\t\t// TODO Can be optimized\r\n\t\t\t\t\t// Find an element type info which has a type info that is a\r\n\t\t\t\t\t// supertype of the actual type info\r\n\t\t\t\t\tif (actualTypeInfo.isBasedOn(ti)) {\r\n\t\t\t\t\t\tvar en = eti.elementName;\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tname : en,\r\n\t\t\t\t\t\t\tvalue : value,\r\n\t\t\t\t\t\t\ttypeInfo : ti\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// TODO harmonize error handling. See also marshallElement. Error must\r\n\t\t// only be on one place.\r\n\t\tthrow new Error(\"Could not find an element with type info supporting the value [\" + value + \"].\");\r\n\t},\r\n\tdoBuild : function(context, module) {\r\n\t\tthis.elementTypeInfosMap = {};\r\n\t\tvar etiti, etien;\r\n\t\tfor (var index = 0; index < this.elementTypeInfos.length; index++) {\r\n\t\t\tvar elementTypeInfo = this.elementTypeInfos[index];\r\n\t\t\tJsonix.Util.Ensure.ensureObject(elementTypeInfo);\r\n\t\t\tetiti = elementTypeInfo.typeInfo || elementTypeInfo.ti || 'String';\r\n\t\t\telementTypeInfo.typeInfo = context.resolveTypeInfo(etiti, module);\r\n\t\t\tetien = elementTypeInfo.elementName || elementTypeInfo.en || undefined;\r\n\t\t\telementTypeInfo.elementName = Jsonix.XML.QName.fromObjectOrString(etien, context, this.defaultElementNamespaceURI);\r\n\t\t\tthis.elementTypeInfosMap[elementTypeInfo.elementName.key] = elementTypeInfo.typeInfo;\r\n\t\t}\r\n\t},\r\n\tbuildStructureElements : function(context, structure) {\r\n\t\tfor (var index = 0; index < this.elementTypeInfos.length; index++) {\r\n\t\t\tvar elementTypeInfo = this.elementTypeInfos[index];\r\n\t\t\tstructure.elements[elementTypeInfo.elementName.key] = this;\r\n\t\t}\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.ElementsPropertyInfo'\r\n});\r\n\nJsonix.Model.ElementMapPropertyInfo = Jsonix.Class(Jsonix.Model.AbstractElementsPropertyInfo, {\r\n\telementName : null,\r\n\tkey : null,\r\n\tvalue : null,\r\n\tentryTypeInfo : null,\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tJsonix.Model.AbstractElementsPropertyInfo.prototype.initialize.apply(this, [ mapping ]);\r\n\t\t// TODO Ensure correct argument\r\n\t\tvar k = mapping.key || mapping.k || undefined;\r\n\t\tJsonix.Util.Ensure.ensureObject(k);\r\n\t\tvar v = mapping.value || mapping.v || undefined;\r\n\t\tJsonix.Util.Ensure.ensureObject(v);\r\n\t\t// TODO Ensure correct argument\r\n\t\tvar en = mapping.elementName || mapping.en || undefined;\r\n\t\tif (Jsonix.Util.Type.isObject(en)) {\r\n\t\t\tthis.elementName = Jsonix.XML.QName.fromObject(en);\r\n\t\t} else if (Jsonix.Util.Type.isString(en)) {\r\n\t\t\tthis.elementName = new Jsonix.XML.QName(this.defaultElementNamespaceURI, en);\r\n\t\t} else {\r\n\t\t\tthis.elementName = new Jsonix.XML.QName(this.defaultElementNamespaceURI, this.name);\r\n\t\t}\r\n\t\tthis.entryTypeInfo = new Jsonix.Model.ClassInfo({\r\n\t\t\tname : 'Map<' + k.name + ',' + v.name + '>',\r\n\t\t\tpropertyInfos : [ k, v ]\r\n\t\t});\r\n\r\n\t},\r\n\tunmarshal : function(context, input, scope) {\r\n\t\tvar result = null;\r\n\t\tvar that = this;\r\n\t\tvar callback = function(value) {\r\n\r\n\t\t\tif (Jsonix.Util.Type.exists(value)) {\r\n\t\t\t\tJsonix.Util.Ensure.ensureObject(value, 'Map property requires an object.');\r\n\t\t\t\tif (!Jsonix.Util.Type.exists(result)) {\r\n\t\t\t\t\tresult = {};\r\n\t\t\t\t}\r\n\t\t\t\tfor ( var attributeName in value) {\r\n\t\t\t\t\tif (value.hasOwnProperty(attributeName)) {\r\n\t\t\t\t\t\tvar attributeValue = value[attributeName];\r\n\t\t\t\t\t\tif (that.collection) {\r\n\t\t\t\t\t\t\tif (!Jsonix.Util.Type.exists(result[attributeName])) {\r\n\t\t\t\t\t\t\t\tresult[attributeName] = [];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresult[attributeName].push(attributeValue);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (!Jsonix.Util.Type.exists(result[attributeName])) {\r\n\t\t\t\t\t\t\t\tresult[attributeName] = attributeValue;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// TODO Report validation error\r\n\t\t\t\t\t\t\t\tthrow new Error(\"Value was already set.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tif (Jsonix.Util.Type.exists(this.wrapperElementName)) {\r\n\t\t\tthis.unmarshalWrapperElement(context, input, scope, callback);\r\n\t\t} else {\r\n\t\t\tthis.unmarshalElement(context, input, scope, callback);\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tgetTypeInfoByInputElement : function(context, input, scope) {\r\n\t\treturn this.entryTypeInfo;\r\n\t},\r\n\tconvertFromTypedNamedValue : function(elementValue, context, input, scope) {\r\n\t\tvar entry = elementValue.value;\r\n\t\tvar result = {};\r\n\t\tif (Jsonix.Util.Type.isString(entry[this.key.name])) {\r\n\t\t\tresult[entry[this.key.name]] = entry[this.value.name];\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tmarshal : function(value, context, output, scope) {\r\n\r\n\t\tif (!Jsonix.Util.Type.exists(value)) {\r\n\t\t\t// Do nothing\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (Jsonix.Util.Type.exists(this.wrapperElementName)) {\r\n\t\t\toutput.writeStartElement(this.wrapperElementName);\r\n\t\t}\r\n\r\n\t\tthis.marshalElement(value, context, output, scope);\r\n\r\n\t\tif (Jsonix.Util.Type.exists(this.wrapperElementName)) {\r\n\t\t\toutput.writeEndElement();\r\n\t\t}\r\n\t},\r\n\tmarshalElement : function(value, context, output, scope) {\r\n\t\tif (!!value) {\r\n\t\t\tfor ( var attributeName in value) {\r\n\t\t\t\tif (value.hasOwnProperty(attributeName)) {\r\n\t\t\t\t\tvar attributeValue = value[attributeName];\r\n\t\t\t\t\tif (!this.collection) {\r\n\t\t\t\t\t\tvar singleEntry = {};\r\n\t\t\t\t\t\tsingleEntry[this.key.name] = attributeName;\r\n\t\t\t\t\t\tsingleEntry[this.value.name] = attributeValue;\r\n\t\t\t\t\t\toutput.writeStartElement(this.elementName);\r\n\t\t\t\t\t\tthis.entryTypeInfo.marshal(singleEntry, context, output, scope);\r\n\t\t\t\t\t\toutput.writeEndElement();\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfor (var index = 0; index < attributeValue.length; index++) {\r\n\t\t\t\t\t\t\tvar collectionEntry = {};\r\n\t\t\t\t\t\t\tcollectionEntry[this.key.name] = attributeName;\r\n\t\t\t\t\t\t\tcollectionEntry[this.value.name] = attributeValue[index];\r\n\t\t\t\t\t\t\toutput.writeStartElement(this.elementName);\r\n\t\t\t\t\t\t\tthis.entryTypeInfo.marshal(collectionEntry, context, output, scope);\r\n\t\t\t\t\t\t\toutput.writeEndElement();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdoBuild : function(context, module) {\r\n\t\tthis.entryTypeInfo.build(context, module);\r\n\t\t// TODO get property by name\r\n\t\tthis.key = this.entryTypeInfo.properties[0];\r\n\t\tthis.value = this.entryTypeInfo.properties[1];\r\n\t},\r\n\tbuildStructureElements : function(context, structure) {\r\n\t\tstructure.elements[this.elementName.key] = this;\r\n\t},\r\n\tsetProperty : function(object, value) {\r\n\t\tif (Jsonix.Util.Type.exists(value)) {\r\n\t\t\tJsonix.Util.Ensure.ensureObject(value, 'Map property requires an object.');\r\n\t\t\tif (!Jsonix.Util.Type.exists(object[this.name])) {\r\n\t\t\t\tobject[this.name] = {};\r\n\t\t\t}\r\n\t\t\tvar map = object[this.name];\r\n\t\t\tfor ( var attributeName in value) {\r\n\t\t\t\tif (value.hasOwnProperty(attributeName)) {\r\n\t\t\t\t\tvar attributeValue = value[attributeName];\r\n\t\t\t\t\tif (this.collection) {\r\n\t\t\t\t\t\tif (!Jsonix.Util.Type.exists(map[attributeName])) {\r\n\t\t\t\t\t\t\tmap[attributeName] = [];\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfor (var index = 0; index < attributeValue.length; index++) {\r\n\t\t\t\t\t\t\tmap[attributeName].push(attributeValue[index]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmap[attributeName] = attributeValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.ElementMapPropertyInfo'\r\n});\r\n\nJsonix.Model.AbstractElementRefsPropertyInfo = Jsonix.Class(Jsonix.Binding.Marshalls.Element, Jsonix.Binding.Marshalls.Element.AsElementRef, Jsonix.Binding.Unmarshalls.Element, Jsonix.Binding.Unmarshalls.WrapperElement, Jsonix.Binding.Unmarshalls.Element.AsElementRef, Jsonix.Model.PropertyInfo, {\r\n\twrapperElementName : null,\r\n\tallowDom : true,\r\n\tallowTypedObject : true,\r\n\tmixed : true,\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping, 'Mapping must be an object.');\r\n\t\tJsonix.Model.PropertyInfo.prototype.initialize.apply(this, [ mapping ]);\r\n\t\tvar wen = mapping.wrapperElementName || mapping.wen || undefined;\r\n\t\tif (Jsonix.Util.Type.isObject(wen)) {\r\n\t\t\tthis.wrapperElementName = Jsonix.XML.QName.fromObject(wen);\r\n\t\t} else if (Jsonix.Util.Type.isString(wen)) {\r\n\t\t\tthis.wrapperElementName = new Jsonix.XML.QName(this.defaultElementNamespaceURI, wen);\r\n\t\t} else {\r\n\t\t\tthis.wrapperElementName = null;\r\n\t\t}\r\n\t\tvar dom = Jsonix.Util.Type.defaultValue(mapping.allowDom, mapping.dom, true);\r\n\t\tvar typed = Jsonix.Util.Type.defaultValue(mapping.allowTypedObject, mapping.typed, true);\r\n\t\tvar mx = Jsonix.Util.Type.defaultValue(mapping.mixed, mapping.mx, true);\r\n\t\tthis.allowDom = dom;\r\n\t\tthis.allowTypedObject = typed;\r\n\t\tthis.mixed = mx;\r\n\t},\r\n\tunmarshal : function(context, input, scope) {\r\n\t\tvar result = null;\r\n\t\tvar that = this;\r\n\t\tvar callback = function(value) {\r\n\t\t\tif (that.collection) {\r\n\t\t\t\tif (result === null) {\r\n\t\t\t\t\tresult = [];\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(value);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (result === null) {\r\n\t\t\t\t\tresult = value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// TODO Report validation error\r\n\t\t\t\t\tthrow new Error(\"Value already set.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar et = input.eventType;\r\n\t\tif (et === Jsonix.XML.Input.START_ELEMENT) {\r\n\t\t\tif (Jsonix.Util.Type.exists(this.wrapperElementName)) {\r\n\t\t\t\tthis.unmarshalWrapperElement(context, input, scope, callback);\r\n\t\t\t} else {\r\n\t\t\t\tthis.unmarshalElement(context, input, scope, callback);\r\n\t\t\t}\r\n\t\t} else if (this.mixed && (et === Jsonix.XML.Input.CHARACTERS || et === Jsonix.XML.Input.CDATA || et === Jsonix.XML.Input.ENTITY_REFERENCE)) {\r\n\t\t\tcallback(input.getText());\r\n\t\t} else if (et === Jsonix.XML.Input.SPACE || et === Jsonix.XML.Input.COMMENT || et === Jsonix.XML.Input.PROCESSING_INSTRUCTION) {\r\n\t\t\t// Skip whitespace\r\n\t\t} else {\r\n\t\t\t// TODO better exception\r\n\t\t\tthrow new Error(\"Illegal state: unexpected event type [\" + et + \"].\");\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tmarshal : function(value, context, output, scope) {\r\n\r\n\t\tif (Jsonix.Util.Type.exists(value)) {\r\n\t\t\tif (Jsonix.Util.Type.exists(this.wrapperElementName)) {\r\n\t\t\t\toutput.writeStartElement(this.wrapperElementName);\r\n\t\t\t}\r\n\r\n\t\t\tif (!this.collection) {\r\n\t\t\t\tthis.marshalItem(value, context, output, scope);\r\n\t\t\t} else {\r\n\t\t\t\tJsonix.Util.Ensure.ensureArray(value, 'Collection property requires an array value.');\r\n\t\t\t\tfor (var index = 0; index < value.length; index++) {\r\n\t\t\t\t\tvar item = value[index];\r\n\t\t\t\t\tthis.marshalItem(item, context, output, scope);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (Jsonix.Util.Type.exists(this.wrapperElementName)) {\r\n\t\t\t\toutput.writeEndElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t},\r\n\tmarshalItem : function(value, context, output, scope) {\r\n\t\tif (Jsonix.Util.Type.isString(value)) {\r\n\t\t\tif (!this.mixed) {\r\n\t\t\t\t// TODO\r\n\t\t\t\tthrow new Error(\"Property is not mixed, can't handle string values.\");\r\n\t\t\t} else {\r\n\t\t\t\toutput.writeCharacters(value);\r\n\t\t\t}\r\n\t\t} else if (this.allowDom && Jsonix.Util.Type.exists(value.nodeType)) {\r\n\t\t\t// DOM node\r\n\t\t\toutput.writeNode(value);\r\n\t\t} else if (Jsonix.Util.Type.isObject(value)) {\r\n\t\t\tthis.marshalElement(value, context, output, scope);\r\n\r\n\t\t} else {\r\n\t\t\tif (this.mixed) {\r\n\t\t\t\tthrow new Error(\"Unsupported content type, either objects or strings are supported.\");\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(\"Unsupported content type, only objects are supported.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t},\r\n\tgetTypeInfoByElementName : function(elementName, context, scope) {\r\n\t\tvar propertyElementTypeInfo = this.getPropertyElementTypeInfo(elementName, context);\r\n\t\tif (Jsonix.Util.Type.exists(propertyElementTypeInfo)) {\r\n\t\t\treturn propertyElementTypeInfo.typeInfo;\r\n\t\t} else {\r\n\t\t\tvar contextElementTypeInfo = context.getElementInfo(elementName, scope);\r\n\t\t\tif (Jsonix.Util.Type.exists(contextElementTypeInfo)) {\r\n\t\t\t\treturn contextElementTypeInfo.typeInfo;\r\n\t\t\t} else {\r\n\t\t\t\treturn undefined;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tgetPropertyElementTypeInfo : function(elementName, context) {\r\n\t\tthrow new Error(\"Abstract method [getPropertyElementTypeInfo].\");\r\n\t},\r\n\tbuildStructure : function(context, structure) {\r\n\t\tJsonix.Util.Ensure.ensureObject(structure);\r\n\t\tif (Jsonix.Util.Type.exists(structure.value)) {\r\n\t\t\t// TODO better exception\r\n\t\t\tthrow new Error(\"The structure already defines a value property.\");\r\n\t\t} else if (!Jsonix.Util.Type.exists(structure.elements)) {\r\n\t\t\tstructure.elements = {};\r\n\t\t}\r\n\r\n\t\tif (Jsonix.Util.Type.exists(this.wrapperElementName)) {\r\n\t\t\tstructure.elements[this.wrapperElementName.key] = this;\r\n\t\t} else {\r\n\t\t\tthis.buildStructureElements(context, structure);\r\n\t\t}\r\n\r\n\t\t// if (Jsonix.Util.Type.exists(structure.elements[key]))\r\n\t\t// {\r\n\t\t// // TODO better exception\r\n\t\t// throw new Error(\"The structure already defines an element for\r\n\t\t// the key [\"\r\n\t\t// + key + \"].\");\r\n\t\t// } else\r\n\t\t// {\r\n\t\t// structure.elements[key] = this;\r\n\t\t// }\r\n\r\n\t\tif ((this.allowDom || this.allowTypedObject)) {\r\n\t\t\tstructure.any = this;\r\n\t\t}\r\n\t\tif (this.mixed && !Jsonix.Util.Type.exists(this.wrapperElementName)) {\r\n\t\t\t// if (Jsonix.Util.Type.exists(structure.mixed)) {\r\n\t\t\t// // TODO better exception\r\n\t\t\t// throw new Error(\"The structure already defines the mixed\r\n\t\t\t// property.\");\r\n\t\t\t// } else\r\n\t\t\t// {\r\n\t\t\tstructure.mixed = this;\r\n\t\t\t// }\r\n\t\t}\r\n\t},\r\n\tbuildStructureElements : function(context, structure) {\r\n\t\tthrow new Error(\"Abstract method [buildStructureElements].\");\r\n\t},\r\n\tbuildStructureElementTypeInfos : function(context, structure, elementTypeInfo) {\r\n\t\tstructure.elements[elementTypeInfo.elementName.key] = this;\r\n\t\tvar substitutionMembers = context.getSubstitutionMembers(elementTypeInfo.elementName);\r\n\t\tif (Jsonix.Util.Type.isArray(substitutionMembers)) {\r\n\t\t\tfor (var jndex = 0; jndex < substitutionMembers.length; jndex++) {\r\n\t\t\t\tvar substitutionElementInfo = substitutionMembers[jndex];\r\n\t\t\t\tthis.buildStructureElementTypeInfos(context, structure, substitutionElementInfo);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.AbstractElementRefsPropertyInfo'\r\n});\nJsonix.Model.ElementRefPropertyInfo = Jsonix.Class(Jsonix.Model.AbstractElementRefsPropertyInfo, {\r\n\ttypeInfo : 'String',\r\n\telementName : null,\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tJsonix.Model.AbstractElementRefsPropertyInfo.prototype.initialize.apply(this, [ mapping ]);\r\n\t\t// TODO Ensure correct argument\r\n\t\tvar ti = mapping.typeInfo || mapping.ti || 'String';\r\n\t\tif (Jsonix.Util.Type.isObject(ti)) {\r\n\t\t\tthis.typeInfo = ti;\r\n\t\t} else {\r\n\t\t\tJsonix.Util.Ensure.ensureString(ti);\r\n\t\t\tthis.typeInfo = ti;\r\n\t\t}\r\n\t\tvar en = mapping.elementName || mapping.en || undefined;\r\n\t\tif (Jsonix.Util.Type.isObject(en)) {\r\n\t\t\tthis.elementName = Jsonix.XML.QName.fromObject(en);\r\n\t\t} else if (Jsonix.Util.Type.isString(en)) {\r\n\t\t\tthis.elementName = new Jsonix.XML.QName(this.defaultElementNamespaceURI, en);\r\n\t\t} else {\r\n\t\t\tthis.elementName = new Jsonix.XML.QName(this.defaultElementNamespaceURI, this.name);\r\n\t\t}\r\n\t},\r\n\tgetPropertyElementTypeInfo : function(elementName, context) {\r\n\t\tvar name = Jsonix.XML.QName.fromObjectOrString(elementName, context);\r\n\r\n\t\tif (name.key === this.elementName.key) {\r\n\t\t\treturn this;\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t},\r\n\tdoBuild : function(context, module) {\r\n\t\tthis.typeInfo = context.resolveTypeInfo(this.typeInfo, module);\r\n\t},\r\n\tbuildStructureElements : function(context, structure) {\r\n\t\tthis.buildStructureElementTypeInfos(context, structure, this);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.ElementRefPropertyInfo'\r\n});\r\nJsonix.Model.ElementRefPropertyInfo.Simplified = Jsonix.Class(Jsonix.Model.ElementRefPropertyInfo, Jsonix.Binding.Unmarshalls.Element.AsSimplifiedElementRef, {\r\n\tCLASS_NAME : 'Jsonix.Model.ElementRefPropertyInfo.Simplified'\r\n});\nJsonix.Model.ElementRefsPropertyInfo = Jsonix.Class(Jsonix.Model.AbstractElementRefsPropertyInfo, {\r\n\telementTypeInfos : null,\r\n\telementTypeInfosMap : null,\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tJsonix.Model.AbstractElementRefsPropertyInfo.prototype.initialize.apply(this, [ mapping ]);\r\n\t\t// TODO Ensure correct arguments\r\n\t\tvar etis = mapping.elementTypeInfos || mapping.etis || [];\r\n\t\tJsonix.Util.Ensure.ensureArray(etis);\r\n\t\tthis.elementTypeInfos = [];\r\n\t\tfor (var index = 0; index < etis.length; index++)\r\n\t\t{\r\n\t\t\tthis.elementTypeInfos[index] = Jsonix.Util.Type.cloneObject(etis[index]);\r\n\t\t}\r\n\t},\r\n\tgetPropertyElementTypeInfo : function(elementName, context) {\r\n\t\tvar name = Jsonix.XML.QName.fromObjectOrString(elementName, context);\r\n\r\n\t\tvar typeInfo = this.elementTypeInfosMap[name.key];\r\n\t\tif (Jsonix.Util.Type.exists(typeInfo)) {\r\n\t\t\treturn {\r\n\t\t\t\telementName : name,\r\n\t\t\t\ttypeInfo : typeInfo\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t},\r\n\tdoBuild : function(context, module) {\r\n\t\tthis.elementTypeInfosMap = {};\r\n\t\tvar etiti, etien;\r\n\t\tfor (var index = 0; index < this.elementTypeInfos.length; index++) {\r\n\t\t\tvar elementTypeInfo = this.elementTypeInfos[index];\r\n\t\t\tJsonix.Util.Ensure.ensureObject(elementTypeInfo);\r\n\t\t\tetiti = elementTypeInfo.typeInfo || elementTypeInfo.ti || 'String';\r\n\t\t\telementTypeInfo.typeInfo = context.resolveTypeInfo(etiti, module);\r\n\t\t\tetien = elementTypeInfo.elementName || elementTypeInfo.en || undefined;\r\n\t\t\telementTypeInfo.elementName = Jsonix.XML.QName.fromObjectOrString(etien, context, this.defaultElementNamespaceURI);\r\n\t\t\tthis.elementTypeInfosMap[elementTypeInfo.elementName.key] = elementTypeInfo.typeInfo;\r\n\t\t}\r\n\t},\r\n\tbuildStructureElements : function(context, structure) {\r\n\t\tfor (var index = 0; index < this.elementTypeInfos.length; index++) {\r\n\t\t\tvar elementTypeInfo = this.elementTypeInfos[index];\r\n\t\t\tthis.buildStructureElementTypeInfos(context, structure, elementTypeInfo);\r\n\t\t}\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.ElementRefsPropertyInfo'\r\n});\r\nJsonix.Model.ElementRefsPropertyInfo.Simplified = Jsonix.Class(Jsonix.Model.ElementRefsPropertyInfo, Jsonix.Binding.Unmarshalls.Element.AsSimplifiedElementRef, {\r\n\tCLASS_NAME : 'Jsonix.Model.ElementRefsPropertyInfo.Simplified'\r\n});\r\n\nJsonix.Model.AnyElementPropertyInfo = Jsonix.Class(Jsonix.Binding.Marshalls.Element, Jsonix.Binding.Marshalls.Element.AsElementRef, Jsonix.Binding.Unmarshalls.Element, Jsonix.Binding.Unmarshalls.Element.AsElementRef, Jsonix.Model.PropertyInfo, {\r\n\tallowDom : true,\r\n\tallowTypedObject : true,\r\n\tmixed : true,\r\n\tinitialize : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tJsonix.Model.PropertyInfo.prototype.initialize.apply(this, [ mapping ]);\r\n\t\tvar dom = Jsonix.Util.Type.defaultValue(mapping.allowDom, mapping.dom, true);\r\n\t\tvar typed = Jsonix.Util.Type.defaultValue(mapping.allowTypedObject, mapping.typed, true);\r\n\t\tvar mx = Jsonix.Util.Type.defaultValue(mapping.mixed, mapping.mx, true);\r\n\t\tthis.allowDom = dom;\r\n\t\tthis.allowTypedObject = typed;\r\n\t\tthis.mixed = mx;\r\n\t},\r\n\tunmarshal : function(context, input, scope) {\r\n\t\tvar result = null;\r\n\t\tvar that = this;\r\n\t\tvar callback = function(value) {\r\n\t\t\tif (that.collection) {\r\n\t\t\t\tif (result === null) {\r\n\t\t\t\t\tresult = [];\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(value);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (result === null) {\r\n\t\t\t\t\tresult = value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// TODO Report validation error\r\n\t\t\t\t\tthrow new Error(\"Value already set.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar et = input.eventType;\r\n\t\tif (et === Jsonix.XML.Input.START_ELEMENT) {\r\n\t\t\tthis.unmarshalElement(context, input, scope, callback);\r\n\t\t} else if (this.mixed && (et === Jsonix.XML.Input.CHARACTERS || et === Jsonix.XML.Input.CDATA || et === Jsonix.XML.Input.ENTITY_REFERENCE)) {\r\n\t\t\tcallback(input.getText());\r\n\t\t} else if (this.mixed && (et === Jsonix.XML.Input.SPACE)) {\r\n\t\t\t// Whitespace\r\n\t\t\t// return null;\r\n\t\t} else if (et === Jsonix.XML.Input.COMMENT || et === Jsonix.XML.Input.PROCESSING_INSTRUCTION) {\r\n\t\t\t// return null;\r\n\t\t} else {\r\n\t\t\t// TODO better exception\r\n\t\t\tthrow new Error(\"Illegal state: unexpected event type [\" + et + \"].\");\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t},\r\n\tmarshal : function(value, context, output, scope) {\r\n\t\tif (!Jsonix.Util.Type.exists(value)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!this.collection) {\r\n\t\t\tthis.marshalItem(value, context, output, scope);\r\n\t\t} else {\r\n\t\t\tJsonix.Util.Ensure.ensureArray(value);\r\n\t\t\tfor (var index = 0; index < value.length; index++) {\r\n\t\t\t\tthis.marshalItem(value[index], context, output, scope);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tmarshalItem : function(value, context, output, scope) {\r\n\t\tif (this.mixed && Jsonix.Util.Type.isString(value)) {\r\n\t\t\t// Mixed\r\n\t\t\toutput.writeCharacters(value);\r\n\t\t} else if (this.allowDom && Jsonix.Util.Type.exists(value.nodeType)) {\r\n\t\t\t// DOM node\r\n\t\t\toutput.writeNode(value);\r\n\r\n\t\t} else {\r\n\t\t\tif (this.allowTypedObject) {\r\n\t\t\t\tthis.marshalElement(value, context, output, scope);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdoBuild : function(context, module) {\r\n\t\t// Nothing to do\r\n\t},\r\n\tbuildStructure : function(context, structure) {\r\n\t\tJsonix.Util.Ensure.ensureObject(structure);\r\n\t\tif (Jsonix.Util.Type.exists(structure.value)) {\r\n\t\t\t// TODO better exception\r\n\t\t\tthrow new Error(\"The structure already defines a value property.\");\r\n\t\t} else if (!Jsonix.Util.Type.exists(structure.elements)) {\r\n\t\t\tstructure.elements = {};\r\n\t\t}\r\n\r\n\t\tif ((this.allowDom || this.allowTypedObject)) {\r\n\t\t\t// if (Jsonix.Util.Type.exists(structure.any)) {\r\n\t\t\t// // TODO better exception\r\n\t\t\t// throw new Error(\"The structure already defines the any\r\n\t\t\t// property.\");\r\n\t\t\t// } else\r\n\t\t\t// {\r\n\t\t\tstructure.any = this;\r\n\t\t\t// }\r\n\t\t}\r\n\t\tif (this.mixed) {\r\n\t\t\t// if (Jsonix.Util.Type.exists(structure.mixed)) {\r\n\t\t\t// // TODO better exception\r\n\t\t\t// throw new Error(\"The structure already defines the mixed\r\n\t\t\t// property.\");\r\n\t\t\t// } else\r\n\t\t\t// {\r\n\t\t\tstructure.mixed = this;\r\n\t\t\t// }\r\n\t\t}\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.AnyElementPropertyInfo'\r\n});\r\nJsonix.Model.AnyElementPropertyInfo.Simplified = Jsonix.Class(Jsonix.Model.AnyElementPropertyInfo, Jsonix.Binding.Unmarshalls.Element.AsSimplifiedElementRef, {\r\n\tCLASS_NAME : 'Jsonix.Model.AnyElementPropertyInfo.Simplified'\r\n});\nJsonix.Model.Module = Jsonix.Class(Jsonix.Mapping.Styled, {\r\n\tname : null,\r\n\ttypeInfos : null,\r\n\telementInfos : null,\r\n\ttargetNamespace : '',\r\n\tdefaultElementNamespaceURI : '',\r\n\tdefaultAttributeNamespaceURI : '',\r\n\tinitialize : function(mapping, options) {\r\n\t\tJsonix.Mapping.Styled.prototype.initialize.apply(this, [ options ]);\r\n\t\tthis.typeInfos = [];\r\n\t\tthis.elementInfos = [];\r\n\t\tif (typeof mapping !== 'undefined') {\r\n\t\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\t\tvar n = mapping.name || mapping.n || null;\r\n\t\t\tthis.name = n;\r\n\t\t\tvar dens = mapping.defaultElementNamespaceURI || mapping.dens || mapping.targetNamespace || mapping.tns || '';\r\n\t\t\tthis.defaultElementNamespaceURI = dens;\r\n\t\t\tvar tns = mapping.targetNamespace || mapping.tns || mapping.defaultElementNamespaceURI || mapping.dens || this.defaultElementNamespaceURI;\r\n\t\t\tthis.targetNamespace = tns;\r\n\t\t\tvar dans = mapping.defaultAttributeNamespaceURI || mapping.dans || '';\r\n\t\t\tthis.defaultAttributeNamespaceURI = dans;\r\n\t\t\t// Initialize type infos\r\n\t\t\tvar tis = mapping.typeInfos || mapping.tis || [];\r\n\t\t\tthis.initializeTypeInfos(tis);\r\n\r\n\t\t\t// Backwards compatibility: class infos can also be defined\r\n\t\t\t// as properties of the schema, for instance Schema.MyType\r\n\t\t\tfor ( var typeInfoName in mapping) {\r\n\t\t\t\tif (mapping.hasOwnProperty(typeInfoName)) {\r\n\t\t\t\t\tif (mapping[typeInfoName] instanceof this.mappingStyle.classInfo) {\r\n\t\t\t\t\t\tthis.typeInfos.push(mapping[typeInfoName]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar eis = mapping.elementInfos || mapping.eis || [];\r\n\t\t\t// Initialize element infos\r\n\t\t\tthis.initializeElementInfos(eis);\r\n\t\t}\r\n\t},\r\n\tinitializeTypeInfos : function(typeInfoMappings) {\r\n\t\tJsonix.Util.Ensure.ensureArray(typeInfoMappings);\r\n\t\tvar index, typeInfoMapping, typeInfo;\r\n\t\tfor (index = 0; index < typeInfoMappings.length; index++) {\r\n\t\t\ttypeInfoMapping = typeInfoMappings[index];\r\n\t\t\ttypeInfo = this.createTypeInfo(typeInfoMapping);\r\n\t\t\tthis.typeInfos.push(typeInfo);\r\n\t\t}\r\n\t},\r\n\tinitializeElementInfos : function(elementInfoMappings) {\r\n\t\tJsonix.Util.Ensure.ensureArray(elementInfoMappings);\r\n\t\tvar index, elementInfoMapping, elementInfo;\r\n\t\tfor (index = 0; index < elementInfoMappings.length; index++) {\r\n\t\t\telementInfoMapping = elementInfoMappings[index];\r\n\t\t\telementInfo = this.createElementInfo(elementInfoMapping);\r\n\t\t\tthis.elementInfos.push(elementInfo);\r\n\t\t}\r\n\t},\r\n\tcreateTypeInfo : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tvar typeInfo;\r\n\t\t// If mapping is already a type info, do nothing\r\n\t\tif (mapping instanceof Jsonix.Model.TypeInfo) {\r\n\t\t\ttypeInfo = mapping;\r\n\t\t}\r\n\t\t// Else create it via generic mapping configuration\r\n\t\telse {\r\n\t\t\tmapping = Jsonix.Util.Type.cloneObject(mapping);\r\n\t\t\tvar type = mapping.type || mapping.t || 'classInfo';\r\n\t\t\t// Locate the creator function\r\n\t\t\tif (Jsonix.Util.Type.isFunction(this.typeInfoCreators[type])) {\r\n\t\t\t\tvar typeInfoCreator = this.typeInfoCreators[type];\r\n\t\t\t\t// Call the creator function\r\n\t\t\t\ttypeInfo = typeInfoCreator.call(this, mapping);\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(\"Unknown type info type [\" + type + \"].\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn typeInfo;\r\n\t},\r\n\tinitializeNames : function(mapping) {\r\n\t\tvar ln = mapping.localName || mapping.ln || null;\r\n\t\tmapping.localName = ln;\r\n\t\tvar n = mapping.name || mapping.n || null;\r\n\t\tmapping.name = n;\r\n\t\t// Calculate both name as well as localName\r\n\t\t// name is provided\r\n\t\tif (Jsonix.Util.Type.isString(mapping.name)) {\r\n\t\t\t// Obsolete code below\r\n\t\t\t// // localName is not provided\r\n\t\t\t// if (!Jsonix.Util.Type.isString(mapping.localName)) {\r\n\t\t\t// // But module name is provided\r\n\t\t\t// if (Jsonix.Util.Type.isString(this.name)) {\r\n\t\t\t// // If name starts with module name, use second part\r\n\t\t\t// // as local name\r\n\t\t\t// if (mapping.name.indexOf(this.name + '.') === 0) {\r\n\t\t\t// mapping.localName = mapping.name\r\n\t\t\t// .substring(this.name.length + 1);\r\n\t\t\t// }\r\n\t\t\t// // Else use name as local name\r\n\t\t\t// else {\r\n\t\t\t// mapping.localName = mapping.name;\r\n\t\t\t// }\r\n\t\t\t// }\r\n\t\t\t// // Module name is not provided, use name as local name\r\n\t\t\t// else {\r\n\t\t\t// mapping.localName = mapping.name;\r\n\t\t\t// }\r\n\t\t\t// }\r\n\t\t\tif (mapping.name.length > 0 && mapping.name.charAt(0) === '.' && Jsonix.Util.Type.isString(this.name)) {\r\n\t\t\t\tmapping.name = this.name + mapping.name;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// name is not provided but local name is provided\r\n\t\telse if (Jsonix.Util.Type.isString(ln)) {\r\n\t\t\t// Module name is provided\r\n\t\t\tif (Jsonix.Util.Type.isString(this.name)) {\r\n\t\t\t\tmapping.name = this.name + '.' + ln;\r\n\t\t\t}\r\n\t\t\t// Module name is not provided\r\n\t\t\telse {\r\n\t\t\t\tmapping.name = ln;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Neither [name/n] nor [localName/ln] was provided for the class info.\");\r\n\t\t}\r\n\t},\r\n\tcreateClassInfo : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tvar dens = mapping.defaultElementNamespaceURI || mapping.dens || this.defaultElementNamespaceURI;\r\n\t\tmapping.defaultElementNamespaceURI = dens;\r\n\t\tvar tns = mapping.targetNamespace || mapping.tns || this.targetNamespace;\r\n\t\tmapping.targetNamespace = tns;\r\n\t\tvar dans = mapping.defaultAttributeNamespaceURI || mapping.dans || this.defaultAttributeNamespaceURI;\r\n\t\tmapping.defaultAttributeNamespaceURI = dans;\r\n\t\tthis.initializeNames(mapping);\r\n\t\t// Now both name an local name are initialized\r\n\t\tvar classInfo = new this.mappingStyle.classInfo(mapping, {\r\n\t\t\tmappingStyle : this.mappingStyle\r\n\t\t});\r\n\t\tclassInfo.module = this;\r\n\t\treturn classInfo;\r\n\t},\r\n\tcreateEnumLeafInfo : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tthis.initializeNames(mapping);\r\n\t\t// Now both name an local name are initialized\r\n\t\tvar enumLeafInfo = new this.mappingStyle.enumLeafInfo(mapping, {\r\n\t\t\tmappingStyle : this.mappingStyle\r\n\t\t});\r\n\t\tenumLeafInfo.module = this;\r\n\t\treturn enumLeafInfo;\r\n\t},\r\n\tcreateList : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tvar ti = mapping.baseTypeInfo || mapping.typeInfo || mapping.bti || mapping.ti || 'String';\r\n\t\tvar tn = mapping.typeName || mapping.tn || null;\r\n\r\n\t\tif (Jsonix.Util.Type.exists(tn)) {\r\n\t\t\tif (Jsonix.Util.Type.isString(tn)) {\r\n\t\t\t\ttn = new Jsonix.XML.QName(this.targetNamespace, tn);\r\n\t\t\t} else {\r\n\t\t\t\ttn = Jsonix.XML.QName.fromObject(tn);\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar s = mapping.separator || mapping.sep || ' ';\r\n\t\tJsonix.Util.Ensure.ensureExists(ti);\r\n\t\tvar listTypeInfo = new Jsonix.Schema.XSD.List(ti, tn, s);\r\n\t\tlistTypeInfo.module = this;\r\n\t\treturn listTypeInfo;\r\n\t},\r\n\tcreateElementInfo : function(mapping) {\r\n\t\tJsonix.Util.Ensure.ensureObject(mapping);\r\n\t\tmapping = Jsonix.Util.Type.cloneObject(mapping);\r\n\r\n\t\tvar dens = mapping.defaultElementNamespaceURI || mapping.dens || this.defaultElementNamespaceURI;\r\n\t\tmapping.defaultElementNamespaceURI = dens;\r\n\t\tvar en = mapping.elementName || mapping.en || undefined;\r\n\t\tJsonix.Util.Ensure.ensureExists(en);\r\n\r\n\t\tvar ti = mapping.typeInfo || mapping.ti || 'String';\r\n\t\tJsonix.Util.Ensure.ensureExists(ti);\r\n\r\n\t\tmapping.typeInfo = ti;\r\n\t\tif (Jsonix.Util.Type.isObject(en)) {\r\n\t\t\tmapping.elementName = Jsonix.XML.QName.fromObject(en);\r\n\t\t} else if (Jsonix.Util.Type.isString(en)) {\r\n\t\t\tmapping.elementName = new Jsonix.XML.QName(this.defaultElementNamespaceURI, en);\r\n\t\t} else {\r\n\t\t\tthrow new Error('Element info [' + mapping + '] must provide an element name.');\r\n\t\t}\r\n\r\n\t\tvar sh = mapping.substitutionHead || mapping.sh || null;\r\n\t\tif (Jsonix.Util.Type.exists(sh)) {\r\n\t\t\tif (Jsonix.Util.Type.isObject(sh)) {\r\n\t\t\t\tmapping.substitutionHead = Jsonix.XML.QName.fromObject(sh);\r\n\t\t\t} else {\r\n\t\t\t\tJsonix.Util.Ensure.ensureString(sh);\r\n\t\t\t\tmapping.substitutionHead = new Jsonix.XML.QName(this.defaultElementNamespaceURI, sh);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar elementInfo = new this.mappingStyle.elementInfo(mapping, {\r\n\t\t\tmappingStyle : this.mappingStyle\r\n\t\t});\r\n\t\telementInfo.module = this;\r\n\t\treturn elementInfo;\r\n\t},\r\n\tregisterTypeInfos : function(context) {\r\n\t\tfor (var index = 0; index < this.typeInfos.length; index++) {\r\n\t\t\tvar typeInfo = this.typeInfos[index];\r\n\t\t\tcontext.registerTypeInfo(typeInfo, this);\r\n\t\t}\r\n\t},\r\n\tbuildTypeInfos : function(context) {\r\n\t\tfor (var index = 0; index < this.typeInfos.length; index++) {\r\n\t\t\tvar typeInfo = this.typeInfos[index];\r\n\t\t\ttypeInfo.build(context, this);\r\n\t\t}\r\n\t},\r\n\tregisterElementInfos : function(context) {\r\n\t\tfor (var index = 0; index < this.elementInfos.length; index++) {\r\n\t\t\tvar elementInfo = this.elementInfos[index];\r\n\t\t\tcontext.registerElementInfo(elementInfo, this);\r\n\t\t}\r\n\t},\r\n\tbuildElementInfos : function(context) {\r\n\t\tfor (var index = 0; index < this.elementInfos.length; index++) {\r\n\t\t\tvar elementInfo = this.elementInfos[index];\r\n\t\t\telementInfo.build(context, this);\r\n\t\t}\r\n\t},\r\n\t// Obsolete, retained for backwards compatibility\r\n\tcs : function() {\r\n\t\treturn this;\r\n\t},\r\n\t// Obsolete, retained for backwards compatibility\r\n\tes : function() {\r\n\t\treturn this;\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Model.Module'\r\n});\r\nJsonix.Model.Module.prototype.typeInfoCreators = {\r\n\t\"classInfo\" : Jsonix.Model.Module.prototype.createClassInfo,\r\n\t\"c\" : Jsonix.Model.Module.prototype.createClassInfo,\r\n\t\"enumInfo\" : Jsonix.Model.Module.prototype.createEnumLeafInfo,\r\n\t\"enum\" : Jsonix.Model.Module.prototype.createEnumLeafInfo,\r\n\t\"list\" : Jsonix.Model.Module.prototype.createList,\r\n\t\"l\" : Jsonix.Model.Module.prototype.createList\r\n};\nJsonix.Mapping.Style.Standard = Jsonix.Class(Jsonix.Mapping.Style, {\r\n\tmarshaller : Jsonix.Binding.Marshaller,\r\n\tunmarshaller : Jsonix.Binding.Unmarshaller,\r\n\tmodule : Jsonix.Model.Module,\r\n\telementInfo : Jsonix.Model.ElementInfo,\r\n\tclassInfo : Jsonix.Model.ClassInfo,\r\n\tenumLeafInfo : Jsonix.Model.EnumLeafInfo,\r\n\tanyAttributePropertyInfo : Jsonix.Model.AnyAttributePropertyInfo,\r\n\tanyElementPropertyInfo : Jsonix.Model.AnyElementPropertyInfo,\r\n\tattributePropertyInfo : Jsonix.Model.AttributePropertyInfo,\r\n\telementMapPropertyInfo : Jsonix.Model.ElementMapPropertyInfo,\r\n\telementPropertyInfo : Jsonix.Model.ElementPropertyInfo,\r\n\telementsPropertyInfo : Jsonix.Model.ElementsPropertyInfo,\r\n\telementRefPropertyInfo : Jsonix.Model.ElementRefPropertyInfo,\r\n\telementRefsPropertyInfo : Jsonix.Model.ElementRefsPropertyInfo,\r\n\tvaluePropertyInfo : Jsonix.Model.ValuePropertyInfo,\r\n\tinitialize : function() {\r\n\t\tJsonix.Mapping.Style.prototype.initialize.apply(this);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Mapping.Style.Standard'\r\n});\r\nJsonix.Mapping.Style.STYLES.standard = new Jsonix.Mapping.Style.Standard();\r\n\nJsonix.Mapping.Style.Simplified = Jsonix.Class(Jsonix.Mapping.Style, {\r\n\tmarshaller : Jsonix.Binding.Marshaller.Simplified,\r\n\tunmarshaller : Jsonix.Binding.Unmarshaller.Simplified,\r\n\tmodule : Jsonix.Model.Module,\r\n\telementInfo : Jsonix.Model.ElementInfo,\r\n\tclassInfo : Jsonix.Model.ClassInfo,\r\n\tenumLeafInfo : Jsonix.Model.EnumLeafInfo,\r\n\tanyAttributePropertyInfo : Jsonix.Model.AnyAttributePropertyInfo.Simplified,\r\n\tanyElementPropertyInfo : Jsonix.Model.AnyElementPropertyInfo.Simplified,\r\n\tattributePropertyInfo : Jsonix.Model.AttributePropertyInfo,\r\n\telementMapPropertyInfo : Jsonix.Model.ElementMapPropertyInfo,\r\n\telementPropertyInfo : Jsonix.Model.ElementPropertyInfo,\r\n\telementsPropertyInfo : Jsonix.Model.ElementsPropertyInfo,\r\n\telementRefPropertyInfo : Jsonix.Model.ElementRefPropertyInfo.Simplified,\r\n\telementRefsPropertyInfo : Jsonix.Model.ElementRefsPropertyInfo.Simplified,\r\n\tvaluePropertyInfo : Jsonix.Model.ValuePropertyInfo,\r\n\tinitialize : function() {\r\n\t\tJsonix.Mapping.Style.prototype.initialize.apply(this);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Mapping.Style.Simplified'\r\n});\r\nJsonix.Mapping.Style.STYLES.simplified = new Jsonix.Mapping.Style.Simplified();\r\n\nJsonix.Schema.XSD = {};\r\nJsonix.Schema.XSD.NAMESPACE_URI = 'http://www.w3.org/2001/XMLSchema';\r\nJsonix.Schema.XSD.PREFIX = 'xsd';\r\nJsonix.Schema.XSD.qname = function(localPart) {\r\n\tJsonix.Util.Ensure.ensureString(localPart);\r\n\treturn new Jsonix.XML.QName(Jsonix.Schema.XSD.NAMESPACE_URI, localPart,\r\n\t\t\tJsonix.Schema.XSD.PREFIX);\r\n};\r\n\nJsonix.Schema.XSD.AnyType = Jsonix.Class(Jsonix.Model.ClassInfo, {\r\n\ttypeName : Jsonix.Schema.XSD.qname('anyType'),\r\n\tinitialize : function() {\r\n\t\tJsonix.Model.ClassInfo.prototype.initialize.call(this, {\r\n\t\t\tname : 'AnyType',\r\n\t\t\tpropertyInfos : [ {\r\n\t\t\t\ttype : 'anyAttribute',\r\n\t\t\t\tname : 'attributes'\r\n\t\t\t}, {\r\n\t\t\t\ttype : 'anyElement',\r\n\t\t\t\tname : 'content',\r\n\t\t\t\tcollection : true\r\n\t\t\t} ]\r\n\t\t});\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.AnyType'\r\n});\r\nJsonix.Schema.XSD.AnyType.INSTANCE = new Jsonix.Schema.XSD.AnyType();\nJsonix.Schema.XSD.AnySimpleType = Jsonix.Class(Jsonix.Model.TypeInfo, {\r\n\tname : 'AnySimpleType',\r\n\ttypeName : Jsonix.Schema.XSD.qname('anySimpleType'),\r\n\tinitialize : function() {\r\n\t\tJsonix.Model.TypeInfo.prototype.initialize.apply(this, []);\r\n\t},\t\r\n\tprint : function(value, context, output, scope) {\r\n\t\treturn value;\r\n\t},\r\n\tparse : function(text, context, input, scope) {\r\n\t\treturn text;\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn true;\r\n\t},\r\n\treprint : function(value, context, output, scope) {\r\n\t\t// Only reprint when the value is a string but not an instance\r\n\t\tif (Jsonix.Util.Type.isString(value) && !this.isInstance(value, context, scope)) {\r\n\t\t\t// Using null as input as input is not available\r\n\t\t\treturn this.print(this.parse(value, context, null, scope), context, output, scope);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn this.print(value, context, output, scope);\r\n\t\t}\r\n\t},\r\n\tunmarshal : function(context, input, scope) {\r\n\t\tvar text = input.getElementText();\r\n\t\tif (Jsonix.Util.StringUtils.isNotBlank(text)) {\r\n\t\t\treturn this.parse(text, context, input, scope);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t},\r\n\tmarshal : function(value, context, output, scope) {\r\n\t\tif (Jsonix.Util.Type.exists(value)) {\r\n\t\t\toutput.writeCharacters(this.reprint(value, context, output, scope));\r\n\t\t}\r\n\t},\r\n\tbuild: function(context, module)\r\n\t{\r\n\t\t// Nothing to do\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.AnySimpleType'\r\n});\r\nJsonix.Schema.XSD.AnySimpleType.INSTANCE = new Jsonix.Schema.XSD.AnySimpleType();\nJsonix.Schema.XSD.List = Jsonix\r\n\t\t.Class(\r\n\t\t\t\tJsonix.Schema.XSD.AnySimpleType,\r\n\t\t\t\t{\r\n\t\t\t\t\tname : null,\r\n\t\t\t\t\ttypeName : null,\r\n\t\t\t\t\ttypeInfo : null,\r\n\t\t\t\t\tseparator : ' ',\r\n\t\t\t\t\ttrimmedSeparator : Jsonix.Util.StringUtils.whitespaceCharacters,\r\n\t\t\t\t\tsimpleType : true,\r\n\t\t\t\t\tbuilt : false,\r\n\t\t\t\t\tinitialize : function(typeInfo, typeName, separator) {\r\n\t\t\t\t\t\tJsonix.Util.Ensure.ensureExists(typeInfo);\r\n\t\t\t\t\t\t// TODO Ensure correct argument\r\n\t\t\t\t\t\tthis.typeInfo = typeInfo;\r\n\t\t\t\t\t\tif (!Jsonix.Util.Type.exists(this.name)) {\r\n\t\t\t\t\t\t\tthis.name = typeInfo.name + \"*\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (Jsonix.Util.Type.exists(typeName)) {\r\n\t\t\t\t\t\t\t// TODO Ensure correct argument\r\n\t\t\t\t\t\t\tthis.typeName = typeName;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (Jsonix.Util.Type.isString(separator)) {\r\n\t\t\t\t\t\t\t// TODO Ensure correct argument\r\n\t\t\t\t\t\t\tthis.separator = separator;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.separator = ' ';\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tvar trimmedSeparator = Jsonix.Util.StringUtils\r\n\t\t\t\t\t\t\t\t.trim(this.separator);\r\n\t\t\t\t\t\tif (trimmedSeparator.length === 0) {\r\n\t\t\t\t\t\t\tthis.trimmedSeparator = Jsonix.Util.StringUtils.whitespaceCharacters;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.trimmedSeparator = trimmedSeparator;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tbuild : function(context) {\r\n\t\t\t\t\t\tif (!this.built) {\r\n\t\t\t\t\t\t\tthis.typeInfo = context.resolveTypeInfo(this.typeInfo, this.module);\r\n\t\t\t\t\t\t\tthis.built = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tprint : function(value, context, output, scope) {\r\n\t\t\t\t\t\tif (!Jsonix.Util.Type.exists(value)) {\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// TODO Exception if not an array\r\n\t\t\t\t\t\tJsonix.Util.Ensure.ensureArray(value);\r\n\t\t\t\t\t\tvar result = '';\r\n\t\t\t\t\t\tfor ( var index = 0; index < value.length; index++) {\r\n\t\t\t\t\t\t\tif (index > 0) {\r\n\t\t\t\t\t\t\t\tresult = result + this.separator;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresult = result + this.typeInfo.reprint(value[index], context, output, scope);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tparse : function(text, context, input, scope) {\r\n\t\t\t\t\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\t\t\t\t\tvar items = Jsonix.Util.StringUtils\r\n\t\t\t\t\t\t\t\t.splitBySeparatorChars(text,\r\n\t\t\t\t\t\t\t\t\t\tthis.trimmedSeparator);\r\n\t\t\t\t\t\tvar result = [];\r\n\t\t\t\t\t\tfor ( var index = 0; index < items.length; index++) {\r\n\t\t\t\t\t\t\tresult.push(this.typeInfo\r\n\t\t\t\t\t\t\t\t\t.parse(Jsonix.Util.StringUtils.trim(items[index]), context, input, scope));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t},\r\n\t\t\t\t\t// TODO isInstance?\r\n\t\t\t\t\tCLASS_NAME : 'Jsonix.Schema.XSD.List'\r\n\t\t\t\t});\r\n\nJsonix.Schema.XSD.String = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {\r\n\tname : 'String',\r\n\ttypeName : Jsonix.Schema.XSD.qname('string'),\r\n\tunmarshal : function(context, input, scope) {\r\n\t\tvar text = input.getElementText();\r\n\t\treturn this.parse(text, context, input, scope);\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(value);\r\n\t\treturn value;\r\n\t},\r\n\tparse : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\treturn text;\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isString(value);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.String'\r\n});\r\nJsonix.Schema.XSD.String.INSTANCE = new Jsonix.Schema.XSD.String();\r\nJsonix.Schema.XSD.String.INSTANCE.LIST = new Jsonix.Schema.XSD.List(\r\n\t\tJsonix.Schema.XSD.String.INSTANCE);\nJsonix.Schema.XSD.Strings = Jsonix.Class(Jsonix.Schema.XSD.List, {\r\n\tname : 'Strings',\r\n\tinitialize : function() {\r\n\t\tJsonix.Schema.XSD.List.prototype.initialize.apply(this, [ Jsonix.Schema.XSD.String.INSTANCE, Jsonix.Schema.XSD.qname('strings'), ' ' ]);\r\n\t},\r\n\t// TODO Constraints\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Strings'\r\n});\r\nJsonix.Schema.XSD.Strings.INSTANCE = new Jsonix.Schema.XSD.Strings();\nJsonix.Schema.XSD.NormalizedString = Jsonix.Class(Jsonix.Schema.XSD.String, {\r\n\tname : 'NormalizedString',\r\n\ttypeName : Jsonix.Schema.XSD.qname('normalizedString'),\r\n\t// TODO Constraints\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.NormalizedString'\r\n});\r\nJsonix.Schema.XSD.NormalizedString.INSTANCE = new Jsonix.Schema.XSD.NormalizedString();\r\nJsonix.Schema.XSD.NormalizedString.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.NormalizedString.INSTANCE);\nJsonix.Schema.XSD.Token = Jsonix.Class(Jsonix.Schema.XSD.NormalizedString, {\r\n\tname : 'Token',\r\n\ttypeName : Jsonix.Schema.XSD.qname('token'),\r\n\t// TODO Constraints\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Token'\r\n});\r\nJsonix.Schema.XSD.Token.INSTANCE = new Jsonix.Schema.XSD.Token();\r\nJsonix.Schema.XSD.Token.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Token.INSTANCE);\nJsonix.Schema.XSD.Language = Jsonix.Class(Jsonix.Schema.XSD.Token, {\r\n\tname : 'Language',\r\n\ttypeName : Jsonix.Schema.XSD.qname('language'),\r\n\t// TODO Constraints\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Language'\r\n});\r\nJsonix.Schema.XSD.Language.INSTANCE = new Jsonix.Schema.XSD.Language();\r\nJsonix.Schema.XSD.Language.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Language.INSTANCE);\nJsonix.Schema.XSD.Name = Jsonix.Class(Jsonix.Schema.XSD.Token, {\r\n\tname : 'Name',\r\n\ttypeName : Jsonix.Schema.XSD.qname('Name'),\r\n\t// TODO Constraints\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Name'\r\n});\r\nJsonix.Schema.XSD.Name.INSTANCE = new Jsonix.Schema.XSD.Name();\r\nJsonix.Schema.XSD.Name.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Name.INSTANCE);\nJsonix.Schema.XSD.NCName = Jsonix.Class(Jsonix.Schema.XSD.Name, {\r\n\tname : 'NCName',\r\n\ttypeName : Jsonix.Schema.XSD.qname('NCName'),\r\n\t// TODO Constraints\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.NCName'\r\n});\r\nJsonix.Schema.XSD.NCName.INSTANCE = new Jsonix.Schema.XSD.NCName();\r\nJsonix.Schema.XSD.NCName.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.NCName.INSTANCE);\nJsonix.Schema.XSD.NMToken = Jsonix.Class(Jsonix.Schema.XSD.Token, {\r\n\tname : 'NMToken',\r\n\ttypeName : Jsonix.Schema.XSD.qname('NMTOKEN'),\r\n\t// TODO Constraints\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.NMToken'\r\n});\r\nJsonix.Schema.XSD.NMToken.INSTANCE = new Jsonix.Schema.XSD.NMToken();\nJsonix.Schema.XSD.NMTokens = Jsonix.Class(Jsonix.Schema.XSD.List, {\r\n\tname : 'NMTokens',\r\n\tinitialize : function() {\r\n\t\tJsonix.Schema.XSD.List.prototype.initialize.apply(this, [ Jsonix.Schema.XSD.NMToken.INSTANCE, Jsonix.Schema.XSD.qname('NMTOKEN'), ' ' ]);\r\n\t},\r\n\t// TODO Constraints\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.NMTokens'\r\n});\r\nJsonix.Schema.XSD.NMTokens.INSTANCE = new Jsonix.Schema.XSD.NMTokens();\nJsonix.Schema.XSD.Boolean = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {\r\n\tname : 'Boolean',\r\n\ttypeName : Jsonix.Schema.XSD.qname('boolean'),\r\n\tprint : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureBoolean(value);\r\n\t\treturn value ? 'true' : 'false';\r\n\t},\r\n\tparse : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\tif (text === 'true' || text === '1') {\r\n\t\t\treturn true;\r\n\t\t} else if (text === 'false' || text === '0') {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Either [true], [1], [0] or [false] expected as boolean value.\");\r\n\t\t}\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isBoolean(value);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Boolean'\r\n});\r\nJsonix.Schema.XSD.Boolean.INSTANCE = new Jsonix.Schema.XSD.Boolean();\r\nJsonix.Schema.XSD.Boolean.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Boolean.INSTANCE);\nJsonix.Schema.XSD.Base64Binary = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {\r\n\tname : 'Base64Binary',\r\n\ttypeName : Jsonix.Schema.XSD.qname('base64Binary'),\r\n\tcharToByte : {},\r\n\tbyteToChar : [],\r\n\tinitialize : function() {\r\n\t\tJsonix.Schema.XSD.AnySimpleType.prototype.initialize.apply(this);\r\n\t\t// Initialize charToByte and byteToChar table for fast\r\n\t\t// lookups\r\n\t\tvar charTable = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\r\n\t\tfor (var i = 0; i < charTable.length; i++) {\r\n\t\t\tvar _char = charTable.charAt(i);\r\n\t\t\tvar _byte = charTable.charCodeAt(i);\r\n\t\t\tthis.byteToChar[i] = _char;\r\n\t\t\tthis.charToByte[_char] = i;\r\n\t\t}\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureArray(value);\r\n\t\treturn this.encode(value);\r\n\t},\r\n\r\n\tparse : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\treturn this.decode(text);\r\n\t},\r\n\tencode : function(uarray) {\r\n\t\tvar output = \"\";\r\n\t\tvar byte0;\r\n\t\tvar byte1;\r\n\t\tvar byte2;\r\n\t\tvar char0;\r\n\t\tvar char1;\r\n\t\tvar char2;\r\n\t\tvar char3;\r\n\t\tvar i = 0;\r\n\t\tvar j = 0;\r\n\t\tvar length = uarray.length;\r\n\r\n\t\tfor (i = 0; i < length; i += 3) {\r\n\t\t\tbyte0 = uarray[i] & 0xFF;\r\n\t\t\tchar0 = this.byteToChar[byte0 >> 2];\r\n\r\n\t\t\tif (i + 1 < length) {\r\n\t\t\t\tbyte1 = uarray[i + 1] & 0xFF;\r\n\t\t\t\tchar1 = this.byteToChar[((byte0 & 0x03) << 4) | (byte1 >> 4)];\r\n\t\t\t\tif (i + 2 < length) {\r\n\t\t\t\t\tbyte2 = uarray[i + 2] & 0xFF;\r\n\t\t\t\t\tchar2 = this.byteToChar[((byte1 & 0x0F) << 2) | (byte2 >> 6)];\r\n\t\t\t\t\tchar3 = this.byteToChar[byte2 & 0x3F];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tchar2 = this.byteToChar[(byte1 & 0x0F) << 2];\r\n\t\t\t\t\tchar3 = \"=\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tchar1 = this.byteToChar[(byte0 & 0x03) << 4];\r\n\t\t\t\tchar2 = \"=\";\r\n\t\t\t\tchar3 = \"=\";\r\n\t\t\t}\r\n\t\t\toutput = output + char0 + char1 + char2 + char3;\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\tdecode : function(text) {\r\n\r\n\t\tinput = text.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\r\n\r\n\t\tvar length = Math.floor(input.length / 4 * 3);\r\n\t\tif (input.charAt(input.length - 1) === \"=\") {\r\n\t\t\tlength--;\r\n\t\t}\r\n\t\tif (input.charAt(input.length - 2) === \"=\") {\r\n\t\t\tlength--;\r\n\t\t}\r\n\r\n\t\tvar uarray = new Array(length);\r\n\r\n\t\tvar byte0;\r\n\t\tvar byte1;\r\n\t\tvar byte2;\r\n\t\tvar char0;\r\n\t\tvar char1;\r\n\t\tvar char2;\r\n\t\tvar char3;\r\n\t\tvar i = 0;\r\n\t\tvar j = 0;\r\n\r\n\t\tfor (i = 0; i < length; i += 3) {\r\n\t\t\t// get the 3 octects in 4 ascii chars\r\n\t\t\tchar0 = this.charToByte[input.charAt(j++)];\r\n\t\t\tchar1 = this.charToByte[input.charAt(j++)];\r\n\t\t\tchar2 = this.charToByte[input.charAt(j++)];\r\n\t\t\tchar3 = this.charToByte[input.charAt(j++)];\r\n\r\n\t\t\tbyte0 = (char0 << 2) | (char1 >> 4);\r\n\t\t\tbyte1 = ((char1 & 0x0F) << 4) | (char2 >> 2);\r\n\t\t\tbyte2 = ((char2 & 0x03) << 6) | char3;\r\n\r\n\t\t\tuarray[i] = byte0;\r\n\t\t\tif (char2 != 64) {\r\n\t\t\t\tuarray[i + 1] = byte1;\r\n\t\t\t}\r\n\t\t\tif (char3 != 64) {\r\n\t\t\t\tuarray[i + 2] = byte2;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn uarray;\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isArray(value);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Base64Binary'\r\n});\r\nJsonix.Schema.XSD.Base64Binary.INSTANCE = new Jsonix.Schema.XSD.Base64Binary();\r\nJsonix.Schema.XSD.Base64Binary.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Base64Binary.INSTANCE);\nJsonix.Schema.XSD.HexBinary = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {\r\n\tname : 'HexBinary',\r\n\ttypeName : Jsonix.Schema.XSD.qname('hexBinary'),\r\n\tcharToQuartet : {},\r\n\tbyteToDuplet : [],\r\n\tinitialize : function() {\r\n\t\tJsonix.Schema.XSD.AnySimpleType.prototype.initialize.apply(this);\r\n\t\tvar charTableUpperCase = \"0123456789ABCDEF\";\r\n\t\tvar charTableLowerCase = charTableUpperCase.toLowerCase();\r\n\t\tvar i;\r\n\t\tfor (i = 0; i < 16; i++) {\r\n\t\t\tthis.charToQuartet[charTableUpperCase.charAt(i)] = i;\r\n\t\t\tif (i >= 0xA) {\r\n\t\t\t\tthis.charToQuartet[charTableLowerCase.charAt(i)] = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (i = 0; i < 256; i++) {\r\n\t\t\tthis.byteToDuplet[i] =\r\n\t\t\t//\r\n\t\t\tcharTableUpperCase[i >> 4] + charTableUpperCase[i & 0xF];\r\n\t\t}\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureArray(value);\r\n\t\treturn this.encode(value);\r\n\t},\r\n\r\n\tparse : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\treturn this.decode(text);\r\n\t},\r\n\tencode : function(uarray) {\r\n\t\tvar output = \"\";\r\n\t\tfor ( var i = 0; i < uarray.length; i++) {\r\n\t\t\toutput = output + this.byteToDuplet[uarray[i] & 0xFF];\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\tdecode : function(text) {\r\n\t\tvar input = text.replace(/[^A-Fa-f0-9]/g, \"\");\r\n\t\t// Round by two\r\n\t\tvar length = input.length >> 1;\r\n\t\tvar uarray = new Array(length);\r\n\t\tfor ( var i = 0; i < length; i++) {\r\n\t\t\tvar char0 = input.charAt(2 * i);\r\n\t\t\tvar char1 = input.charAt(2 * i + 1);\r\n\t\t\tuarray[i] = this.charToQuartet[char0] << 4\r\n\t\t\t\t\t| this.charToQuartet[char1];\r\n\t\t}\r\n\t\treturn uarray;\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isArray(value);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.HexBinary'\r\n});\r\nJsonix.Schema.XSD.HexBinary.INSTANCE = new Jsonix.Schema.XSD.HexBinary();\r\nJsonix.Schema.XSD.HexBinary.INSTANCE.LIST = new Jsonix.Schema.XSD.List(\r\n\t\tJsonix.Schema.XSD.HexBinary.INSTANCE);\nJsonix.Schema.XSD.Number = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {\r\n\tname : 'Number',\r\n\ttypeName : Jsonix.Schema.XSD.qname('number'),\r\n\tprint : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureNumberOrNaN(value);\r\n\t\tif (Jsonix.Util.Type.isNaN(value)) {\r\n\t\t\treturn 'NaN';\r\n\t\t} else if (value === Infinity) {\r\n\t\t\treturn 'INF';\r\n\t\t} else if (value === -Infinity) {\r\n\t\t\treturn '-INF';\r\n\t\t} else {\r\n\t\t\tvar text = String(value);\r\n\t\t\treturn text;\r\n\t\t}\r\n\t},\r\n\tparse : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\tif (text === '-INF') {\r\n\t\t\treturn -Infinity;\r\n\t\t} else if (text === 'INF') {\r\n\t\t\treturn Infinity;\r\n\t\t} else if (text === 'NaN') {\r\n\t\t\treturn NaN;\r\n\t\t} else {\r\n\t\t\tvar value = Number(text);\r\n\t\t\tJsonix.Util.Ensure.ensureNumber(value);\r\n\t\t\treturn value;\r\n\t\t}\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isNumberOrNaN(value);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Number'\r\n});\r\nJsonix.Schema.XSD.Number.INSTANCE = new Jsonix.Schema.XSD.Number();\r\nJsonix.Schema.XSD.Number.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Number.INSTANCE);\nJsonix.Schema.XSD.Float = Jsonix.Class(Jsonix.Schema.XSD.Number, {\r\n\tname : 'Float',\r\n\ttypeName : Jsonix.Schema.XSD.qname('float'),\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isNaN(value) || value === -Infinity || value === Infinity || (Jsonix.Util.Type.isNumber(value) && value >= this.MIN_VALUE && value <= this.MAX_VALUE);\r\n\t},\r\n\tMIN_VALUE : -3.4028235e+38,\r\n\tMAX_VALUE : 3.4028235e+38,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Float'\r\n});\r\nJsonix.Schema.XSD.Float.INSTANCE = new Jsonix.Schema.XSD.Float();\r\nJsonix.Schema.XSD.Float.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Float.INSTANCE);\nJsonix.Schema.XSD.Decimal = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {\r\n\tname : 'Decimal',\r\n\ttypeName : Jsonix.Schema.XSD.qname('decimal'),\r\n\tprint : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureNumber(value);\r\n\t\tvar text = String(value);\r\n\t\treturn text;\r\n\t},\r\n\tparse : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\tvar value = Number(text);\r\n\t\tJsonix.Util.Ensure.ensureNumber(value);\r\n\t\treturn value;\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isNumber(value);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Decimal'\r\n});\r\nJsonix.Schema.XSD.Decimal.INSTANCE = new Jsonix.Schema.XSD.Decimal();\r\nJsonix.Schema.XSD.Decimal.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Decimal.INSTANCE);\nJsonix.Schema.XSD.Integer = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {\r\n\tname : 'Integer',\r\n\ttypeName : Jsonix.Schema.XSD.qname('integer'),\r\n\tprint : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureInteger(value);\r\n\t\tvar text = String(value);\r\n\t\treturn text;\r\n\t},\r\n\tparse : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\tvar value = Number(text);\r\n\t\tJsonix.Util.Ensure.ensureInteger(value);\r\n\t\treturn value;\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.NumberUtils.isInteger(value) && value >= this.MIN_VALUE && value <= this.MAX_VALUE;\r\n\t},\r\n\tMIN_VALUE : -9223372036854775808,\r\n\tMAX_VALUE : 9223372036854775807,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Integer'\r\n});\r\nJsonix.Schema.XSD.Integer.INSTANCE = new Jsonix.Schema.XSD.Integer();\r\nJsonix.Schema.XSD.Integer.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Integer.INSTANCE);\nJsonix.Schema.XSD.NonPositiveInteger = Jsonix.Class(Jsonix.Schema.XSD.Integer, {\r\n\tname : 'NonPositiveInteger',\r\n\ttypeName : Jsonix.Schema.XSD.qname('nonPositiveInteger'),\r\n\tMIN_VALUE: -9223372036854775808,\r\n\tMAX_VALUE: 0,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.NonPositiveInteger'\r\n});\r\nJsonix.Schema.XSD.NonPositiveInteger.INSTANCE = new Jsonix.Schema.XSD.NonPositiveInteger();\r\nJsonix.Schema.XSD.NonPositiveInteger.INSTANCE.LIST = new Jsonix.Schema.XSD.List(\r\n\t\tJsonix.Schema.XSD.NonPositiveInteger.INSTANCE);\nJsonix.Schema.XSD.NegativeInteger = Jsonix.Class(Jsonix.Schema.XSD.NonPositiveInteger, {\r\n\tname : 'NegativeInteger',\r\n\ttypeName : Jsonix.Schema.XSD.qname('negativeInteger'),\r\n\tMIN_VALUE: -9223372036854775808,\r\n\tMAX_VALUE: -1,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.NegativeInteger'\r\n});\r\nJsonix.Schema.XSD.NegativeInteger.INSTANCE = new Jsonix.Schema.XSD.NegativeInteger();\r\nJsonix.Schema.XSD.NegativeInteger.INSTANCE.LIST = new Jsonix.Schema.XSD.List(\r\n\t\tJsonix.Schema.XSD.NegativeInteger.INSTANCE);\nJsonix.Schema.XSD.Long = Jsonix.Class(Jsonix.Schema.XSD.Integer, {\r\n\tname : 'Long',\r\n\ttypeName : Jsonix.Schema.XSD.qname('long'),\r\n\tMIN_VALUE : -9223372036854775808,\r\n\tMAX_VALUE : 9223372036854775807,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Long'\r\n});\r\nJsonix.Schema.XSD.Long.INSTANCE = new Jsonix.Schema.XSD.Long();\r\nJsonix.Schema.XSD.Long.INSTANCE.LIST = new Jsonix.Schema.XSD.List(\r\n\t\tJsonix.Schema.XSD.Long.INSTANCE);\nJsonix.Schema.XSD.Int = Jsonix.Class(Jsonix.Schema.XSD.Long, {\r\n\tname : 'Int',\r\n\ttypeName : Jsonix.Schema.XSD.qname('int'),\r\n\tMIN_VALUE : -2147483648,\r\n\tMAX_VALUE : 2147483647,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Int'\r\n});\r\nJsonix.Schema.XSD.Int.INSTANCE = new Jsonix.Schema.XSD.Int();\r\nJsonix.Schema.XSD.Int.INSTANCE.LIST = new Jsonix.Schema.XSD.List(\r\n\t\tJsonix.Schema.XSD.Int.INSTANCE);\nJsonix.Schema.XSD.Short = Jsonix.Class(Jsonix.Schema.XSD.Int, {\r\n\tname : 'Short',\r\n\ttypeName : Jsonix.Schema.XSD.qname('short'),\r\n\tMIN_VALUE : -32768,\r\n\tMAX_VALUE : 32767,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Short'\r\n});\r\nJsonix.Schema.XSD.Short.INSTANCE = new Jsonix.Schema.XSD.Short();\r\nJsonix.Schema.XSD.Short.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Short.INSTANCE);\nJsonix.Schema.XSD.Byte = Jsonix.Class(Jsonix.Schema.XSD.Short, {\r\n\tname : 'Byte',\r\n\ttypeName : Jsonix.Schema.XSD.qname('byte'),\r\n\tMIN_VALUE : -128,\r\n\tMAX_VALUE : 127,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Byte'\r\n});\r\nJsonix.Schema.XSD.Byte.INSTANCE = new Jsonix.Schema.XSD.Byte();\r\nJsonix.Schema.XSD.Byte.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Byte.INSTANCE);\nJsonix.Schema.XSD.NonNegativeInteger = Jsonix.Class(Jsonix.Schema.XSD.Integer, {\r\n\tname : 'NonNegativeInteger',\r\n\ttypeName : Jsonix.Schema.XSD.qname('nonNegativeInteger'),\r\n\tMIN_VALUE: 0,\r\n\tMAX_VALUE: 9223372036854775807,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.NonNegativeInteger'\r\n});\r\nJsonix.Schema.XSD.NonNegativeInteger.INSTANCE = new Jsonix.Schema.XSD.NonNegativeInteger();\r\nJsonix.Schema.XSD.NonNegativeInteger.INSTANCE.LIST = new Jsonix.Schema.XSD.List(\r\n\t\tJsonix.Schema.XSD.NonNegativeInteger.INSTANCE);\nJsonix.Schema.XSD.UnsignedLong = Jsonix.Class(Jsonix.Schema.XSD.NonNegativeInteger, {\r\n\tname : 'UnsignedLong',\r\n\ttypeName : Jsonix.Schema.XSD.qname('unsignedLong'),\r\n\tMIN_VALUE : 0,\r\n\tMAX_VALUE : 18446744073709551615,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.UnsignedLong'\r\n});\r\nJsonix.Schema.XSD.UnsignedLong.INSTANCE = new Jsonix.Schema.XSD.UnsignedLong();\r\nJsonix.Schema.XSD.UnsignedLong.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedLong.INSTANCE);\nJsonix.Schema.XSD.UnsignedInt = Jsonix.Class(Jsonix.Schema.XSD.UnsignedLong, {\r\n\tname : 'UnsignedInt',\r\n\ttypeName : Jsonix.Schema.XSD.qname('unsignedInt'),\r\n\tMIN_VALUE : 0,\r\n\tMAX_VALUE : 4294967295,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.UnsignedInt'\r\n});\r\nJsonix.Schema.XSD.UnsignedInt.INSTANCE = new Jsonix.Schema.XSD.UnsignedInt();\r\nJsonix.Schema.XSD.UnsignedInt.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedInt.INSTANCE);\nJsonix.Schema.XSD.UnsignedShort = Jsonix.Class(Jsonix.Schema.XSD.UnsignedInt, {\r\n\tname : 'UnsignedShort',\r\n\ttypeName : Jsonix.Schema.XSD.qname('unsignedShort'),\r\n\tMIN_VALUE : 0,\r\n\tMAX_VALUE : 65535,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.UnsignedShort'\r\n});\r\nJsonix.Schema.XSD.UnsignedShort.INSTANCE = new Jsonix.Schema.XSD.UnsignedShort();\r\nJsonix.Schema.XSD.UnsignedShort.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedShort.INSTANCE);\nJsonix.Schema.XSD.UnsignedByte = Jsonix.Class(Jsonix.Schema.XSD.UnsignedShort, {\r\n\tname : 'UnsignedByte',\r\n\ttypeName : Jsonix.Schema.XSD.qname('unsignedByte'),\r\n\tMIN_VALUE : 0,\r\n\tMAX_VALUE : 255,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.UnsignedByte'\r\n});\r\nJsonix.Schema.XSD.UnsignedByte.INSTANCE = new Jsonix.Schema.XSD.UnsignedByte();\r\nJsonix.Schema.XSD.UnsignedByte.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedByte.INSTANCE);\nJsonix.Schema.XSD.PositiveInteger = Jsonix.Class(Jsonix.Schema.XSD.NonNegativeInteger, {\r\n\tname : 'PositiveInteger',\r\n\ttypeName : Jsonix.Schema.XSD.qname('positiveInteger'),\r\n\tMIN_VALUE : 1,\r\n\tMAX_VALUE : 9223372036854775807,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.PositiveInteger'\r\n});\r\nJsonix.Schema.XSD.PositiveInteger.INSTANCE = new Jsonix.Schema.XSD.PositiveInteger();\r\nJsonix.Schema.XSD.PositiveInteger.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.PositiveInteger.INSTANCE);\nJsonix.Schema.XSD.Double = Jsonix.Class(Jsonix.Schema.XSD.Number, {\r\n\tname : 'Double',\r\n\ttypeName : Jsonix.Schema.XSD.qname('double'),\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isNaN(value) || value === -Infinity || value === Infinity || (Jsonix.Util.Type.isNumber(value) && value >= this.MIN_VALUE && value <= this.MAX_VALUE);\r\n\t},\r\n\tMIN_VALUE : -1.7976931348623157e+308,\r\n\tMAX_VALUE : 1.7976931348623157e+308,\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Double'\r\n});\r\nJsonix.Schema.XSD.Double.INSTANCE = new Jsonix.Schema.XSD.Double();\r\nJsonix.Schema.XSD.Double.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Double.INSTANCE);\nJsonix.Schema.XSD.AnyURI = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {\r\n\tname : 'AnyURI',\r\n\ttypeName : Jsonix.Schema.XSD.qname('anyURI'),\r\n\tprint : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(value);\r\n\t\treturn value;\r\n\t},\r\n\tparse : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\treturn text;\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isString(value);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.AnyURI'\r\n});\r\nJsonix.Schema.XSD.AnyURI.INSTANCE = new Jsonix.Schema.XSD.AnyURI();\r\nJsonix.Schema.XSD.AnyURI.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.AnyURI.INSTANCE);\nJsonix.Schema.XSD.QName = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {\r\n\tname : 'QName',\r\n\ttypeName : Jsonix.Schema.XSD.qname('QName'),\r\n\tprint : function(value, context, output, scope) {\r\n\t\tvar qName = Jsonix.XML.QName.fromObject(value);\r\n\t\tvar prefix;\r\n\t\tvar localPart = qName.localPart;\r\n\t\tif (output) {\r\n\t\t\t// If QName does not provide the prefix, let it be generated\r\n\t\t\tprefix = output.getPrefix(qName.namespaceURI, qName.prefix||null);\r\n\t\t\toutput.declareNamespace(qName.namespaceURI, prefix);\r\n\t\t} else {\r\n\t\t\tprefix = qName.prefix;\r\n\t\t}\r\n\t\treturn !prefix ? localPart : (prefix + ':' + localPart);\r\n\t},\r\n\tparse : function(value, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(value);\r\n\t\tvalue = Jsonix.Util.StringUtils.trim(value);\r\n\t\tvar prefix;\r\n\t\tvar localPart;\r\n\t\tvar colonPosition = value.indexOf(':');\r\n\t\tif (colonPosition === -1) {\r\n\t\t\tprefix = '';\r\n\t\t\tlocalPart = value;\r\n\t\t} else if (colonPosition > 0 && colonPosition < (value.length - 1)) {\r\n\t\t\tprefix = value.substring(0, colonPosition);\r\n\t\t\tlocalPart = value.substring(colonPosition + 1);\r\n\t\t} else {\r\n\t\t\tthrow new Error('Invalid QName [' + value + '].');\r\n\t\t}\r\n\t\tvar namespaceContext = input || context || null;\r\n\t\tif (!namespaceContext)\r\n\t\t{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tvar namespaceURI = namespaceContext.getNamespaceURI(prefix);\r\n\t\t\tif (Jsonix.Util.Type.isString(namespaceURI))\r\n\t\t\t{\r\n\t\t\t\treturn new Jsonix.XML.QName(namespaceURI, localPart, prefix);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tthrow new Error('Prefix [' + prefix + '] of the QName [' + value + '] is not bound in this context.');\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn (value instanceof Jsonix.XML.QName) || (Jsonix.Util.Type.isObject(value) && Jsonix.Util.Type.isString(value.localPart || value.lp));\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.QName'\r\n});\r\nJsonix.Schema.XSD.QName.INSTANCE = new Jsonix.Schema.XSD.QName();\r\nJsonix.Schema.XSD.QName.INSTANCE.LIST = new Jsonix.Schema.XSD.List(\r\n\t\tJsonix.Schema.XSD.QName.INSTANCE);\nJsonix.Schema.XSD.Calendar = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {\r\n\tname : 'Calendar',\r\n\ttypeName : Jsonix.Schema.XSD.qname('calendar'),\r\n\tparse : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\tif (text.match(new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.DATETIME_PATTERN + \"$\"))) {\r\n\t\t\treturn this.parseDateTime(text, context, input, scope);\r\n\t\t} else if (text.match(new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.DATE_PATTERN + \"$\"))) {\r\n\t\t\treturn this.parseDate(text, context, input, scope);\r\n\t\t} else if (text.match(new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.TIME_PATTERN + \"$\"))) {\r\n\t\t\treturn this.parseTime(text, context, input, scope);\r\n\t\t} else if (text.match(new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.GYEAR_MONTH_PATTERN + \"$\"))) {\r\n\t\t\treturn this.parseGYearMonth(text, context, input, scope);\r\n\t\t} else if (text.match(new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.GYEAR_PATTERN + \"$\"))) {\r\n\t\t\treturn this.parseGYear(text, context, input, scope);\r\n\t\t} else if (text.match(new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.GMONTH_DAY_PATTERN + \"$\"))) {\r\n\t\t\treturn this.parseGMonthDay(text, context, input, scope);\r\n\t\t} else if (text.match(new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.GMONTH_PATTERN + \"$\"))) {\r\n\t\t\treturn this.parseGMonth(text, context, input, scope);\r\n\t\t} else if (text.match(new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.GDAY_PATTERN + \"$\"))) {\r\n\t\t\treturn this.parseGDay(text, context, input, scope);\r\n\t\t} else {\r\n\t\t\tthrow new Error('Value [' + text + '] does not match xs:dateTime, xs:date, xs:time, xs:gYearMonth, xs:gYear, xs:gMonthDay, xs:gMonth or xs:gDay patterns.');\r\n\t\t}\r\n\t},\r\n\tparseGYearMonth : function(value, context, input, scope) {\r\n\t\tvar gYearMonthExpression = new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.GYEAR_MONTH_PATTERN + \"$\");\r\n\t\tvar results = value.match(gYearMonthExpression);\r\n\t\tif (results !== null) {\r\n\t\t\tvar data = {\r\n\t\t\t\tyear : parseInt(results[1], 10),\r\n\t\t\t\tmonth : parseInt(results[5], 10),\r\n\t\t\t\ttimezone : this.parseTimezoneString(results[7])\r\n\t\t\t};\r\n\t\t\treturn new Jsonix.XML.Calendar(data);\r\n\t\t}\r\n\t\tthrow new Error('Value [' + value + '] does not match the xs:gYearMonth pattern.');\r\n\t},\r\n\tparseGYear : function(value, context, input, scope) {\r\n\t\tvar gYearExpression = new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.GYEAR_PATTERN + \"$\");\r\n\t\tvar results = value.match(gYearExpression);\r\n\t\tif (results !== null) {\r\n\t\t\tvar data = {\r\n\t\t\t\tyear : parseInt(results[1], 10),\r\n\t\t\t\ttimezone : this.parseTimezoneString(results[5])\r\n\t\t\t};\r\n\t\t\treturn new Jsonix.XML.Calendar(data);\r\n\t\t}\r\n\t\tthrow new Error('Value [' + value + '] does not match the xs:gYear pattern.');\r\n\t},\r\n\tparseGMonthDay : function(value, context, input, scope) {\r\n\t\tvar gMonthDayExpression = new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.GMONTH_DAY_PATTERN + \"$\");\r\n\t\tvar results = value.match(gMonthDayExpression);\r\n\t\tif (results !== null) {\r\n\t\t\tvar data = {\r\n\t\t\t\tmonth : parseInt(results[2], 10),\r\n\t\t\t\tday : parseInt(results[3], 10),\r\n\t\t\t\ttimezone : this.parseTimezoneString(results[5])\r\n\t\t\t};\r\n\t\t\treturn new Jsonix.XML.Calendar(data);\r\n\t\t}\r\n\t\tthrow new Error('Value [' + value + '] does not match the xs:gMonthDay pattern.');\r\n\t},\r\n\tparseGMonth : function(value, context, input, scope) {\r\n\t\tvar gMonthExpression = new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.GMONTH_PATTERN + \"$\");\r\n\t\tvar results = value.match(gMonthExpression);\r\n\t\tif (results !== null) {\r\n\t\t\tvar data = {\r\n\t\t\t\tmonth : parseInt(results[2], 10),\r\n\t\t\t\ttimezone : this.parseTimezoneString(results[3])\r\n\t\t\t};\r\n\t\t\treturn new Jsonix.XML.Calendar(data);\r\n\t\t}\r\n\t\tthrow new Error('Value [' + value + '] does not match the xs:gMonth pattern.');\r\n\t},\r\n\tparseGDay : function(value, context, input, scope) {\r\n\t\tvar gDayExpression = new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.GDAY_PATTERN + \"$\");\r\n\t\tvar results = value.match(gDayExpression);\r\n\t\tif (results !== null) {\r\n\t\t\tvar data = {\r\n\t\t\t\tday : parseInt(results[2], 10),\r\n\t\t\t\ttimezone : this.parseTimezoneString(results[3])\r\n\t\t\t};\r\n\t\t\treturn new Jsonix.XML.Calendar(data);\r\n\t\t}\r\n\t\tthrow new Error('Value [' + value + '] does not match the xs:gDay pattern.');\r\n\t},\r\n\tparseDateTime : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\tvar expression = new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.DATETIME_PATTERN + \"$\");\r\n\t\tvar results = text.match(expression);\r\n\t\tif (results !== null) {\r\n\t\t\tvar data = {\r\n\t\t\t\tyear : parseInt(results[1], 10),\r\n\t\t\t\tmonth : parseInt(results[5], 10),\r\n\t\t\t\tday : parseInt(results[7], 10),\r\n\t\t\t\thour : parseInt(results[9], 10),\r\n\t\t\t\tminute : parseInt(results[10], 10),\r\n\t\t\t\tsecond : parseInt(results[11], 10),\r\n\t\t\t\tfractionalSecond : (results[12] ? parseFloat(results[12]) : 0),\r\n\t\t\t\ttimezone : this.parseTimezoneString(results[14])\r\n\t\t\t};\r\n\t\t\treturn new Jsonix.XML.Calendar(data);\r\n\t\t}\r\n\t\tthrow new Error('Value [' + text + '] does not match the xs:date pattern.');\r\n\t},\r\n\tparseDate : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\tvar expression = new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.DATE_PATTERN + \"$\");\r\n\t\tvar results = text.match(expression);\r\n\t\tif (results !== null) {\r\n\t\t\tvar data = {\r\n\t\t\t\tyear : parseInt(results[1], 10),\r\n\t\t\t\tmonth : parseInt(results[5], 10),\r\n\t\t\t\tday : parseInt(results[7], 10),\r\n\t\t\t\ttimezone : this.parseTimezoneString(results[9])\r\n\t\t\t};\r\n\t\t\treturn new Jsonix.XML.Calendar(data);\r\n\t\t}\r\n\t\tthrow new Error('Value [' + text + '] does not match the xs:date pattern.');\r\n\t},\r\n\tparseTime : function(text, context, input, scope) {\r\n\t\tJsonix.Util.Ensure.ensureString(text);\r\n\t\tvar expression = new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.TIME_PATTERN + \"$\");\r\n\t\tvar results = text.match(expression);\r\n\t\tif (results !== null) {\r\n\t\t\tvar data = {\r\n\t\t\t\thour : parseInt(results[1], 10),\r\n\t\t\t\tminute : parseInt(results[2], 10),\r\n\t\t\t\tsecond : parseInt(results[3], 10),\r\n\t\t\t\tfractionalSecond : (results[4] ? parseFloat(results[4]) : 0),\r\n\t\t\t\ttimezone : this.parseTimezoneString(results[6])\r\n\t\t\t};\r\n\t\t\treturn new Jsonix.XML.Calendar(data);\r\n\t\t}\r\n\t\tthrow new Error('Value [' + text + '] does not match the xs:time pattern.');\r\n\t},\r\n\tparseTimezoneString : function(text) {\r\n\t\t// (('+' | '-') hh ':' mm) | 'Z'\r\n\t\tif (!Jsonix.Util.Type.isString(text)) {\r\n\t\t\treturn NaN;\r\n\t\t} else if (text === '') {\r\n\t\t\treturn NaN;\r\n\t\t} else if (text === 'Z') {\r\n\t\t\treturn 0;\r\n\t\t} else if (text === '+14:00') {\r\n\t\t\treturn 14 * 60;\r\n\t\t} else if (text === '-14:00') {\r\n\t\t\treturn -14 * 60;\r\n\t\t} else {\r\n\t\t\tvar expression = new RegExp(\"^\" + Jsonix.Schema.XSD.Calendar.TIMEZONE_PATTERN + \"$\");\r\n\t\t\tvar results = text.match(expression);\r\n\t\t\tif (results !== null) {\r\n\t\t\t\tvar sign = results[1] === '+' ? 1 : -1;\r\n\t\t\t\tvar hour = parseInt(results[4], 10);\r\n\t\t\t\tvar minute = parseInt(results[5], 10);\r\n\t\t\t\treturn sign * (hour * 60 + minute);\r\n\t\t\t}\r\n\t\t\tthrow new Error('Value [' + text + '] does not match the timezone pattern.');\r\n\t\t}\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tif (Jsonix.Util.NumberUtils.isInteger(value.year) && Jsonix.Util.NumberUtils.isInteger(value.month) && Jsonix.Util.NumberUtils.isInteger(value.day) && Jsonix.Util.NumberUtils.isInteger(value.hour) && Jsonix.Util.NumberUtils.isInteger(value.minute) && Jsonix.Util.NumberUtils.isInteger(value.second)) {\r\n\t\t\treturn this.printDateTime(value);\r\n\t\t} else if (Jsonix.Util.NumberUtils.isInteger(value.year) && Jsonix.Util.NumberUtils.isInteger(value.month) && Jsonix.Util.NumberUtils.isInteger(value.day)) {\r\n\t\t\treturn this.printDate(value);\r\n\t\t} else if (Jsonix.Util.NumberUtils.isInteger(value.hour) && Jsonix.Util.NumberUtils.isInteger(value.minute) && Jsonix.Util.NumberUtils.isInteger(value.second)) {\r\n\t\t\treturn this.printTime(value);\r\n\t\t} else if (Jsonix.Util.NumberUtils.isInteger(value.year) && Jsonix.Util.NumberUtils.isInteger(value.month)) {\r\n\t\t\treturn this.printGYearMonth(value);\r\n\t\t} else if (Jsonix.Util.NumberUtils.isInteger(value.month) && Jsonix.Util.NumberUtils.isInteger(value.day)) {\r\n\t\t\treturn this.printGMonthDay(value);\r\n\t\t} else if (Jsonix.Util.NumberUtils.isInteger(value.year)) {\r\n\t\t\treturn this.printGYear(value);\r\n\t\t} else if (Jsonix.Util.NumberUtils.isInteger(value.month)) {\r\n\t\t\treturn this.printGMonth(value);\r\n\t\t} else if (Jsonix.Util.NumberUtils.isInteger(value.day)) {\r\n\t\t\treturn this.printGDay(value);\r\n\t\t} else {\r\n\t\t\tthrow new Error('Value [' + value + '] is not recognized as dateTime, date or time.');\r\n\t\t}\r\n\t},\r\n\tprintDateTime : function(value) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tJsonix.Util.Ensure.ensureInteger(value.year);\r\n\t\tJsonix.Util.Ensure.ensureInteger(value.month);\r\n\t\tJsonix.Util.Ensure.ensureInteger(value.day);\r\n\t\tJsonix.Util.Ensure.ensureInteger(value.hour);\r\n\t\tJsonix.Util.Ensure.ensureInteger(value.minute);\r\n\t\tJsonix.Util.Ensure.ensureNumber(value.second);\r\n\t\tif (Jsonix.Util.Type.exists(value.fractionalString)) {\r\n\t\t\tJsonix.Util.Ensure.ensureNumber(value.fractionalString);\r\n\t\t}\r\n\t\tif (Jsonix.Util.Type.exists(value.timezone) && !Jsonix.Util.Type.isNaN(value.timezone)) {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(value.timezone);\r\n\t\t}\r\n\t\tvar result = this.printDateString(value);\r\n\t\tresult = result + 'T';\r\n\t\tresult = result + this.printTimeString(value);\r\n\t\tif (Jsonix.Util.Type.exists(value.timezone)) {\r\n\t\t\tresult = result + this.printTimezoneString(value.timezone);\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tprintDate : function(value) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tJsonix.Util.Ensure.ensureNumber(value.year);\r\n\t\tJsonix.Util.Ensure.ensureNumber(value.month);\r\n\t\tJsonix.Util.Ensure.ensureNumber(value.day);\r\n\t\tif (Jsonix.Util.Type.exists(value.timezone) && !Jsonix.Util.Type.isNaN(value.timezone)) {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(value.timezone);\r\n\t\t}\r\n\t\tvar result = this.printDateString(value);\r\n\t\tif (Jsonix.Util.Type.exists(value.timezone)) {\r\n\t\t\tresult = result + this.printTimezoneString(value.timezone);\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tprintTime : function(value) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tJsonix.Util.Ensure.ensureNumber(value.hour);\r\n\t\tJsonix.Util.Ensure.ensureNumber(value.minute);\r\n\t\tJsonix.Util.Ensure.ensureNumber(value.second);\r\n\t\tif (Jsonix.Util.Type.exists(value.fractionalString)) {\r\n\t\t\tJsonix.Util.Ensure.ensureNumber(value.fractionalString);\r\n\t\t}\r\n\t\tif (Jsonix.Util.Type.exists(value.timezone) && !Jsonix.Util.Type.isNaN(value.timezone)) {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(value.timezone);\r\n\t\t}\r\n\r\n\t\tvar result = this.printTimeString(value);\r\n\t\tif (Jsonix.Util.Type.exists(value.timezone)) {\r\n\t\t\tresult = result + this.printTimezoneString(value.timezone);\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tprintDateString : function(value) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tJsonix.Util.Ensure.ensureInteger(value.year);\r\n\t\tJsonix.Util.Ensure.ensureInteger(value.month);\r\n\t\tJsonix.Util.Ensure.ensureInteger(value.day);\r\n\t\treturn (value.year < 0 ? ('-' + this.printYear(-value.year)) : this.printYear(value.year)) + '-' + this.printMonth(value.month) + '-' + this.printDay(value.day);\r\n\t},\r\n\tprintTimeString : function(value) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tJsonix.Util.Ensure.ensureInteger(value.hour);\r\n\t\tJsonix.Util.Ensure.ensureInteger(value.minute);\r\n\t\tJsonix.Util.Ensure.ensureInteger(value.second);\r\n\t\tif (Jsonix.Util.Type.exists(value.fractionalSecond)) {\r\n\t\t\tJsonix.Util.Ensure.ensureNumber(value.fractionalSecond);\r\n\t\t}\r\n\t\tvar result = this.printHour(value.hour);\r\n\t\tresult = result + ':';\r\n\t\tresult = result + this.printMinute(value.minute);\r\n\t\tresult = result + ':';\r\n\t\tresult = result + this.printSecond(value.second);\r\n\t\tif (Jsonix.Util.Type.exists(value.fractionalSecond)) {\r\n\t\t\tresult = result + this.printFractionalSecond(value.fractionalSecond);\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tprintTimezoneString : function(value) {\r\n\t\tif (!Jsonix.Util.Type.exists(value) || Jsonix.Util.Type.isNaN(value)) {\r\n\t\t\treturn '';\r\n\t\t} else {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(value);\r\n\r\n\t\t\tvar sign = value < 0 ? -1 : (value > 0 ? 1 : 0);\r\n\t\t\tvar data = value * sign;\r\n\t\t\tvar minute = data % 60;\r\n\t\t\tvar hour = Math.floor(data / 60);\r\n\r\n\t\t\tvar result;\r\n\t\t\tif (sign === 0) {\r\n\t\t\t\treturn 'Z';\r\n\t\t\t} else {\r\n\t\t\t\tif (sign > 0) {\r\n\t\t\t\t\tresult = '+';\r\n\t\t\t\t} else if (sign < 0) {\r\n\t\t\t\t\tresult = '-';\r\n\t\t\t\t}\r\n\t\t\t\tresult = result + this.printHour(hour);\r\n\t\t\t\tresult = result + ':';\r\n\t\t\t\tresult = result + this.printMinute(minute);\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tprintGDay : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tvar day = undefined;\r\n\t\tvar timezone = undefined;\r\n\r\n\t\tif (value instanceof Date) {\r\n\t\t\tday = value.getDate();\r\n\t\t} else {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(value.day);\r\n\t\t\tday = value.day;\r\n\t\t\ttimezone = value.timezone;\r\n\t\t}\r\n\t\tJsonix.XML.Calendar.validateDay(day);\r\n\t\tJsonix.XML.Calendar.validateTimezone(timezone);\r\n\t\treturn \"---\" + this.printDay(day) + this.printTimezoneString(timezone);\r\n\t},\r\n\tprintGMonth : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tvar month = undefined;\r\n\t\tvar timezone = undefined;\r\n\r\n\t\tif (value instanceof Date) {\r\n\t\t\tmonth = value.getMonth() + 1;\r\n\t\t} else {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(value.month);\r\n\t\t\tmonth = value.month;\r\n\t\t\ttimezone = value.timezone;\r\n\t\t}\r\n\t\tJsonix.XML.Calendar.validateMonth(month);\r\n\t\tJsonix.XML.Calendar.validateTimezone(timezone);\r\n\t\treturn \"--\" + this.printMonth(month) + this.printTimezoneString(timezone);\r\n\t},\r\n\tprintGMonthDay : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tvar month = undefined;\r\n\t\tvar day = undefined;\r\n\t\tvar timezone = undefined;\r\n\r\n\t\tif (value instanceof Date) {\r\n\t\t\tmonth = value.getMonth() + 1;\r\n\t\t\tday = value.getDate();\r\n\t\t} else {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(value.month);\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(value.day);\r\n\t\t\tmonth = value.month;\r\n\t\t\tday = value.day;\r\n\t\t\ttimezone = value.timezone;\r\n\t\t}\r\n\t\tJsonix.XML.Calendar.validateMonthDay(month, day);\r\n\t\tJsonix.XML.Calendar.validateTimezone(timezone);\r\n\t\treturn \"--\" + this.printMonth(month) + \"-\" + this.printDay(day) + this.printTimezoneString(timezone);\r\n\t},\r\n\tprintGYear : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tvar year = undefined;\r\n\t\tvar timezone = undefined;\r\n\r\n\t\tif (value instanceof Date) {\r\n\t\t\tyear = value.getFullYear();\r\n\t\t} else {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(value.year);\r\n\t\t\tyear = value.year;\r\n\t\t\ttimezone = value.timezone;\r\n\t\t}\r\n\t\tJsonix.XML.Calendar.validateYear(year);\r\n\t\tJsonix.XML.Calendar.validateTimezone(timezone);\r\n\t\treturn this.printSignedYear(year) + this.printTimezoneString(timezone);\r\n\t},\r\n\tprintGYearMonth : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tvar year = undefined;\r\n\t\tvar month = undefined;\r\n\t\tvar timezone = undefined;\r\n\r\n\t\tif (value instanceof Date) {\r\n\t\t\tyear = value.getFullYear();\r\n\t\t\tmonth = value.getMonth() + 1;\r\n\t\t} else {\r\n\t\t\tJsonix.Util.Ensure.ensureInteger(value.year);\r\n\t\t\tyear = value.year;\r\n\t\t\tmonth = value.month;\r\n\t\t\ttimezone = value.timezone;\r\n\t\t}\r\n\t\tJsonix.XML.Calendar.validateYear(year);\r\n\t\tJsonix.XML.Calendar.validateMonth(month);\r\n\t\tJsonix.XML.Calendar.validateTimezone(timezone);\r\n\t\treturn this.printSignedYear(year) + \"-\" + this.printMonth(month) + this.printTimezoneString(timezone);\r\n\t},\r\n\tprintSignedYear : function(value) {\r\n\t\treturn value < 0 ? (\"-\" + this.printYear(value * -1)) : (this.printYear(value));\r\n\t},\r\n\tprintYear : function(value) {\r\n\t\treturn this.printInteger(value, 4);\r\n\t},\r\n\tprintMonth : function(value) {\r\n\t\treturn this.printInteger(value, 2);\r\n\t},\r\n\tprintDay : function(value) {\r\n\t\treturn this.printInteger(value, 2);\r\n\t},\r\n\tprintHour : function(value) {\r\n\t\treturn this.printInteger(value, 2);\r\n\t},\r\n\tprintMinute : function(value) {\r\n\t\treturn this.printInteger(value, 2);\r\n\t},\r\n\tprintSecond : function(value) {\r\n\t\treturn this.printInteger(value, 2);\r\n\t},\r\n\tprintFractionalSecond : function(value) {\r\n\t\tJsonix.Util.Ensure.ensureNumber(value);\r\n\t\tif (value < 0 || value >= 1) {\r\n\t\t\tthrow new Error('Fractional second [' + value + '] must be between 0 and 1.');\r\n\t\t} else if (value === 0) {\r\n\t\t\treturn '';\r\n\t\t} else {\r\n\t\t\tvar string = String(value);\r\n\t\t\tvar dotIndex = string.indexOf('.');\r\n\t\t\tif (dotIndex < 0) {\r\n\t\t\t\treturn '';\r\n\t\t\t} else {\r\n\t\t\t\treturn string.substring(dotIndex);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tprintInteger : function(value, length) {\r\n\t\tJsonix.Util.Ensure.ensureInteger(value);\r\n\t\tJsonix.Util.Ensure.ensureInteger(length);\r\n\t\tif (length <= 0) {\r\n\t\t\tthrow new Error('Length [' + value + '] must be positive.');\r\n\t\t}\r\n\t\tif (value < 0) {\r\n\t\t\tthrow new Error('Value [' + value + '] must not be negative.');\r\n\t\t}\r\n\t\tvar result = String(value);\r\n\t\tfor (var i = result.length; i < length; i++) {\r\n\t\t\tresult = '0' + result;\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isObject(value) && ((Jsonix.Util.NumberUtils.isInteger(value.year) && Jsonix.Util.NumberUtils.isInteger(value.month) && Jsonix.Util.NumberUtils.isInteger(value.day)) || (Jsonix.Util.NumberUtils.isInteger(value.hour) && Jsonix.Util.NumberUtils.isInteger(value.minute) && Jsonix.Util.NumberUtils.isInteger(value.second)));\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Calendar'\r\n});\r\n\r\nJsonix.Schema.XSD.Calendar.YEAR_PATTERN = \"-?([1-9][0-9]*)?((?!(0000))[0-9]{4})\";\r\nJsonix.Schema.XSD.Calendar.TIMEZONE_PATTERN = \"Z|([\\\\-\\\\+])(((0[0-9]|1[0-3]):([0-5][0-9]))|(14:00))\";\r\nJsonix.Schema.XSD.Calendar.MONTH_PATTERN = \"(0[1-9]|1[0-2])\";\r\nJsonix.Schema.XSD.Calendar.SINGLE_MONTH_PATTERN = \"\\\\-\\\\-\" + Jsonix.Schema.XSD.Calendar.MONTH_PATTERN;\r\nJsonix.Schema.XSD.Calendar.DAY_PATTERN = \"(0[1-9]|[12][0-9]|3[01])\";\r\nJsonix.Schema.XSD.Calendar.SINGLE_DAY_PATTERN = \"\\\\-\\\\-\\\\-\" + Jsonix.Schema.XSD.Calendar.DAY_PATTERN;\r\nJsonix.Schema.XSD.Calendar.GYEAR_PATTERN = \"(\" + Jsonix.Schema.XSD.Calendar.YEAR_PATTERN + \")\" + \"(\" + Jsonix.Schema.XSD.Calendar.TIMEZONE_PATTERN + \")?\";\r\nJsonix.Schema.XSD.Calendar.GMONTH_PATTERN = \"(\" + Jsonix.Schema.XSD.Calendar.SINGLE_MONTH_PATTERN + \")\" + \"(\" + Jsonix.Schema.XSD.Calendar.TIMEZONE_PATTERN + \")?\";\r\nJsonix.Schema.XSD.Calendar.GDAY_PATTERN = \"(\" + Jsonix.Schema.XSD.Calendar.SINGLE_DAY_PATTERN + \")\" + \"(\" + Jsonix.Schema.XSD.Calendar.TIMEZONE_PATTERN + \")?\";\r\nJsonix.Schema.XSD.Calendar.GYEAR_MONTH_PATTERN = \"(\" + Jsonix.Schema.XSD.Calendar.YEAR_PATTERN + \")\" + \"-\" + \"(\" + Jsonix.Schema.XSD.Calendar.DAY_PATTERN + \")\" + \"(\" + Jsonix.Schema.XSD.Calendar.TIMEZONE_PATTERN + \")?\";\r\nJsonix.Schema.XSD.Calendar.GMONTH_DAY_PATTERN = \"(\" + Jsonix.Schema.XSD.Calendar.SINGLE_MONTH_PATTERN + \")\" + \"-\" + \"(\" + Jsonix.Schema.XSD.Calendar.DAY_PATTERN + \")\" + \"(\" + Jsonix.Schema.XSD.Calendar.TIMEZONE_PATTERN + \")?\";\r\nJsonix.Schema.XSD.Calendar.DATE_PART_PATTERN = \"(\" + Jsonix.Schema.XSD.Calendar.YEAR_PATTERN + \")\" + \"-\" + \"(\" + Jsonix.Schema.XSD.Calendar.MONTH_PATTERN + \")\" + \"-\" + \"(\" + Jsonix.Schema.XSD.Calendar.DAY_PATTERN + \")\";\r\nJsonix.Schema.XSD.Calendar.TIME_PART_PATTERN = \"([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(\\\\.([0-9]+))?\";\r\nJsonix.Schema.XSD.Calendar.TIME_PATTERN = Jsonix.Schema.XSD.Calendar.TIME_PART_PATTERN + '(' + Jsonix.Schema.XSD.Calendar.TIMEZONE_PATTERN + ')?';\r\nJsonix.Schema.XSD.Calendar.DATE_PATTERN = Jsonix.Schema.XSD.Calendar.DATE_PART_PATTERN + '(' + Jsonix.Schema.XSD.Calendar.TIMEZONE_PATTERN + ')?';\r\nJsonix.Schema.XSD.Calendar.DATETIME_PATTERN = Jsonix.Schema.XSD.Calendar.DATE_PART_PATTERN + 'T' + Jsonix.Schema.XSD.Calendar.TIME_PART_PATTERN + '(' + Jsonix.Schema.XSD.Calendar.TIMEZONE_PATTERN + ')?';\r\nJsonix.Schema.XSD.Calendar.INSTANCE = new Jsonix.Schema.XSD.Calendar();\r\nJsonix.Schema.XSD.Calendar.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Calendar.INSTANCE);\nJsonix.Schema.XSD.Duration = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {\r\n\tname : 'Duration',\r\n\ttypeName : Jsonix.Schema.XSD.qname('duration'),\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isObject(value) && (\r\n\t\t\t\t(Jsonix.Util.Type.exists(value.sign) ? (value.sign === -1 || value.sign === 1) : true)\r\n\t\t\t\t(Jsonix.Util.NumberUtils.isInteger(value.years) && value.years >=0) ||\r\n\t\t\t\t(Jsonix.Util.NumberUtils.isInteger(value.months) && value.months >=0) ||\r\n\t\t\t\t(Jsonix.Util.NumberUtils.isInteger(value.days) && value.days >= 0) ||\r\n\t\t\t\t(Jsonix.Util.NumberUtils.isInteger(value.hours) && value.hours >= 0) ||\r\n\t\t\t\t(Jsonix.Util.NumberUtils.isInteger(value.minutes) && value.minutes >= 0) ||\r\n\t\t\t\t(Jsonix.Util.Type.isNumber(value.seconds) && value.seconds >= 0) );\r\n\t},\r\n\tvalidate : function(value) {\r\n\t\tJsonix.Util.Ensure.ensureObject(value);\r\n\t\tif (Jsonix.Util.Type.exists(value.sign)) {\r\n\t\t\tif (!(value.sign === 1 || value.sign === -1)) {\r\n\t\t\t\tthrow new Error(\"Sign of the duration [\" + value.sign + \"] must be either [1] or [-1].\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar empty = true;\r\n\t\tvar ifExistsEnsureUnsignedInteger = function(v, message) {\r\n\t\t\tif (Jsonix.Util.Type.exists(v)) {\r\n\t\t\t\tif (!(Jsonix.Util.NumberUtils.isInteger(v) && v >= 0)) {\r\n\t\t\t\t\tthrow new Error(message.replace(\"{0}\", v));\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tvar ifExistsEnsureUnsignedNumber = function(v, message) {\r\n\t\t\tif (Jsonix.Util.Type.exists(v)) {\r\n\t\t\t\tif (!(Jsonix.Util.Type.isNumber(v) && v >= 0)) {\r\n\t\t\t\t\tthrow new Error(message.replace(\"{0}\", v));\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tempty = empty && !ifExistsEnsureUnsignedInteger(value.years, \"Number of years [{0}] must be an unsigned integer.\");\r\n\t\tempty = empty && !ifExistsEnsureUnsignedInteger(value.months, \"Number of months [{0}] must be an unsigned integer.\");\r\n\t\tempty = empty && !ifExistsEnsureUnsignedInteger(value.days, \"Number of days [{0}] must be an unsigned integer.\");\r\n\t\tempty = empty && !ifExistsEnsureUnsignedInteger(value.hours, \"Number of hours [{0}] must be an unsigned integer.\");\r\n\t\tempty = empty && !ifExistsEnsureUnsignedInteger(value.minutes, \"Number of minutes [{0}] must be an unsigned integer.\");\r\n\t\tempty = empty && !ifExistsEnsureUnsignedNumber(value.seconds, \"Number of seconds [{0}] must be an unsigned number.\");\r\n\t\tif (empty) {\r\n\t\t\tthrow new Error(\"At least one of the components (years, months, days, hours, minutes, seconds) must be set.\");\r\n\t\t}\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\tthis.validate(value);\r\n\t\tvar result = '';\r\n\t\tif (value.sign === -1)\r\n\t\t{\r\n\t\t\tresult += '-';\r\n\t\t}\r\n\t\tresult += 'P';\r\n\t\tif (Jsonix.Util.Type.exists(value.years)) {\r\n\t\t\tresult += (value.years + 'Y');\r\n\t\t}\r\n\t\tif (Jsonix.Util.Type.exists(value.months)) {\r\n\t\t\tresult += (value.months + 'M');\r\n\t\t}\r\n\t\tif (Jsonix.Util.Type.exists(value.days)) {\r\n\t\t\tresult += (value.days + 'D');\r\n\t\t}\r\n\t\tif (Jsonix.Util.Type.exists(value.hours) || Jsonix.Util.Type.exists(value.minutes) || Jsonix.Util.Type.exists(value.seconds))\r\n\t\t{\r\n\t\t\tresult += 'T';\r\n\t\t\tif (Jsonix.Util.Type.exists(value.hours)) {\r\n\t\t\t\tresult += (value.hours + 'H');\r\n\t\t\t}\r\n\t\t\tif (Jsonix.Util.Type.exists(value.minutes)) {\r\n\t\t\t\tresult += (value.minutes + 'M');\r\n\t\t\t}\r\n\t\t\tif (Jsonix.Util.Type.exists(value.seconds)) {\r\n\t\t\t\tresult += (value.seconds + 'S');\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tparse : function(value, context, input, scope) {\r\n\t\tvar durationExpression = new RegExp(\"^\" + Jsonix.Schema.XSD.Duration.PATTERN + \"$\");\r\n\t\tvar results = value.match(durationExpression);\r\n\t\tif (results !== null) {\r\n\t\t\tvar empty = true;\r\n\t\t\tvar duration = {};\r\n\t\t\tif (results[1]) { duration.sign = -1; }\r\n\t\t\tif (results[3]) { duration.years = parseInt(results[3], 10); empty = false; }\r\n\t\t\tif (results[5]) { duration.months = parseInt(results[5], 10); empty = false; }\r\n\t\t\tif (results[7]) { duration.days = parseInt(results[7], 10); empty = false; }\r\n\t\t\tif (results[10]) { duration.hours = parseInt(results[10], 10); empty = false; }\r\n\t\t\tif (results[12]) { duration.minutes = parseInt(results[12], 10); empty = false; }\r\n\t\t\tif (results[14]) { duration.seconds = Number(results[14]); empty = false; }\r\n\t\t\treturn duration;\r\n\t\t} else {\r\n\t\t\tthrow new Error('Value [' + value + '] does not match the duration pattern.');\r\n\t\t}\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Duration'\r\n});\r\nJsonix.Schema.XSD.Duration.PATTERN = '(-)?P(([0-9]+)Y)?(([0-9]+)M)?(([0-9]+)D)?(T(([0-9]+)H)?(([0-9]+)M)?(([0-9]+(\\\\.[0-9]+)?)S)?)?';\r\nJsonix.Schema.XSD.Duration.INSTANCE = new Jsonix.Schema.XSD.Duration();\r\nJsonix.Schema.XSD.Duration.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Duration.INSTANCE);\nJsonix.Schema.XSD.DateTime = Jsonix.Class(Jsonix.Schema.XSD.Calendar, {\r\n\tname : 'DateTime',\r\n\ttypeName : Jsonix.Schema.XSD.qname('dateTime'),\r\n\tparse : function(value, context, input, scope) {\r\n\t\treturn this.parseDateTime(value);\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\treturn this.printDateTime(value);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.DateTime'\r\n});\r\nJsonix.Schema.XSD.DateTime.INSTANCE = new Jsonix.Schema.XSD.DateTime();\r\nJsonix.Schema.XSD.DateTime.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.DateTime.INSTANCE);\r\n\nJsonix.Schema.XSD.DateTimeAsDate = Jsonix.Class(Jsonix.Schema.XSD.Calendar, {\r\n\tname : 'DateTimeAsDate',\r\n\ttypeName : Jsonix.Schema.XSD.qname('dateTime'),\r\n\tparse : function(value, context, input, scope) {\r\n\t\tvar calendar = this.parseDateTime(value);\r\n\t\tvar date = new Date();\r\n\t\tdate.setFullYear(calendar.year);\r\n\t\tdate.setMonth(calendar.month - 1);\r\n\t\tdate.setDate(calendar.day);\r\n\t\tdate.setHours(calendar.hour);\r\n\t\tdate.setMinutes(calendar.minute);\r\n\t\tdate.setSeconds(calendar.second);\r\n\t\tif (Jsonix.Util.Type.isNumber(calendar.fractionalSecond)) {\r\n\t\t\tdate.setMilliseconds(Math.floor(1000 * calendar.fractionalSecond));\r\n\t\t}\r\n\t\tvar timezone;\r\n\t\tvar unknownTimezone;\r\n\t\tvar localTimezone = - date.getTimezoneOffset();\r\n\t\tif (Jsonix.Util.NumberUtils.isInteger(calendar.timezone))\r\n\t\t{\r\n\t\t\ttimezone = calendar.timezone;\r\n\t\t\tunknownTimezone = false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Unknown timezone\r\n\t\t\ttimezone = localTimezone;\r\n\t\t\tunknownTimezone = true;\r\n\t\t}\r\n\t\t//\r\n\t\tvar result = new Date(date.getTime() + (60000 * (- timezone + localTimezone)));\r\n\t\tif (unknownTimezone)\r\n\t\t{\r\n\t\t\t// null denotes \"unknown timezone\"\r\n\t\t\tresult.originalTimezone = null;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tresult.originalTimezone = calendar.timezone;\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureDate(value);\r\n\t\tvar timezone;\r\n\t\tvar localTimezone = - value.getTimezoneOffset();\r\n\t\tvar correctedValue;\r\n\t\t// If original time zone was unknown, print the given value without\r\n\t\t// the timezone\r\n\t\tif (value.originalTimezone === null)\r\n\t\t{\r\n\t\t\treturn this.printDateTime(new Jsonix.XML.Calendar({\r\n\t\t\t\tyear : value.getFullYear(),\r\n\t\t\t\tmonth : value.getMonth() + 1,\r\n\t\t\t\tday : value.getDate(),\r\n\t\t\t\thour : value.getHours(),\r\n\t\t\t\tminute : value.getMinutes(),\r\n\t\t\t\tsecond : value.getSeconds(),\r\n\t\t\t\tfractionalSecond : (value.getMilliseconds() / 1000)\r\n\t\t\t}));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// If original timezone was known, correct and print the value with the timezone\r\n\t\t\tif (Jsonix.Util.NumberUtils.isInteger(value.originalTimezone))\r\n\t\t\t{\r\n\t\t\t\ttimezone = value.originalTimezone;\r\n\t\t\t\tcorrectedValue = new Date(value.getTime() - (60000 * ( - timezone + localTimezone)));\r\n\t\t\t}\r\n\t\t\t// If original timezone was not specified, do not correct and use the local time zone\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttimezone = localTimezone;\r\n\t\t\t\tcorrectedValue = value;\r\n\t\t\t}\r\n\t\t\tvar x = this.printDateTime(new Jsonix.XML.Calendar({\r\n\t\t\t\tyear : correctedValue.getFullYear(),\r\n\t\t\t\tmonth : correctedValue.getMonth() + 1,\r\n\t\t\t\tday : correctedValue.getDate(),\r\n\t\t\t\thour : correctedValue.getHours(),\r\n\t\t\t\tminute : correctedValue.getMinutes(),\r\n\t\t\t\tsecond : correctedValue.getSeconds(),\r\n\t\t\t\tfractionalSecond : (correctedValue.getMilliseconds() / 1000),\r\n\t\t\t\ttimezone: timezone\r\n\t\t\t}));\r\n\t\t\treturn x;\r\n\t\t}\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isDate(value);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.DateTimeAsDate'\r\n});\r\nJsonix.Schema.XSD.DateTimeAsDate.INSTANCE = new Jsonix.Schema.XSD.DateTimeAsDate();\r\nJsonix.Schema.XSD.DateTimeAsDate.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.DateTimeAsDate.INSTANCE);\r\n\nJsonix.Schema.XSD.Time = Jsonix.Class(Jsonix.Schema.XSD.Calendar, {\r\n\tname : 'Time',\r\n\ttypeName : Jsonix.Schema.XSD.qname('time'),\r\n\tparse : function(value, context, input, scope) {\r\n\t\treturn this.parseTime(value);\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\treturn this.printTime(value);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Time'\r\n});\r\nJsonix.Schema.XSD.Time.INSTANCE = new Jsonix.Schema.XSD.Time();\r\nJsonix.Schema.XSD.Time.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Time.INSTANCE);\nJsonix.Schema.XSD.TimeAsDate = Jsonix.Class(Jsonix.Schema.XSD.Calendar, {\r\n\tname : 'TimeAsDate',\r\n\ttypeName : Jsonix.Schema.XSD.qname('time'),\r\n\tparse : function(value, context, input, scope) {\r\n\t\tvar calendar = this.parseTime(value);\r\n\t\tvar date = new Date();\r\n\t\tdate.setFullYear(1970);\r\n\t\tdate.setMonth(0);\r\n\t\tdate.setDate(1);\r\n\t\tdate.setHours(calendar.hour);\r\n\t\tdate.setMinutes(calendar.minute);\r\n\t\tdate.setSeconds(calendar.second);\r\n\t\tif (Jsonix.Util.Type.isNumber(calendar.fractionalSecond)) {\r\n\t\t\tdate.setMilliseconds(Math.floor(1000 * calendar.fractionalSecond));\r\n\t\t}\r\n\t\tvar timezone;\r\n\t\tvar unknownTimezone;\r\n\t\tvar localTimezone = - date.getTimezoneOffset();\r\n\t\tif (Jsonix.Util.NumberUtils.isInteger(calendar.timezone))\r\n\t\t{\r\n\t\t\ttimezone = calendar.timezone;\r\n\t\t\tunknownTimezone = false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Unknown timezone\r\n\t\t\ttimezone = localTimezone;\r\n\t\t\tunknownTimezone = true;\r\n\t\t}\r\n\t\t//\r\n\t\tvar result = new Date(date.getTime() + (60000 * ( - timezone + localTimezone)));\r\n\t\tif (unknownTimezone)\r\n\t\t{\r\n\t\t\t// null denotes \"unknown timezone\"\r\n\t\t\tresult.originalTimezone = null;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tresult.originalTimezone = timezone;\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureDate(value);\r\n\t\tvar time = value.getTime();\r\n\t\tif (time <= -86400000 && time >= 86400000) {\r\n\t\t\tthrow new Error('Invalid time [' + value + '].');\r\n\t\t}\r\n\t\t// Original timezone was unknown, just use current time, no timezone\r\n\t\tif (value.originalTimezone === null)\r\n\t\t{\r\n\t\t\treturn this.printTime(new Jsonix.XML.Calendar({\r\n\t\t\t\thour : value.getHours(),\r\n\t\t\t\tminute : value.getMinutes(),\r\n\t\t\t\tsecond : value.getSeconds(),\r\n\t\t\t\tfractionalSecond : (value.getMilliseconds() / 1000)\r\n\t\t\t}));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tvar correctedValue;\r\n\t\t\tvar timezone;\r\n\t\t\tvar localTimezone = - value.getTimezoneOffset();\r\n\t\t\tif (Jsonix.Util.NumberUtils.isInteger(value.originalTimezone))\r\n\t\t\t{\r\n\t\t\t\ttimezone = value.originalTimezone;\r\n\t\t\t\tcorrectedValue = new Date(value.getTime() - (60000 * ( - timezone + localTimezone)));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttimezone = localTimezone;\r\n\t\t\t\tcorrectedValue = value;\r\n\t\t\t}\r\n\t\t\tvar correctedTime = correctedValue.getTime();\r\n\t\t\tif (correctedTime >= (- localTimezone * 60000)) {\r\n\t\t\t\treturn this.printTime(new Jsonix.XML.Calendar({\r\n\t\t\t\t\thour : correctedValue.getHours(),\r\n\t\t\t\t\tminute : correctedValue.getMinutes(),\r\n\t\t\t\t\tsecond : correctedValue.getSeconds(),\r\n\t\t\t\t\tfractionalSecond : (correctedValue.getMilliseconds() / 1000),\r\n\t\t\t\t\ttimezone: timezone\r\n\t\t\t\t}));\r\n\t\t\t} else {\r\n\t\t\t\tvar timezoneHours = Math.ceil(-correctedTime / 3600000);\r\n\t\t\t\t\r\n\t\t\t\tvar correctedTimeInSeconds = correctedValue.getSeconds() +\r\n\t\t\t\t\tcorrectedValue.getMinutes() * 60 +\r\n\t\t\t\t\tcorrectedValue.getHours() * 3600 +\r\n\t\t\t\t\ttimezoneHours * 3600 -\r\n\t\t\t\t\ttimezone * 60;\r\n\t\t\t\t\r\n\t\t\t\treturn this.printTime(new Jsonix.XML.Calendar({\r\n\t\t\t\t\thour : correctedTimeInSeconds % 86400,\r\n\t\t\t\t\tminute : correctedTimeInSeconds % 3600,\r\n\t\t\t\t\tsecond : correctedTimeInSeconds % 60,\r\n\t\t\t\t\tfractionalSecond : (correctedValue.getMilliseconds() / 1000),\r\n\t\t\t\t\ttimezone : timezoneHours * 60\r\n\t\t\t\t}));\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isDate(value) && value.getTime() > -86400000 && value.getTime() < 86400000;\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.TimeAsDate'\r\n});\r\nJsonix.Schema.XSD.TimeAsDate.INSTANCE = new Jsonix.Schema.XSD.TimeAsDate();\r\nJsonix.Schema.XSD.TimeAsDate.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.TimeAsDate.INSTANCE);\nJsonix.Schema.XSD.Date = Jsonix.Class(Jsonix.Schema.XSD.Calendar, {\r\n\tname : 'Date',\r\n\ttypeName : Jsonix.Schema.XSD.qname('date'),\r\n\tparse : function(value, context, input, scope) {\r\n\t\treturn this.parseDate(value);\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\treturn this.printDate(value);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.Date'\r\n});\r\nJsonix.Schema.XSD.Date.INSTANCE = new Jsonix.Schema.XSD.Date();\r\nJsonix.Schema.XSD.Date.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Date.INSTANCE);\nJsonix.Schema.XSD.DateAsDate = Jsonix.Class(Jsonix.Schema.XSD.Calendar, {\r\n\tname : 'DateAsDate',\r\n\ttypeName : Jsonix.Schema.XSD.qname('date'),\r\n\tparse : function(value, context, input, scope) {\r\n\t\tvar calendar = this.parseDate(value);\r\n\t\tvar date = new Date();\r\n\t\tdate.setFullYear(calendar.year);\r\n\t\tdate.setMonth(calendar.month - 1);\r\n\t\tdate.setDate(calendar.day);\r\n\t\tdate.setHours(0);\r\n\t\tdate.setMinutes(0);\r\n\t\tdate.setSeconds(0);\r\n\t\tdate.setMilliseconds(0);\r\n\t\tif (Jsonix.Util.Type.isNumber(calendar.fractionalSecond)) {\r\n\t\t\tdate.setMilliseconds(Math.floor(1000 * calendar.fractionalSecond));\r\n\t\t}\r\n\t\tvar timezone;\r\n\t\tvar unknownTimezone;\r\n\t\tvar localTimezone = - date.getTimezoneOffset();\r\n\t\tif (Jsonix.Util.NumberUtils.isInteger(calendar.timezone))\r\n\t\t{\r\n\t\t\ttimezone = calendar.timezone;\r\n\t\t\tunknownTimezone = false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Unknown timezone\r\n\t\t\ttimezone = localTimezone;\r\n\t\t\tunknownTimezone = true;\r\n\t\t}\r\n\t\t//\r\n\t\tvar result = new Date(date.getTime() + (60000 * ( - timezone + localTimezone)));\r\n\t\tif (unknownTimezone)\r\n\t\t{\r\n\t\t\t// null denotes \"unknown timezone\"\r\n\t\t\tresult.originalTimezone = null;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tresult.originalTimezone = timezone;\r\n\t\t}\r\n\t\treturn result;\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\tJsonix.Util.Ensure.ensureDate(value);\r\n\t\tvar localDate = new Date(value.getTime());\r\n\t\tlocalDate.setHours(0);\r\n\t\tlocalDate.setMinutes(0);\r\n\t\tlocalDate.setSeconds(0);\r\n\t\tlocalDate.setMilliseconds(0);\r\n\t\t\r\n\t\t// Original timezone is unknown\r\n\t\tif (value.originalTimezone === null)\r\n\t\t{\r\n\t\t\treturn this.printDate(new Jsonix.XML.Calendar({\r\n\t\t\t\tyear : value.getFullYear(),\r\n\t\t\t\tmonth : value.getMonth() + 1,\r\n\t\t\t\tday : value.getDate()\r\n\t\t\t}));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// If original timezone was known, correct and print the value with the timezone\r\n\t\t\tif (Jsonix.Util.NumberUtils.isInteger(value.originalTimezone))\r\n\t\t\t{\r\n\t\t\t\tvar correctedValue = new Date(value.getTime() - (60000 * (- value.originalTimezone - value.getTimezoneOffset())));\r\n\t\t\t\treturn this.printDate(new Jsonix.XML.Calendar({\r\n\t\t\t\t\tyear : correctedValue.getFullYear(),\r\n\t\t\t\t\tmonth : correctedValue.getMonth() + 1,\r\n\t\t\t\t\tday : correctedValue.getDate(),\r\n\t\t\t\t\ttimezone : value.originalTimezone\r\n\t\t\t\t}));\r\n\t\t\t}\r\n\t\t\t// If original timezone was not specified, do not correct and use the local time zone\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// We assume that the difference between the date value and local midnight\r\n\t\t\t\t// should be interpreted as a timezone offset.\r\n\t\t\t\t// In case there's no difference, we assume default/unknown timezone\r\n\t\t\t\tvar localTimezone = - value.getTime() + localDate.getTime();\r\n\t\t\t\tif (localTimezone === 0) {\r\n\t\t\t\t\treturn this.printDate(new Jsonix.XML.Calendar({\r\n\t\t\t\t\t\tyear : value.getFullYear(),\r\n\t\t\t\t\t\tmonth : value.getMonth() + 1,\r\n\t\t\t\t\t\tday : value.getDate()\r\n\t\t\t\t\t}));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar timezone = localTimezone - (60000 * value.getTimezoneOffset());\r\n\t\t\t\t\tif (timezone >= -43200000) {\r\n\t\t\t\t\t\treturn this.printDate(new Jsonix.XML.Calendar({\r\n\t\t\t\t\t\t\tyear : value.getFullYear(),\r\n\t\t\t\t\t\t\tmonth : value.getMonth() + 1,\r\n\t\t\t\t\t\t\tday : value.getDate(),\r\n\t\t\t\t\t\t\ttimezone : Math.floor(timezone / 60000)\r\n\t\t\t\t\t\t}));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar nextDay = new Date(value.getTime() + 86400000);\r\n\t\t\t\t\t\treturn this.printDate(new Jsonix.XML.Calendar({\r\n\t\t\t\t\t\t\tyear : nextDay.getFullYear(),\r\n\t\t\t\t\t\t\tmonth : nextDay.getMonth() + 1,\r\n\t\t\t\t\t\t\tday : nextDay.getDate(),\r\n\t\t\t\t\t\t\ttimezone : (Math.floor(timezone / 60000) + 1440)\r\n\t\t\t\t\t\t}));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tisInstance : function(value, context, scope) {\r\n\t\treturn Jsonix.Util.Type.isDate(value);\r\n\t},\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.DateAsDate'\r\n});\r\nJsonix.Schema.XSD.DateAsDate.INSTANCE = new Jsonix.Schema.XSD.DateAsDate();\r\nJsonix.Schema.XSD.DateAsDate.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.DateAsDate.INSTANCE);\nJsonix.Schema.XSD.GYearMonth = Jsonix.Class(Jsonix.Schema.XSD.Calendar, {\r\n\tname : 'GYearMonth',\r\n\ttypeName : Jsonix.Schema.XSD.qname('gYearMonth'),\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.GYearMonth',\r\n\r\n\tparse : function(value, context, input, scope) {\r\n\t\treturn this.parseGYearMonth(value, context, input, scope);\r\n\t},\r\n\r\n\tprint : function(value, context, output, scope) {\r\n\t\treturn this.printGYearMonth(value, context, output, scope);\r\n\t}\r\n\r\n});\r\nJsonix.Schema.XSD.GYearMonth.INSTANCE = new Jsonix.Schema.XSD.GYearMonth();\r\nJsonix.Schema.XSD.GYearMonth.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GYearMonth.INSTANCE);\nJsonix.Schema.XSD.GYear = Jsonix.Class(Jsonix.Schema.XSD.Calendar, {\r\n\tname : 'GYear',\r\n\ttypeName : Jsonix.Schema.XSD.qname('gYear'),\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.GYear',\r\n\r\n\tparse : function(value, context, input, scope) {\r\n\t\treturn this.parseGYear(value, context, input, scope);\r\n\t},\r\n\r\n\tprint : function(value, context, output, scope) {\r\n\t\treturn this.printGYear(value, context, output, scope);\r\n\t}\r\n});\r\nJsonix.Schema.XSD.GYear.INSTANCE = new Jsonix.Schema.XSD.GYear();\r\nJsonix.Schema.XSD.GYear.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GYear.INSTANCE);\nJsonix.Schema.XSD.GMonthDay = Jsonix.Class(Jsonix.Schema.XSD.Calendar, {\r\n\tname : 'GMonthDay',\r\n\ttypeName : Jsonix.Schema.XSD.qname('gMonthDay'),\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.GMonthDay',\r\n\r\n\tparse : function(value, context, input, scope) {\r\n\t\treturn this.parseGMonthDay(value, context, input, scope);\r\n\t},\r\n\r\n\tprint : function(value, context, output, scope) {\r\n\t\treturn this.printGMonthDay(value, context, output, scope);\r\n\t}\r\n});\r\nJsonix.Schema.XSD.GMonthDay.INSTANCE = new Jsonix.Schema.XSD.GMonthDay();\r\nJsonix.Schema.XSD.GMonthDay.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GMonthDay.INSTANCE);\nJsonix.Schema.XSD.GDay = Jsonix.Class(Jsonix.Schema.XSD.Calendar, {\r\n\tname : 'GDay',\r\n\ttypeName : Jsonix.Schema.XSD.qname('gDay'),\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.GDay',\r\n\r\n\tparse : function(value, context, input, scope) {\r\n\t\treturn this.parseGDay(value, context, input, scope);\r\n\t},\r\n\r\n\tprint : function(value, context, output, scope) {\r\n\t\treturn this.printGDay(value, context, output, scope);\r\n\t}\r\n\r\n});\r\nJsonix.Schema.XSD.GDay.INSTANCE = new Jsonix.Schema.XSD.GDay();\r\nJsonix.Schema.XSD.GDay.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GDay.INSTANCE);\nJsonix.Schema.XSD.GMonth = Jsonix.Class(Jsonix.Schema.XSD.Calendar, {\r\n\tname : 'GMonth',\r\n\ttypeName : Jsonix.Schema.XSD.qname('gMonth'),\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.GMonth',\r\n\tparse : function(value, context, input, scope) {\r\n\t\treturn this.parseGMonth(value, context, input, scope);\r\n\t},\r\n\tprint : function(value, context, output, scope) {\r\n\t\treturn this.printGMonth(value, context, output, scope);\r\n\t}\r\n});\r\nJsonix.Schema.XSD.GMonth.INSTANCE = new Jsonix.Schema.XSD.GMonth();\r\nJsonix.Schema.XSD.GMonth.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GMonth.INSTANCE);\nJsonix.Schema.XSD.ID = Jsonix.Class(Jsonix.Schema.XSD.String, {\r\n\tname : 'ID',\r\n\ttypeName : Jsonix.Schema.XSD.qname('ID'),\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.ID'\r\n});\r\nJsonix.Schema.XSD.ID.INSTANCE = new Jsonix.Schema.XSD.ID();\r\nJsonix.Schema.XSD.ID.INSTANCE.LIST = new Jsonix.Schema.XSD.List(\r\n\t\tJsonix.Schema.XSD.ID.INSTANCE);\nJsonix.Schema.XSD.IDREF = Jsonix.Class(Jsonix.Schema.XSD.String, {\r\n\tname : 'IDREF',\r\n\ttypeName : Jsonix.Schema.XSD.qname('IDREF'),\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.IDREF'\r\n});\r\nJsonix.Schema.XSD.IDREF.INSTANCE = new Jsonix.Schema.XSD.IDREF();\r\nJsonix.Schema.XSD.IDREF.INSTANCE.LIST = new Jsonix.Schema.XSD.List(\r\n\t\tJsonix.Schema.XSD.IDREF.INSTANCE);\nJsonix.Schema.XSD.IDREFS = Jsonix.Class(Jsonix.Schema.XSD.List, {\r\n\tname : 'IDREFS',\r\n\tinitialize : function() {\r\n\t\tJsonix.Schema.XSD.List.prototype.initialize.apply(this, [ Jsonix.Schema.XSD.IDREF.INSTANCE, Jsonix.Schema.XSD.qname('IDREFS'), ' ' ]);\r\n\t},\r\n\t// TODO Constraints\r\n\tCLASS_NAME : 'Jsonix.Schema.XSD.IDREFS'\r\n});\r\nJsonix.Schema.XSD.IDREFS.INSTANCE = new Jsonix.Schema.XSD.IDREFS();\nJsonix.Schema.XSI = {};\r\nJsonix.Schema.XSI.NAMESPACE_URI = 'http://www.w3.org/2001/XMLSchema-instance';\r\nJsonix.Schema.XSI.PREFIX = 'xsi';\r\nJsonix.Schema.XSI.TYPE = 'type';\r\nJsonix.Schema.XSI.NIL = 'nil';\r\nJsonix.Schema.XSI.qname = function(localPart) {\r\n\tJsonix.Util.Ensure.ensureString(localPart);\r\n\treturn new Jsonix.XML.QName(Jsonix.Schema.XSI.NAMESPACE_URI, localPart,\r\n\t\t\tJsonix.Schema.XSI.PREFIX);\r\n};\r\nJsonix.Schema.XSI.TYPE_QNAME = Jsonix.Schema.XSI.qname(Jsonix.Schema.XSI.TYPE);\r\n\nJsonix.Context = Jsonix\r\n\t\t.Class(Jsonix.Mapping.Styled, {\r\n\t\t\tmodules : [],\r\n\t\t\ttypeInfos : null,\r\n\t\t\ttypeNameKeyToTypeInfo : null,\r\n\t\t\telementInfos : null,\r\n\t\t\toptions : null,\r\n\t\t\tsubstitutionMembersMap : null,\r\n\t\t\tscopedElementInfosMap : null,\r\n\t\t\tsupportXsiType : true,\r\n\t\t\tinitialize : function(mappings, options) {\r\n\t\t\t\tJsonix.Mapping.Styled.prototype.initialize.apply(this, [options]);\r\n\t\t\t\tthis.modules = [];\r\n\t\t\t\tthis.elementInfos = [];\r\n\t\t\t\tthis.typeInfos = {};\r\n\t\t\t\tthis.typeNameKeyToTypeInfo = {};\r\n\t\t\t\tthis.registerBuiltinTypeInfos();\r\n\t\t\t\tthis.namespacePrefixes = {};\r\n\t\t\t\tthis.prefixNamespaces = {};\r\n\t\t\t\tthis.substitutionMembersMap = {};\r\n\t\t\t\tthis.scopedElementInfosMap = {};\r\n\r\n\t\t\t\t// Initialize options\r\n\t\t\t\tif (Jsonix.Util.Type.exists(options)) {\r\n\t\t\t\t\tJsonix.Util.Ensure.ensureObject(options);\r\n\t\t\t\t\tif (Jsonix.Util.Type\r\n\t\t\t\t\t\t\t.isObject(options.namespacePrefixes)) {\r\n\t\t\t\t\t\tthis.namespacePrefixes = \r\n\t\t\t\t\t\t\tJsonix.Util.Type.cloneObject(options.namespacePrefixes, {});\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (Jsonix.Util.Type\r\n\t\t\t\t\t\t\t.isBoolean(options.supportXsiType)) {\r\n\t\t\t\t\t\tthis.supportXsiType = options.supportXsiType; \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Initialize prefix/namespace mapping\r\n\t\t\t\tfor (var ns in this.namespacePrefixes)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this.namespacePrefixes.hasOwnProperty(ns))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tp = this.namespacePrefixes[ns];\r\n\t\t\t\t\t\tthis.prefixNamespaces[p] = ns;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Initialize modules\r\n\t\t\t\tif (Jsonix.Util.Type.exists(mappings)) {\r\n\t\t\t\t\tJsonix.Util.Ensure.ensureArray(mappings);\r\n\t\t\t\t\t// Initialize modules\r\n\t\t\t\t\tvar index, mapping, module;\r\n\t\t\t\t\tfor (index = 0; index < mappings.length; index++) {\r\n\t\t\t\t\t\tmapping = mappings[index];\r\n\t\t\t\t\t\tmodule = this.createModule(mapping);\r\n\t\t\t\t\t\tthis.modules[index] = module;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.processModules();\r\n\t\t\t},\r\n\t\t\tcreateModule : function(mapping) {\r\n\t\t\t\tvar module;\r\n\t\t\t\tif (mapping instanceof this.mappingStyle.module) {\r\n\t\t\t\t\tmodule = mapping;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapping = Jsonix.Util.Type.cloneObject(mapping);\r\n\t\t\t\t\tmodule = new this.mappingStyle.module(mapping, \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmappingStyle : this.mappingStyle\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn module;\r\n\t\t\t},\r\n\t\t\tregisterBuiltinTypeInfos : function() {\r\n\t\t\t\tfor ( var index = 0; index < this.builtinTypeInfos.length; index++) {\r\n\t\t\t\t\tthis.registerTypeInfo(this.builtinTypeInfos[index]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tprocessModules : function() {\r\n\t\t\t\tvar index, module;\r\n\t\t\t\tfor (index = 0; index < this.modules.length; index++) {\r\n\t\t\t\t\tmodule = this.modules[index];\r\n\t\t\t\t\tmodule.registerTypeInfos(this);\r\n\t\t\t\t}\r\n\t\t\t\tfor (index = 0; index < this.modules.length; index++) {\r\n\t\t\t\t\tmodule = this.modules[index];\r\n\t\t\t\t\tmodule.registerElementInfos(this);\r\n\t\t\t\t}\r\n\t\t\t\tfor (index = 0; index < this.modules.length; index++) {\r\n\t\t\t\t\tmodule = this.modules[index];\r\n\t\t\t\t\tmodule.buildTypeInfos(this);\r\n\t\t\t\t}\r\n\t\t\t\tfor (index = 0; index < this.modules.length; index++) {\r\n\t\t\t\t\tmodule = this.modules[index];\r\n\t\t\t\t\tmodule.buildElementInfos(this);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tregisterTypeInfo : function(typeInfo) {\r\n\t\t\t\tJsonix.Util.Ensure.ensureObject(typeInfo);\r\n\t\t\t\tvar n = typeInfo.name||typeInfo.n||null;\r\n\t\t\t\tJsonix.Util.Ensure.ensureString(n);\r\n\t\t\t\tthis.typeInfos[n] = typeInfo;\r\n\t\t\t\tif (typeInfo.typeName && typeInfo.typeName.key)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.typeNameKeyToTypeInfo[typeInfo.typeName.key] = typeInfo;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tresolveTypeInfo : function(mapping, module) {\r\n\t\t\t\tif (!Jsonix.Util.Type.exists(mapping)) {\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t} else if (mapping instanceof Jsonix.Model.TypeInfo) {\r\n\t\t\t\t\treturn mapping;\r\n\t\t\t\t} else if (Jsonix.Util.Type.isString(mapping)) {\r\n\t\t\t\t\tvar typeInfoName;\r\n\t\t\t\t\t// If mapping starts with '.' consider it to be a local type name in this module\r\n\t\t\t\t\tif (mapping.length > 0 && mapping.charAt(0) === '.')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar n = module.name || module.n || undefined;\r\n\t\t\t\t\t\tJsonix.Util.Ensure.ensureObject(module, 'Type info mapping can only be resolved if module is provided.');\r\n\t\t\t\t\t\tJsonix.Util.Ensure.ensureString(n, 'Type info mapping can only be resolved if module name is provided.');\r\n\t\t\t\t\t\ttypeInfoName = n + mapping;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttypeInfoName = mapping;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!this.typeInfos[typeInfoName]) {\r\n\t\t\t\t\t\tthrow new Error('Type info [' + typeInfoName + '] is not known in this context.');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn this.typeInfos[typeInfoName];\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tJsonix.Util.Ensure.ensureObject(module, 'Type info mapping can only be resolved if module is provided.');\r\n\t\t\t\t\tvar typeInfo = module.createTypeInfo(mapping);\r\n\t\t\t\t\ttypeInfo.build(this, module);\r\n\t\t\t\t\treturn typeInfo;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tregisterElementInfo : function(elementInfo, module) {\r\n\t\t\t\tJsonix.Util.Ensure.ensureObject(elementInfo);\r\n\t\t\t\tthis.elementInfos.push(elementInfo);\r\n\r\n\t\t\t\tif (Jsonix.Util.Type.exists(elementInfo.substitutionHead)) {\r\n\t\t\t\t\tvar substitutionHead = elementInfo.substitutionHead;\r\n\t\t\t\t\tvar substitutionHeadKey = substitutionHead.key;\r\n\t\t\t\t\tvar substitutionMembers = this.substitutionMembersMap[substitutionHeadKey];\r\n\r\n\t\t\t\t\tif (!Jsonix.Util.Type.isArray(substitutionMembers)) {\r\n\t\t\t\t\t\tsubstitutionMembers = [];\r\n\t\t\t\t\t\tthis.substitutionMembersMap[substitutionHeadKey] = substitutionMembers;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsubstitutionMembers.push(elementInfo);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar scopeKey;\r\n\t\t\t\tif (Jsonix.Util.Type.exists(elementInfo.scope)) {\r\n\t\t\t\t\tscopeKey = this.resolveTypeInfo(elementInfo.scope, module).name;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscopeKey = '##global';\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar scopedElementInfos = this.scopedElementInfosMap[scopeKey];\r\n\r\n\t\t\t\tif (!Jsonix.Util.Type.isObject(scopedElementInfos)) {\r\n\t\t\t\t\tscopedElementInfos = {};\r\n\t\t\t\t\tthis.scopedElementInfosMap[scopeKey] = scopedElementInfos;\r\n\t\t\t\t}\r\n\t\t\t\tscopedElementInfos[elementInfo.elementName.key] = elementInfo;\r\n\r\n\t\t\t},\r\n\t\t\tgetTypeInfoByValue : function(value)\r\n\t\t\t{\r\n\t\t\t\tif (!Jsonix.Util.Type.exists(value))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn undefined;\r\n\t\t\t\t}\r\n\t\t\t\tif (Jsonix.Util.Type.isObject(value))\r\n\t\t\t\t{\r\n\t\t\t\t\tvar typeName = value.TYPE_NAME;\r\n\t\t\t\t\tif (Jsonix.Util.Type.isString(typeName))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar typeInfoByName = this.getTypeInfoByName(typeName);\r\n\t\t\t\t\t\tif (typeInfoByName)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn typeInfoByName;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn undefined;\r\n\t\t\t},\r\n\t\t\t// TODO public API\r\n\t\t\tgetTypeInfoByName : function(name) {\r\n\t\t\t\treturn this.typeInfos[name];\r\n\t\t\t},\r\n\t\t\tgetTypeInfoByTypeName : function(typeName) {\r\n\t\t\t\tvar tn = Jsonix.XML.QName.fromObjectOrString(typeName, this);\r\n\t\t\t\treturn this.typeNameKeyToTypeInfo[tn.key];\r\n\t\t\t},\r\n\t\t\tgetTypeInfoByTypeNameKey : function(typeNameKey) {\r\n\t\t\t\treturn this.typeNameKeyToTypeInfo[typeNameKey];\r\n\t\t\t},\r\n\t\t\tgetElementInfo : function(name, scope) {\r\n\t\t\t\tif (Jsonix.Util.Type.exists(scope)) {\r\n\t\t\t\t\tvar scopeKey = scope.name;\r\n\t\t\t\t\tvar scopedElementInfos = this.scopedElementInfosMap[scopeKey];\r\n\t\t\t\t\tif (Jsonix.Util.Type.exists(scopedElementInfos)) {\r\n\t\t\t\t\t\tvar scopedElementInfo = scopedElementInfos[name.key];\r\n\t\t\t\t\t\tif (Jsonix.Util.Type.exists(scopedElementInfo)) {\r\n\t\t\t\t\t\t\treturn scopedElementInfo;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar globalScopeKey = '##global';\r\n\t\t\t\tvar globalScopedElementInfos = this.scopedElementInfosMap[globalScopeKey];\r\n\t\t\t\tif (Jsonix.Util.Type.exists(globalScopedElementInfos)) {\r\n\t\t\t\t\tvar globalScopedElementInfo = globalScopedElementInfos[name.key];\r\n\t\t\t\t\tif (Jsonix.Util.Type.exists(globalScopedElementInfo)) {\r\n\t\t\t\t\t\treturn globalScopedElementInfo;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t\t//\r\n\t\t\t\t// throw new Error(\"Element [\" + name.key\r\n\t\t\t\t// + \"] could not be found in the given context.\");\r\n\t\t\t},\r\n\t\t\tgetSubstitutionMembers : function(name) {\r\n\t\t\t\treturn this.substitutionMembersMap[Jsonix.XML.QName\r\n\t\t\t\t\t\t.fromObject(name).key];\r\n\t\t\t},\r\n\t\t\tcreateMarshaller : function() {\r\n\t\t\t\treturn new this.mappingStyle.marshaller(this);\r\n\t\t\t},\r\n\t\t\tcreateUnmarshaller : function() {\r\n\t\t\t\treturn new this.mappingStyle.unmarshaller(this);\r\n\t\t\t},\r\n\t\t\tgetNamespaceURI : function(prefix) {\r\n\t\t\t\tJsonix.Util.Ensure.ensureString(prefix);\r\n\t\t\t\treturn this.prefixNamespaces[prefix];\r\n\t\t\t},\r\n\t\t\tgetPrefix : function(namespaceURI, defaultPrefix) {\r\n\t\t\t\tJsonix.Util.Ensure.ensureString(namespaceURI);\r\n\t\t\t\tvar prefix = this.namespacePrefixes[namespaceURI];\r\n\t\t\t\tif (Jsonix.Util.Type.isString(prefix))\r\n\t\t\t\t{\r\n\t\t\t\t\treturn prefix;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn defaultPrefix;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * Builtin type infos.\r\n\t\t\t */\r\n\t\t\tbuiltinTypeInfos : [\r\n\t\t\t Jsonix.Schema.XSD.AnyType.INSTANCE,\r\n\t\t\t Jsonix.Schema.XSD.AnySimpleType.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.AnyURI.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Base64Binary.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Boolean.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Byte.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Calendar.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.DateAsDate.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Date.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.DateTimeAsDate.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.DateTime.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Decimal.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Double.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Duration.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Float.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.GDay.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.GMonth.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.GMonthDay.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.GYear.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.GYearMonth.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.HexBinary.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.ID.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.IDREF.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.IDREFS.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Int.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Integer.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Language.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Long.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Name.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.NCName.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.NegativeInteger.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.NMToken.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.NMTokens.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.NonNegativeInteger.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.NonPositiveInteger.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.NormalizedString.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Number.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.PositiveInteger.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.QName.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Short.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.String.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Strings.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.TimeAsDate.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Time.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.Token.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.UnsignedByte.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.UnsignedInt.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.UnsignedLong.INSTANCE,\r\n\t\t\t\t\tJsonix.Schema.XSD.UnsignedShort.INSTANCE ],\r\n\t\t\tCLASS_NAME : 'Jsonix.Context'\r\n\t\t});\n\t// Complete Jsonix script is included above\r\n\treturn { Jsonix: Jsonix };\r\n};\r\n\r\n// If the require function exists ...\r\nif (typeof require === 'function') {\r\n\t// ... but the define function does not exists\r\n\tif (typeof define !== 'function') {\r\n\t\t// Load the define function via amdefine\r\n\t\tvar define = require('amdefine')(module);\r\n\t\t// If we're not in browser\r\n\t\tif (typeof window === 'undefined')\r\n\t\t{\r\n\t\t\t// Require xmldom, xmlhttprequest and fs\r\n\t\t\tdefine([\"xmldom\", \"xmlhttprequest\", \"fs\"], _jsonix_factory);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// We're probably in browser, maybe browserify\r\n\t\t\t// Do not require xmldom, xmlhttprequest as they'r provided by the browser\r\n\t\t\t// Do not require fs since file system is not available anyway\r\n\t\t\tdefine([], _jsonix_factory);\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\t// Otherwise assume we're in the browser/RequireJS environment\r\n\t\t// Load the module without xmldom and xmlhttprequests dependencies\r\n\t\tdefine([], _jsonix_factory);\r\n\t}\r\n}\r\n// If the require function does not exists, we're not in Node.js and therefore in browser environment\r\nelse\r\n{\r\n\t// Just call the factory and set Jsonix as global.\r\n\tvar Jsonix = _jsonix_factory().Jsonix;\r\n}\n"],"names":[],"sourceRoot":"webpack:///","x_google_ignoreList":[]}