org.hisrc.jsonix.Jsonix-min.js Maven / Gradle / Ivy
var _jsonix_factory = function(_jsonix_xmldom, _jsonix_xmlhttprequest, _jsonix_fs)
{
// Complete Jsonix script is included below
var Jsonix={singleFile:true};
Jsonix.Util={};
Jsonix.Util.extend=function(f,g){f=f||{};
if(g){for(var h in g){var e=g[h];
if(e!==undefined){f[h]=e
}}sourceIsEvt=typeof window!=="undefined"&&window!==null&&typeof window.Event==="function"&&g instanceof window.Event;
if(!sourceIsEvt&&g.hasOwnProperty&&g.hasOwnProperty("toString")){f.toString=g.toString
}}return f
};
Jsonix.Class=function(){var n=function(){this.initialize.apply(this,arguments)
};
var p={};
var k=function(){};
var l,i,o;
for(var m=0,j=arguments.length;
m1){i=o.prototype.initialize;
o.prototype.initialize=k;
p=new o();
if(i===undefined){delete o.prototype.initialize
}else{o.prototype.initialize=i
}}l=o.prototype
}else{l=o
}Jsonix.Util.extend(p,l)
}n.prototype=p;
return n
};
Jsonix.XML={XMLNS_NS:"http://www.w3.org/2000/xmlns/",XMLNS_P:"xmlns"};
Jsonix.DOM={isDomImplementationAvailable:function(){if(typeof _jsonix_xmldom!=="undefined"){return true
}else{if(typeof document!=="undefined"&&Jsonix.Util.Type.exists(document.implementation)&&Jsonix.Util.Type.isFunction(document.implementation.createDocument)){return true
}else{return false
}}},createDocument:function(){if(typeof _jsonix_xmldom!=="undefined"){return new (_jsonix_xmldom.DOMImplementation)().createDocument()
}else{if(typeof document!=="undefined"&&Jsonix.Util.Type.exists(document.implementation)&&Jsonix.Util.Type.isFunction(document.implementation.createDocument)){return document.implementation.createDocument("","",null)
}else{if(typeof ActiveXObject!=="undefined"){return new ActiveXObject("MSXML2.DOMDocument")
}else{throw new Error("Error created the DOM document.")
}}}},serialize:function(b){Jsonix.Util.Ensure.ensureExists(b);
if(typeof _jsonix_xmldom!=="undefined"){return(new (_jsonix_xmldom).XMLSerializer()).serializeToString(b)
}else{if(Jsonix.Util.Type.exists(XMLSerializer)){return(new XMLSerializer()).serializeToString(b)
}else{if(Jsonix.Util.Type.exists(b.xml)){return b.xml
}else{throw new Error("Could not serialize the node, neither XMLSerializer nor the [xml] property were found.")
}}}},parse:function(g){Jsonix.Util.Ensure.ensureExists(g);
if(typeof _jsonix_xmldom!=="undefined"){return(new (_jsonix_xmldom).DOMParser()).parseFromString(g,"application/xml")
}else{if(typeof DOMParser!="undefined"){return(new DOMParser()).parseFromString(g,"application/xml")
}else{if(typeof ActiveXObject!="undefined"){var h=Jsonix.DOM.createDocument("","");
h.loadXML(g);
return h
}else{var f="data:text/xml;charset=utf-8,"+encodeURIComponent(g);
var e=new XMLHttpRequest();
e.open("GET",f,false);
if(e.overrideMimeType){e.overrideMimeType("text/xml")
}e.send(null);
return e.responseXML
}}}},load:function(e,g,f){var h=Jsonix.Request.INSTANCE;
h.issue(e,function(a){var b;
if(Jsonix.Util.Type.exists(a.responseXML)&&Jsonix.Util.Type.exists(a.responseXML.documentElement)){b=a.responseXML
}else{if(Jsonix.Util.Type.isString(a.responseText)){b=Jsonix.DOM.parse(a.responseText)
}else{throw new Error("Response does not have valid [responseXML] or [responseText].")
}}g(b)
},function(a){throw new Error("Could not retrieve XML from URL ["+e+"].")
},f)
},xlinkFixRequired:null,isXlinkFixRequired:function(){if(Jsonix.DOM.xlinkFixRequired===null){if(typeof navigator==="undefined"){Jsonix.DOM.xlinkFixRequired=false
}else{if(!!navigator.userAgent&&(/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor))){var f=Jsonix.DOM.createDocument();
var d=f.createElement("test");
d.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","urn:test");
f.appendChild(d);
var e=Jsonix.DOM.serialize(f);
Jsonix.DOM.xlinkFixRequired=(e.indexOf("xmlns:xlink")===-1)
}else{Jsonix.DOM.xlinkFixRequired=false
}}}return Jsonix.DOM.xlinkFixRequired
}};
Jsonix.Request=Jsonix.Class({factories:[function(){return new XMLHttpRequest()
},function(){return new ActiveXObject("Msxml2.XMLHTTP")
},function(){return new ActiveXObject("Msxml2.XMLHTTP.6.0")
},function(){return new ActiveXObject("Msxml2.XMLHTTP.3.0")
},function(){return new ActiveXObject("Microsoft.XMLHTTP")
},function(){if(typeof _jsonix_xmlhttprequest!=="undefined"){var b=_jsonix_xmlhttprequest.XMLHttpRequest;
return new b()
}else{return null
}}],initialize:function(){},issue:function(y,q,x,n){Jsonix.Util.Ensure.ensureString(y);
if(Jsonix.Util.Type.exists(q)){Jsonix.Util.Ensure.ensureFunction(q)
}else{q=function(){}
}if(Jsonix.Util.Type.exists(x)){Jsonix.Util.Ensure.ensureFunction(x)
}else{x=function(){}
}if(Jsonix.Util.Type.exists(n)){Jsonix.Util.Ensure.ensureObject(n)
}else{n={}
}var w=this.createTransport();
var z=Jsonix.Util.Type.isString(n.method)?n.method:"GET";
var v=Jsonix.Util.Type.isBoolean(n.async)?n.async:true;
var p=Jsonix.Util.Type.isString(n.proxy)?n.proxy:Jsonix.Request.PROXY;
var u=Jsonix.Util.Type.isString(n.user)?n.user:null;
var o=Jsonix.Util.Type.isString(n.password)?n.password:null;
if(Jsonix.Util.Type.isString(p)&&(y.indexOf("http")===0)){y=p+encodeURIComponent(y)
}if(Jsonix.Util.Type.isString(u)){w.open(z,y,v,u,o)
}else{w.open(z,y,v)
}if(Jsonix.Util.Type.isObject(n.headers)){for(var s in n.headers){if(n.headers.hasOwnProperty(s)){w.setRequestHeader(s,n.headers[s])
}}}var t=Jsonix.Util.Type.exists(n.data)?n.data:null;
if(!v){w.send(t);
this.handleTransport(w,q,x)
}else{var r=this;
if(typeof window!=="undefined"){w.onreadystatechange=function(){r.handleTransport(w,q,x)
};
window.setTimeout(function(){w.send(t)
},0)
}else{w.onreadystatechange=function(){r.handleTransport(w,q,x)
};
w.send(t)
}}return w
},handleTransport:function(f,d,e){if(f.readyState==4){if(!f.status||(f.status>=200&&f.status<300)){d(f)
}if(f.status&&(f.status<200||f.status>=300)){e(f)
}}},createTransport:function(){for(var f=0,e=this.factories.length;
f"\u000D"&&g<"\u0085"){return false
}else{if(g<"\u00A0"){if(g<"\u0009"){return false
}else{if(g>"\u0085"){return false
}}}else{if(g>"\u00A0"){if(g<"\u2028"){if(g<"\u180E"){if(g<"\u1680"){return false
}else{if(g>"\u1680"){return false
}}}else{if(g>"\u180E"){if(g<"\u2000"){return false
}else{if(g>"\u200A"){return false
}}}}}else{if(g>"\u2029"){if(g<"\u205F"){if(g<"\u202F"){return false
}else{if(g>"\u202F"){return false
}}}else{if(g>"\u205F"){if(g<"\u3000"){return false
}else{if(g>"\u3000"){return false
}}}}}}}}}}}return true
},isNotBlank:function(b){return Jsonix.Util.Type.isString(b)&&!Jsonix.Util.StringUtils.isEmpty(b)
},whitespaceCharacters:"\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",whitespaceCharactersMap:{"\u0009":true,"\u000A":true,"\u000B":true,"\u000C":true,"\u000D":true," ":true,"\u0085":true,"\u00A0":true,"\u1680":true,"\u180E":true,"\u2000":true,"\u2001":true,"\u2002":true,"\u2003":true,"\u2004":true,"\u2005":true,"\u2006":true,"\u2007":true,"\u2008":true,"\u2009":true,"\u200A":true,"\u2028":true,"\u2029":true,"\u202F":true,"\u205F":true,"\u3000":true},splitBySeparatorChars:function(n,u){Jsonix.Util.Ensure.ensureString(n);
Jsonix.Util.Ensure.ensureString(u);
var p=n.length;
if(p===0){return[]
}if(u.length===1){return n.split(u)
}else{var o=[];
var t=1;
var r=0;
var v=0;
var q=false;
var s=false;
var m=-1;
var i=false;
while(r=0){if(q||i){s=true;
if(t++==m){r=p;
s=false
}o.push(n.substring(v,r));
q=false
}v=++r;
continue
}s=false;
q=true;
r++
}if(q||(i&&s)){o.push(n.substring(v,r))
}return o
}}};
Jsonix.Util.Ensure={ensureBoolean:function(b){if(!Jsonix.Util.Type.isBoolean(b)){throw new Error("Argument ["+b+"] must be a boolean.")
}},ensureString:function(b){if(!Jsonix.Util.Type.isString(b)){throw new Error("Argument ["+b+"] must be a string.")
}},ensureNumber:function(b){if(!Jsonix.Util.Type.isNumber(b)){throw new Error("Argument ["+b+"] must be a number.")
}},ensureNumberOrNaN:function(b){if(!Jsonix.Util.Type.isNumberOrNaN(b)){throw new Error("Argument ["+b+"] must be a number or NaN.")
}},ensureInteger:function(b){if(!Jsonix.Util.Type.isNumber(b)){throw new Error("Argument must be an integer, but it is not a number.")
}else{if(!Jsonix.Util.NumberUtils.isInteger(b)){throw new Error("Argument ["+b+"] must be an integer.")
}}},ensureDate:function(b){if(!(b instanceof Date)){throw new Error("Argument ["+b+"] must be a date.")
}},ensureObject:function(b){if(!Jsonix.Util.Type.isObject(b)){throw new Error("Argument ["+b+"] must be an object.")
}},ensureArray:function(b){if(!Jsonix.Util.Type.isArray(b)){throw new Error("Argument ["+b+"] must be an array.")
}},ensureFunction:function(b){if(!Jsonix.Util.Type.isFunction(b)){throw new Error("Argument ["+b+"] must be a function.")
}},ensureExists:function(b){if(!Jsonix.Util.Type.exists(b)){throw new Error("Argument ["+b+"] does not exist.")
}}};
Jsonix.XML.QName=Jsonix.Class({key:null,namespaceURI:null,localPart:null,prefix:null,string:null,initialize:function(n,j,r){var q;
var o;
var m;
var k;
var l;
if(!Jsonix.Util.Type.exists(j)){q="";
o=n;
m=""
}else{if(!Jsonix.Util.Type.exists(r)){q=Jsonix.Util.Type.exists(n)?n:"";
o=j;
var p=j.indexOf(":");
if(p>0&&p0)&&(l0&&q0&&d=-9999&&b.year<=9999){this.year=b.year
}else{throw new Error("Invalid year ["+b.year+"].")
}}else{this.year=NaN
}if(Jsonix.Util.Type.exists(b.month)){Jsonix.Util.Ensure.ensureInteger(b.month);
if(b.month>=1&&b.month<=12){this.month=b.month
}else{throw new Error("Invalid month ["+b.month+"].")
}}else{this.month=NaN
}if(Jsonix.Util.Type.exists(b.day)){Jsonix.Util.Ensure.ensureInteger(b.day);
if(b.day>=1&&b.day<=31){this.day=b.day
}else{throw new Error("Invalid day ["+b.day+"].")
}}else{this.day=NaN
}if(Jsonix.Util.Type.exists(b.hour)){Jsonix.Util.Ensure.ensureInteger(b.hour);
if(b.hour>=0&&b.hour<=23){this.hour=b.hour
}else{throw new Error("Invalid hour ["+b.hour+"].")
}}else{this.hour=NaN
}if(Jsonix.Util.Type.exists(b.minute)){Jsonix.Util.Ensure.ensureInteger(b.minute);
if(b.minute>=0&&b.minute<=59){this.minute=b.minute
}else{throw new Error("Invalid minute ["+b.minute+"].")
}}else{this.minute=NaN
}if(Jsonix.Util.Type.exists(b.second)){Jsonix.Util.Ensure.ensureInteger(b.second);
if(b.second>=0&&b.second<=59){this.second=b.second
}else{throw new Error("Invalid second ["+b.second+"].")
}}else{this.second=NaN
}if(Jsonix.Util.Type.exists(b.fractionalSecond)){Jsonix.Util.Ensure.ensureNumber(b.fractionalSecond);
if(b.fractionalSecond>=0&&b.fractionalSecond<1){this.fractionalSecond=b.fractionalSecond
}else{throw new Error("Invalid fractional second ["+b.fractionalSecond+"].")
}}else{this.fractionalSecond=NaN
}if(Jsonix.Util.Type.exists(b.timezone)){if(Jsonix.Util.Type.isNaN(b.timezone)){this.timezone=NaN
}else{Jsonix.Util.Ensure.ensureInteger(b.timezone);
if(b.timezone>=-1440&&b.timezone<1440){this.timezone=b.timezone
}else{throw new Error("Invalid timezone ["+b.timezone+"].")
}}}else{this.timezone=NaN
}},CLASS_NAME:"Jsonix.XML.Calendar"});
Jsonix.XML.Calendar.fromObject=function(b){Jsonix.Util.Ensure.ensureObject(b);
if(Jsonix.Util.Type.isString(b.CLASS_NAME)&&b.CLASS_NAME==="Jsonix.XML.Calendar"){return b
}return new Jsonix.XML.Calendar(b)
};
Jsonix.XML.Input=Jsonix.Class({root:null,node:null,attributes:null,eventType:null,pns:null,initialize:function(c){Jsonix.Util.Ensure.ensureExists(c);
this.root=c;
var d={"":""};
d[Jsonix.XML.XMLNS_P]=Jsonix.XML.XMLNS_NS;
this.pns=[d]
},hasNext:function(){if(this.node===null){return true
}else{if(this.node===this.root){var b=this.node.nodeType;
if(b===9&&this.eventType===8){return false
}else{if(b===1&&this.eventType===2){return false
}else{return true
}}}else{return true
}}},next:function(){if(this.eventType===null){return this.enter(this.root)
}if(this.eventType===7){var d=this.node.documentElement;
if(d){return this.enter(d)
}else{return this.leave(this.node)
}}else{if(this.eventType===1){var f=this.node.firstChild;
if(f){return this.enter(f)
}else{return this.leave(this.node)
}}else{if(this.eventType===2){var e=this.node.nextSibling;
if(e){return this.enter(e)
}else{return this.leave(this.node)
}}else{return this.leave(this.node)
}}}},enter:function(f){var e=f.nodeType;
this.node=f;
this.attributes=null;
if(e===1){this.eventType=1;
this.pushNS(f);
return this.eventType
}else{if(e===2){this.eventType=10;
return this.eventType
}else{if(e===3){var d=f.nodeValue;
if(Jsonix.Util.StringUtils.isEmpty(d)){this.eventType=6
}else{this.eventType=4
}return this.eventType
}else{if(e===4){this.eventType=12;
return this.eventType
}else{if(e===5){this.eventType=9;
return this.eventType
}else{if(e===6){this.eventType=15;
return this.eventType
}else{if(e===7){this.eventType=3;
return this.eventType
}else{if(e===8){this.eventType=5;
return this.eventType
}else{if(e===9){this.eventType=7;
return this.eventType
}else{if(e===10){this.eventType=12;
return this.eventType
}else{if(e===12){this.eventType=14;
return this.eventType
}else{throw new Error("Node type ["+e+"] is not supported.")
}}}}}}}}}}}},leave:function(h){if(h.nodeType===9){if(this.eventType==8){throw new Error("Invalid state.")
}else{this.node=h;
this.attributes=null;
this.eventType=8;
return this.eventType
}}else{if(h.nodeType===1){if(this.eventType==2){var g=h.nextSibling;
if(g){return this.enter(g)
}}else{this.node=h;
this.attributes=null;
this.eventType=2;
this.popNS();
return this.eventType
}}}var e=h.nextSibling;
if(e){return this.enter(e)
}else{var f=h.parentNode;
this.node=f;
this.attributes=null;
if(f.nodeType===9){this.eventType=8
}else{this.eventType=2
}return this.eventType
}},getName:function(){var b=this.node;
if(Jsonix.Util.Type.isString(b.nodeName)){if(Jsonix.Util.Type.isString(b.namespaceURI)){return new Jsonix.XML.QName(b.namespaceURI,b.nodeName)
}else{return new Jsonix.XML.QName(b.nodeName)
}}else{return null
}},getNameKey:function(){var b=this.node;
if(Jsonix.Util.Type.isString(b.nodeName)){return Jsonix.XML.QName.key(b.namespaceURI,b.nodeName)
}else{return null
}},getText:function(){return this.node.nodeValue
},nextTag:function(){var b=this.next();
while(b===7||b===4||b===12||b===6||b===3||b===5){b=this.next()
}if(b!==1&&b!==2){throw new Error("Expected start or end tag.")
}return b
},skipElement:function(){if(this.eventType!==Jsonix.XML.Input.START_ELEMENT){throw new Error("Parser must be on START_ELEMENT to skip element.")
}var d=1;
var c;
do{c=this.nextTag();
d+=(c===Jsonix.XML.Input.START_ELEMENT)?1:-1
}while(d>0);
return c
},getElementText:function(){if(this.eventType!=1){throw new Error("Parser must be on START_ELEMENT to read next text.")
}var c=this.next();
var d="";
while(c!==2){if(c===4||c===12||c===6||c===9){d=d+this.getText()
}else{if(c===3||c===5){}else{if(c===8){throw new Error("Unexpected end of document when reading element text content.")
}else{if(c===1){throw new Error("Element text content may not contain START_ELEMENT.")
}else{throw new Error("Unexpected event type ["+c+"].")
}}}}c=this.next()
}return d
},retrieveElement:function(){var b;
if(this.eventType===1){b=this.node
}else{if(this.eventType===10){b=this.node.parentNode
}else{throw new Error("Element can only be retrieved for START_ELEMENT or ATTRIBUTE nodes.")
}}return b
},retrieveAttributes:function(){var b;
if(this.attributes){b=this.attributes
}else{if(this.eventType===1){b=this.node.attributes;
this.attributes=b
}else{if(this.eventType===10){b=this.node.parentNode.attributes;
this.attributes=b
}else{throw new Error("Attributes can only be retrieved for START_ELEMENT or ATTRIBUTE nodes.")
}}}return b
},getAttributeCount:function(){var b=this.retrieveAttributes();
return b.length
},getAttributeName:function(d){var e=this.retrieveAttributes();
if(d<0||d>=e.length){throw new Error("Invalid attribute index ["+d+"].")
}var f=e[d];
if(Jsonix.Util.Type.isString(f.namespaceURI)){return new Jsonix.XML.QName(f.namespaceURI,f.nodeName)
}else{return new Jsonix.XML.QName(f.nodeName)
}},getAttributeNameKey:function(d){var e=this.retrieveAttributes();
if(d<0||d>=e.length){throw new Error("Invalid attribute index ["+d+"].")
}var f=e[d];
return Jsonix.XML.QName.key(f.namespaceURI,f.nodeName)
},getAttributeValue:function(d){var e=this.retrieveAttributes();
if(d<0||d>=e.length){throw new Error("Invalid attribute index ["+d+"].")
}var f=e[d];
return f.value
},getAttributeValueNS:null,getAttributeValueNSViaElement:function(d,e){var f=this.retrieveElement();
return f.getAttributeNS(d,e)
},getAttributeValueNSViaAttribute:function(d,e){var f=this.getAttributeNodeNS(d,e);
if(Jsonix.Util.Type.exists(f)){return f.nodeValue
}else{return null
}},getAttributeNodeNS:null,getAttributeNodeNSViaElement:function(d,e){var f=this.retrieveElement();
return f.getAttributeNodeNS(d,e)
},getAttributeNodeNSViaAttributes:function(o,p){var l=null;
var i=this.retrieveAttributes();
var m,k;
for(var n=0,j=i.length;
n0){for(var v=0;
v",propertyInfos:[e,f]})
},unmarshal:function(l,g,k){var h=null;
var j=this;
var i=function(a){if(Jsonix.Util.Type.exists(a)){Jsonix.Util.Ensure.ensureObject(a,"Map property requires an object.");
if(!Jsonix.Util.Type.exists(h)){h={}
}for(var c in a){if(a.hasOwnProperty(c)){var b=a[c];
if(j.collection){if(!Jsonix.Util.Type.exists(h[c])){h[c]=[]
}h[c].push(b)
}else{if(!Jsonix.Util.Type.exists(h[c])){h[c]=b
}else{throw new Error("Value was already set.")
}}}}}};
if(Jsonix.Util.Type.exists(this.wrapperElementName)){this.unmarshalWrapperElement(l,g,k,i)
}else{this.unmarshalElement(l,g,k,i)
}return h
},getTypeInfoByInputElement:function(d,e,f){return this.entryTypeInfo
},convertFromTypedNamedValue:function(i,l,g,k){var j=i.value;
var h={};
if(Jsonix.Util.Type.isString(j[this.key.name])){h[j[this.key.name]]=j[this.value.name]
}return h
},marshal:function(g,e,f,h){if(!Jsonix.Util.Type.exists(g)){return
}if(Jsonix.Util.Type.exists(this.wrapperElementName)){f.writeStartElement(this.wrapperElementName)
}this.marshalElement(g,e,f,h);
if(Jsonix.Util.Type.exists(this.wrapperElementName)){f.writeEndElement()
}},marshalElement:function(l,r,q,j){if(!!l){for(var m in l){if(l.hasOwnProperty(m)){var p=l[m];
if(!this.collection){var o={};
o[this.key.name]=m;
o[this.value.name]=p;
q.writeStartElement(this.elementName);
this.entryTypeInfo.marshal(o,r,q,j);
q.writeEndElement()
}else{for(var n=0;
n
0&&e.name.charAt(0)==="."&&Jsonix.Util.Type.isString(this.name)){e.name=this.name+e.name
}}else{if(Jsonix.Util.Type.isString(d)){if(Jsonix.Util.Type.isString(this.name)){e.name=this.name+"."+d
}else{e.name=d
}}else{throw new Error("Neither [name/n] nor [localName/ln] was provided for the class info.")
}}},createClassInfo:function(f){Jsonix.Util.Ensure.ensureObject(f);
var j=f.defaultElementNamespaceURI||f.dens||this.defaultElementNamespaceURI;
f.defaultElementNamespaceURI=j;
var g=f.targetNamespace||f.tns||this.targetNamespace;
f.targetNamespace=g;
var h=f.defaultAttributeNamespaceURI||f.dans||this.defaultAttributeNamespaceURI;
f.defaultAttributeNamespaceURI=h;
this.initializeNames(f);
var i=new this.mappingStyle.classInfo(f,{mappingStyle:this.mappingStyle});
return i
},createEnumLeafInfo:function(d){Jsonix.Util.Ensure.ensureObject(d);
this.initializeNames(d);
var c=new this.mappingStyle.enumLeafInfo(d,{mappingStyle:this.mappingStyle});
return c
},createList:function(e){Jsonix.Util.Ensure.ensureObject(e);
var g=e.baseTypeInfo||e.typeInfo||e.bti||e.ti||"String";
var f=e.typeName||e.tn||null;
if(Jsonix.Util.Type.exists(f)){if(Jsonix.Util.Type.isString(f)){f=new Jsonix.XML.QName(this.targetNamespace,f)
}else{f=Jsonix.XML.QName.fromObject(f)
}}var h=e.separator||e.sep||" ";
Jsonix.Util.Ensure.ensureExists(g);
return new Jsonix.Schema.XSD.List(g,f,h)
},createElementInfo:function(g){Jsonix.Util.Ensure.ensureObject(g);
g=Jsonix.Util.Type.cloneObject(g);
var i=g.defaultElementNamespaceURI||g.dens||this.defaultElementNamespaceURI;
g.defaultElementNamespaceURI=i;
var h=g.elementName||g.en||undefined;
Jsonix.Util.Ensure.ensureExists(h);
var j=g.typeInfo||g.ti||"String";
Jsonix.Util.Ensure.ensureExists(j);
g.typeInfo=j;
if(Jsonix.Util.Type.isObject(h)){g.elementName=Jsonix.XML.QName.fromObject(h)
}else{if(Jsonix.Util.Type.isString(h)){g.elementName=new Jsonix.XML.QName(this.defaultElementNamespaceURI,h)
}else{throw new Error("Element info ["+g+"] must provide an element name.")
}}var l=g.substitutionHead||g.sh||null;
if(Jsonix.Util.Type.exists(l)){if(Jsonix.Util.Type.isObject(l)){g.substitutionHead=Jsonix.XML.QName.fromObject(l)
}else{Jsonix.Util.Ensure.ensureString(l);
g.substitutionHead=new Jsonix.XML.QName(this.defaultElementNamespaceURI,l)
}}var k=new this.mappingStyle.elementInfo(g,{mappingStyle:this.mappingStyle});
return k
},registerTypeInfos:function(d){for(var e=0;
e0){h=h+this.separator
}h=h+this.typeInfo.reprint(i[l],k,g,j)
}return h
},parse:function(j,l,n,k){Jsonix.Util.Ensure.ensureString(j);
var h=Jsonix.Util.StringUtils.splitBySeparatorChars(j,this.trimmedSeparator);
var i=[];
for(var m=0;
m>2];
if(u+1>4)];
if(u+2>6)];
t=this.byteToChar[o&63]
}else{r=this.byteToChar[(j&15)<<2];
t="="
}}else{q=this.byteToChar[(i&3)<<4];
r="=";
t="="
}w=w+p+q+r+t
}return w
},decode:function(j){input=j.replace(/[^A-Za-z0-9\+\/\=]/g,"");
var x=(input.length/4)*3;
if(input.charAt(input.length-1)==="="){x--
}if(input.charAt(input.length-2)==="="){x--
}var t=new Array(x);
var i;
var o;
var p;
var q;
var r;
var s;
var u;
var v=0;
var w=0;
for(v=0;
v>4);
o=((r&15)<<4)|(s>>2);
p=((s&3)<<6)|u;
t[v]=i;
if(s!=64){t[v+1]=o
}if(u!=64){t[v+2]=p
}}return t
},isInstance:function(f,e,d){return Jsonix.Util.Type.isArray(f)
},CLASS_NAME:"Jsonix.Schema.XSD.Base64Binary"});
Jsonix.Schema.XSD.Base64Binary.INSTANCE=new Jsonix.Schema.XSD.Base64Binary();
Jsonix.Schema.XSD.Base64Binary.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Base64Binary.INSTANCE);
Jsonix.Schema.XSD.HexBinary=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"HexBinary",typeName:Jsonix.Schema.XSD.qname("hexBinary"),charToQuartet:{},byteToDuplet:[],initialize:function(){Jsonix.Schema.XSD.AnySimpleType.prototype.initialize.apply(this);
var d="0123456789ABCDEF";
var f=d.toLowerCase();
var e;
for(e=0;
e<16;
e++){this.charToQuartet[d.charAt(e)]=e;
if(e>=10){this.charToQuartet[f.charAt(e)]=e
}}for(e=0;
e<256;
e++){this.byteToDuplet[e]=d[e>>4]+d[e&15]
}},print:function(g,e,f,h){Jsonix.Util.Ensure.ensureArray(g);
return this.encode(g)
},parse:function(g,e,f,h){Jsonix.Util.Ensure.ensureString(g);
return this.decode(g)
},encode:function(f){var e="";
for(var d=0;
d>1;
var n=new Array(l);
for(var h=0;
h=this.MIN_VALUE&&f<=this.MAX_VALUE)
},MIN_VALUE:-3.4028235e+38,MAX_VALUE:3.4028235e+38,CLASS_NAME:"Jsonix.Schema.XSD.Float"});
Jsonix.Schema.XSD.Float.INSTANCE=new Jsonix.Schema.XSD.Float();
Jsonix.Schema.XSD.Float.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Float.INSTANCE);
Jsonix.Schema.XSD.Decimal=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"Decimal",typeName:Jsonix.Schema.XSD.qname("decimal"),print:function(i,f,g,j){Jsonix.Util.Ensure.ensureNumber(i);
var h=String(i);
return h
},parse:function(h,f,g,j){Jsonix.Util.Ensure.ensureString(h);
var i=Number(h);
Jsonix.Util.Ensure.ensureNumber(i);
return i
},isInstance:function(f,e,d){return Jsonix.Util.Type.isNumber(f)
},CLASS_NAME:"Jsonix.Schema.XSD.Decimal"});
Jsonix.Schema.XSD.Decimal.INSTANCE=new Jsonix.Schema.XSD.Decimal();
Jsonix.Schema.XSD.Decimal.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Decimal.INSTANCE);
Jsonix.Schema.XSD.Integer=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"Integer",typeName:Jsonix.Schema.XSD.qname("integer"),print:function(i,f,g,j){Jsonix.Util.Ensure.ensureInteger(i);
var h=String(i);
return h
},parse:function(h,f,g,j){Jsonix.Util.Ensure.ensureString(h);
var i=Number(h);
Jsonix.Util.Ensure.ensureInteger(i);
return i
},isInstance:function(f,e,d){return Jsonix.Util.NumberUtils.isInteger(f)&&f>=this.MIN_VALUE&&f<=this.MAX_VALUE
},MIN_VALUE:-9223372036854776000,MAX_VALUE:9223372036854776000,CLASS_NAME:"Jsonix.Schema.XSD.Integer"});
Jsonix.Schema.XSD.Integer.INSTANCE=new Jsonix.Schema.XSD.Integer();
Jsonix.Schema.XSD.Integer.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Integer.INSTANCE);
Jsonix.Schema.XSD.NonPositiveInteger=Jsonix.Class(Jsonix.Schema.XSD.Integer,{name:"NonPositiveInteger",typeName:Jsonix.Schema.XSD.qname("nonPositiveInteger"),MIN_VALUE:-9223372036854776000,MAX_VALUE:0,CLASS_NAME:"Jsonix.Schema.XSD.NonPositiveInteger"});
Jsonix.Schema.XSD.NonPositiveInteger.INSTANCE=new Jsonix.Schema.XSD.NonPositiveInteger();
Jsonix.Schema.XSD.NonPositiveInteger.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.NonPositiveInteger.INSTANCE);
Jsonix.Schema.XSD.NegativeInteger=Jsonix.Class(Jsonix.Schema.XSD.NonPositiveInteger,{name:"NegativeInteger",typeName:Jsonix.Schema.XSD.qname("negativeInteger"),MIN_VALUE:-9223372036854776000,MAX_VALUE:-1,CLASS_NAME:"Jsonix.Schema.XSD.NegativeInteger"});
Jsonix.Schema.XSD.NegativeInteger.INSTANCE=new Jsonix.Schema.XSD.NegativeInteger();
Jsonix.Schema.XSD.NegativeInteger.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.NegativeInteger.INSTANCE);
Jsonix.Schema.XSD.Long=Jsonix.Class(Jsonix.Schema.XSD.Integer,{name:"Long",typeName:Jsonix.Schema.XSD.qname("long"),MIN_VALUE:-9223372036854776000,MAX_VALUE:9223372036854776000,CLASS_NAME:"Jsonix.Schema.XSD.Long"});
Jsonix.Schema.XSD.Long.INSTANCE=new Jsonix.Schema.XSD.Long();
Jsonix.Schema.XSD.Long.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Long.INSTANCE);
Jsonix.Schema.XSD.Int=Jsonix.Class(Jsonix.Schema.XSD.Long,{name:"Int",typeName:Jsonix.Schema.XSD.qname("int"),MIN_VALUE:-2147483648,MAX_VALUE:2147483647,CLASS_NAME:"Jsonix.Schema.XSD.Int"});
Jsonix.Schema.XSD.Int.INSTANCE=new Jsonix.Schema.XSD.Int();
Jsonix.Schema.XSD.Int.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Int.INSTANCE);
Jsonix.Schema.XSD.Short=Jsonix.Class(Jsonix.Schema.XSD.Int,{name:"Short",typeName:Jsonix.Schema.XSD.qname("short"),MIN_VALUE:-32768,MAX_VALUE:32767,CLASS_NAME:"Jsonix.Schema.XSD.Short"});
Jsonix.Schema.XSD.Short.INSTANCE=new Jsonix.Schema.XSD.Short();
Jsonix.Schema.XSD.Short.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Short.INSTANCE);
Jsonix.Schema.XSD.Byte=Jsonix.Class(Jsonix.Schema.XSD.Short,{name:"Byte",typeName:Jsonix.Schema.XSD.qname("byte"),MIN_VALUE:-128,MAX_VALUE:127,CLASS_NAME:"Jsonix.Schema.XSD.Byte"});
Jsonix.Schema.XSD.Byte.INSTANCE=new Jsonix.Schema.XSD.Byte();
Jsonix.Schema.XSD.Byte.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Byte.INSTANCE);
Jsonix.Schema.XSD.NonNegativeInteger=Jsonix.Class(Jsonix.Schema.XSD.Integer,{name:"NonNegativeInteger",typeName:Jsonix.Schema.XSD.qname("nonNegativeInteger"),MIN_VALUE:0,MAX_VALUE:9223372036854776000,CLASS_NAME:"Jsonix.Schema.XSD.NonNegativeInteger"});
Jsonix.Schema.XSD.NonNegativeInteger.INSTANCE=new Jsonix.Schema.XSD.NonNegativeInteger();
Jsonix.Schema.XSD.NonNegativeInteger.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.NonNegativeInteger.INSTANCE);
Jsonix.Schema.XSD.UnsignedLong=Jsonix.Class(Jsonix.Schema.XSD.NonNegativeInteger,{name:"UnsignedLong",typeName:Jsonix.Schema.XSD.qname("unsignedLong"),MIN_VALUE:0,MAX_VALUE:18446744073709552000,CLASS_NAME:"Jsonix.Schema.XSD.UnsignedLong"});
Jsonix.Schema.XSD.UnsignedLong.INSTANCE=new Jsonix.Schema.XSD.UnsignedLong();
Jsonix.Schema.XSD.UnsignedLong.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedLong.INSTANCE);
Jsonix.Schema.XSD.UnsignedInt=Jsonix.Class(Jsonix.Schema.XSD.UnsignedLong,{name:"UnsignedInt",typeName:Jsonix.Schema.XSD.qname("unsignedInt"),MIN_VALUE:0,MAX_VALUE:4294967295,CLASS_NAME:"Jsonix.Schema.XSD.UnsignedInt"});
Jsonix.Schema.XSD.UnsignedInt.INSTANCE=new Jsonix.Schema.XSD.UnsignedInt();
Jsonix.Schema.XSD.UnsignedInt.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedInt.INSTANCE);
Jsonix.Schema.XSD.UnsignedShort=Jsonix.Class(Jsonix.Schema.XSD.UnsignedInt,{name:"UnsignedShort",typeName:Jsonix.Schema.XSD.qname("unsignedShort"),MIN_VALUE:0,MAX_VALUE:65535,CLASS_NAME:"Jsonix.Schema.XSD.UnsignedShort"});
Jsonix.Schema.XSD.UnsignedShort.INSTANCE=new Jsonix.Schema.XSD.UnsignedShort();
Jsonix.Schema.XSD.UnsignedShort.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedShort.INSTANCE);
Jsonix.Schema.XSD.UnsignedByte=Jsonix.Class(Jsonix.Schema.XSD.UnsignedShort,{name:"UnsignedByte",typeName:Jsonix.Schema.XSD.qname("unsignedByte"),MIN_VALUE:0,MAX_VALUE:255,CLASS_NAME:"Jsonix.Schema.XSD.UnsignedByte"});
Jsonix.Schema.XSD.UnsignedByte.INSTANCE=new Jsonix.Schema.XSD.UnsignedByte();
Jsonix.Schema.XSD.UnsignedByte.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedByte.INSTANCE);
Jsonix.Schema.XSD.PositiveInteger=Jsonix.Class(Jsonix.Schema.XSD.NonNegativeInteger,{name:"PositiveInteger",typeName:Jsonix.Schema.XSD.qname("positiveInteger"),MIN_VALUE:1,MAX_VALUE:9223372036854776000,CLASS_NAME:"Jsonix.Schema.XSD.PositiveInteger"});
Jsonix.Schema.XSD.PositiveInteger.INSTANCE=new Jsonix.Schema.XSD.PositiveInteger();
Jsonix.Schema.XSD.PositiveInteger.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.PositiveInteger.INSTANCE);
Jsonix.Schema.XSD.Double=Jsonix.Class(Jsonix.Schema.XSD.Number,{name:"Double",typeName:Jsonix.Schema.XSD.qname("double"),isInstance:function(f,e,d){return Jsonix.Util.Type.isNaN(f)||f===-Infinity||f===Infinity||(Jsonix.Util.Type.isNumber(f)&&f>=this.MIN_VALUE&&f<=this.MAX_VALUE)
},MIN_VALUE:-1.7976931348623157e+308,MAX_VALUE:1.7976931348623157e+308,CLASS_NAME:"Jsonix.Schema.XSD.Double"});
Jsonix.Schema.XSD.Double.INSTANCE=new Jsonix.Schema.XSD.Double();
Jsonix.Schema.XSD.Double.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Double.INSTANCE);
Jsonix.Schema.XSD.AnyURI=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"AnyURI",typeName:Jsonix.Schema.XSD.qname("anyURI"),print:function(g,e,f,h){Jsonix.Util.Ensure.ensureString(g);
return g
},parse:function(g,e,f,h){Jsonix.Util.Ensure.ensureString(g);
return g
},isInstance:function(f,e,d){return Jsonix.Util.Type.isString(f)
},CLASS_NAME:"Jsonix.Schema.XSD.AnyURI"});
Jsonix.Schema.XSD.AnyURI.INSTANCE=new Jsonix.Schema.XSD.AnyURI();
Jsonix.Schema.XSD.AnyURI.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.AnyURI.INSTANCE);
Jsonix.Schema.XSD.QName=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"QName",typeName:Jsonix.Schema.XSD.qname("QName"),print:function(j,n,h,m){var k=Jsonix.XML.QName.fromObject(j);
var l;
var i=k.localPart;
if(h){l=h.getPrefix(k.namespaceURI,k.prefix||null);
h.declareNamespace(k.namespaceURI,l)
}else{l=k.prefix
}return !l?i:(l+":"+i)
},parse:function(k,r,l,j){Jsonix.Util.Ensure.ensureString(k);
k=Jsonix.Util.StringUtils.trim(k);
var m;
var n;
var p=k.indexOf(":");
if(p===-1){m="";
n=k
}else{if(p>0&&p<(k.length-1)){m=k.substring(0,p);
n=k.substring(p+1)
}else{throw new Error("Invalid QName ["+k+"].")
}}var o=l||r||null;
if(!o){return k
}else{var q=o.getNamespaceURI(m);
if(Jsonix.Util.Type.isString(q)){return new Jsonix.XML.QName(q,n,m)
}else{throw new Error("Prefix ["+m+"] of the QName ["+k+"] is not bound in this context.")
}}},isInstance:function(f,e,d){return(f instanceof Jsonix.XML.QName)||(Jsonix.Util.Type.isObject(f)&&Jsonix.Util.Type.isString(f.localPart||f.lp))
},CLASS_NAME:"Jsonix.Schema.XSD.QName"});
Jsonix.Schema.XSD.QName.INSTANCE=new Jsonix.Schema.XSD.QName();
Jsonix.Schema.XSD.QName.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.QName.INSTANCE);
Jsonix.Schema.XSD.Calendar=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"Calendar",typeName:Jsonix.Schema.XSD.qname("calendar"),parse:function(k,n,p,m){Jsonix.Util.Ensure.ensureString(k);
var o=(k.charAt(0)==="-");
var i=o?-1:1;
var l=o?k.substring(1):k;
var j;
if(l.length>=19&&l.charAt(4)==="-"&&l.charAt(7)==="-"&&l.charAt(10)==="T"&&l.charAt(13)===":"&&l.charAt(16)===":"){return this.parseDateTime(k)
}else{if(l.length>=10&&l.charAt(4)==="-"&&l.charAt(7)==="-"){return this.parseDate(k)
}else{if(l.length>=8&&l.charAt(2)===":"&&l.charAt(5)===":"){return this.parseTime(k)
}else{throw new Error("Value ["+k+"] does not match dateTime, date or time patterns.")
}}}},parseDateTime:function(p){Jsonix.Util.Ensure.ensureString(p);
var w=(p.charAt(0)==="-");
var B=w?-1:1;
var v=w?p.substring(1):p;
if(v.length<19||v.charAt(4)!=="-"||v.charAt(7)!=="-"||v.charAt(10)!=="T"||v.charAt(13)!==":"||v.charAt(16)!==":"){throw new Error("Date time string ["+v+"] must be a string in format ['-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?].")
}var x;
var A=v.indexOf("+",19);
if(A>=0){x=A
}else{var u=v.indexOf("-",19);
if(u>=0){x=u
}else{var s=v.indexOf("Z",19);
if(s>=0){x=s
}else{x=v.length
}}}var C=x>0&&x=0){v=x
}else{var t=r.indexOf("-",10);
if(t>=0){v=t
}else{var q=r.indexOf("Z",10);
if(q>=0){v=q
}else{v=r.length
}}}var z=v>0&&v=0){p=r
}else{var o=k.indexOf("-",7);
if(o>=0){p=o
}else{var m=k.indexOf("Z",7);
if(m>=0){p=m
}else{p=k.length
}}}var s=p>0&&p=9?r.substring(8):"";
var m=this.parseHour(n);
var o=this.parseHour(k);
var q=this.parseSecond(p);
var l=this.parseFractionalSecond(j);
return{hour:m,minute:o,second:q,fractionalSecond:l}
},parseTimeZoneString:function(i){Jsonix.Util.Ensure.ensureString(i);
if(i===""){return NaN
}else{if(i==="Z"){return 0
}else{if(i.length!==6){throw new Error("Time zone must be an empty string, 'Z' or a string in format [('+' | '-') hh ':' mm].")
}var h=i.charAt(0);
var f;
if(h==="+"){f=1
}else{if(h==="-"){f=-1
}else{throw new Error("First character of the time zone ["+i+"] must be '+' or '-'.")
}}var g=this.parseHour(i.substring(1,3));
var j=this.parseMinute(i.substring(4,6));
return -1*f*(g*60+j)
}}},parseYear:function(c){Jsonix.Util.Ensure.ensureString(c);
if(c.length!==4){throw new Error("Year ["+c+"] must be a four-digit number.")
}var d=Number(c);
Jsonix.Util.Ensure.ensureInteger(d);
return d
},parseMonth:function(c){Jsonix.Util.Ensure.ensureString(c);
if(c.length!==2){throw new Error("Month ["+c+"] must be a two-digit number.")
}var d=Number(c);
Jsonix.Util.Ensure.ensureInteger(d);
return d
},parseDay:function(c){Jsonix.Util.Ensure.ensureString(c);
if(c.length!==2){throw new Error("Day ["+c+"] must be a two-digit number.")
}var d=Number(c);
Jsonix.Util.Ensure.ensureInteger(d);
return d
},parseHour:function(c){Jsonix.Util.Ensure.ensureString(c);
if(c.length!==2){throw new Error("Hour ["+c+"] must be a two-digit number.")
}var d=Number(c);
Jsonix.Util.Ensure.ensureInteger(d);
return d
},parseMinute:function(c){Jsonix.Util.Ensure.ensureString(c);
if(c.length!==2){throw new Error("Minute ["+c+"] must be a two-digit number.")
}var d=Number(c);
Jsonix.Util.Ensure.ensureInteger(d);
return d
},parseSecond:function(c){Jsonix.Util.Ensure.ensureString(c);
if(c.length!==2){throw new Error("Second ["+c+"] must be a two-digit number.")
}var d=Number(c);
Jsonix.Util.Ensure.ensureNumber(d);
return d
},parseFractionalSecond:function(c){Jsonix.Util.Ensure.ensureString(c);
if(c===""){return 0
}else{var d=Number(c);
Jsonix.Util.Ensure.ensureNumber(d);
return d
}},print:function(g,e,f,h){Jsonix.Util.Ensure.ensureObject(g);
if(Jsonix.Util.NumberUtils.isInteger(g.year)&&Jsonix.Util.NumberUtils.isInteger(g.month)&&Jsonix.Util.NumberUtils.isInteger(g.day)&&Jsonix.Util.NumberUtils.isInteger(g.hour)&&Jsonix.Util.NumberUtils.isInteger(g.minute)&&Jsonix.Util.NumberUtils.isInteger(g.second)){return this.printDateTime(g)
}else{if(Jsonix.Util.NumberUtils.isInteger(g.year)&&Jsonix.Util.NumberUtils.isInteger(g.month)&&Jsonix.Util.NumberUtils.isInteger(g.day)){return this.printDate(g)
}else{if(Jsonix.Util.NumberUtils.isInteger(g.hour)&&Jsonix.Util.NumberUtils.isInteger(g.minute)&&Jsonix.Util.NumberUtils.isInteger(g.second)){return this.printTime(g)
}else{throw new Error("Value ["+g+"] is not recognized as dateTime, date or time.")
}}}},printDateTime:function(c){Jsonix.Util.Ensure.ensureObject(c);
Jsonix.Util.Ensure.ensureInteger(c.year);
Jsonix.Util.Ensure.ensureInteger(c.month);
Jsonix.Util.Ensure.ensureInteger(c.day);
Jsonix.Util.Ensure.ensureInteger(c.hour);
Jsonix.Util.Ensure.ensureInteger(c.minute);
Jsonix.Util.Ensure.ensureNumber(c.second);
if(Jsonix.Util.Type.exists(c.fractionalString)){Jsonix.Util.Ensure.ensureNumber(c.fractionalString)
}if(Jsonix.Util.Type.exists(c.timezone)&&!Jsonix.Util.Type.isNaN(c.timezone)){Jsonix.Util.Ensure.ensureInteger(c.timezone)
}var d=this.printDateString(c);
d=d+"T";
d=d+this.printTimeString(c);
if(Jsonix.Util.Type.exists(c.timezone)){d=d+this.printTimeZoneString(c.timezone)
}return d
},printDate:function(c){Jsonix.Util.Ensure.ensureObject(c);
Jsonix.Util.Ensure.ensureNumber(c.year);
Jsonix.Util.Ensure.ensureNumber(c.month);
Jsonix.Util.Ensure.ensureNumber(c.day);
if(Jsonix.Util.Type.exists(c.timezone)&&!Jsonix.Util.Type.isNaN(c.timezone)){Jsonix.Util.Ensure.ensureInteger(c.timezone)
}var d=this.printDateString(c);
if(Jsonix.Util.Type.exists(c.timezone)){d=d+this.printTimeZoneString(c.timezone)
}return d
},printTime:function(c){Jsonix.Util.Ensure.ensureObject(c);
Jsonix.Util.Ensure.ensureNumber(c.hour);
Jsonix.Util.Ensure.ensureNumber(c.minute);
Jsonix.Util.Ensure.ensureNumber(c.second);
if(Jsonix.Util.Type.exists(c.fractionalString)){Jsonix.Util.Ensure.ensureNumber(c.fractionalString)
}if(Jsonix.Util.Type.exists(c.timezone)&&!Jsonix.Util.Type.isNaN(c.timezone)){Jsonix.Util.Ensure.ensureInteger(c.timezone)
}var d=this.printTimeString(c);
if(Jsonix.Util.Type.exists(c.timezone)){d=d+this.printTimeZoneString(c.timezone)
}return d
},printDateString:function(b){Jsonix.Util.Ensure.ensureObject(b);
Jsonix.Util.Ensure.ensureInteger(b.year);
Jsonix.Util.Ensure.ensureInteger(b.month);
Jsonix.Util.Ensure.ensureInteger(b.day);
return(b.year<0?("-"+this.printYear(-b.year)):this.printYear(b.year))+"-"+this.printMonth(b.month)+"-"+this.printDay(b.day)
},printTimeString:function(c){Jsonix.Util.Ensure.ensureObject(c);
Jsonix.Util.Ensure.ensureInteger(c.hour);
Jsonix.Util.Ensure.ensureInteger(c.minute);
Jsonix.Util.Ensure.ensureInteger(c.second);
if(Jsonix.Util.Type.exists(c.fractionalSecond)){Jsonix.Util.Ensure.ensureNumber(c.fractionalSecond)
}var d=this.printHour(c.hour);
d=d+":";
d=d+this.printMinute(c.minute);
d=d+":";
d=d+this.printSecond(c.second);
if(Jsonix.Util.Type.exists(c.fractionalSecond)){d=d+this.printFractionalSecond(c.fractionalSecond)
}return d
},printTimeZoneString:function(j){if(!Jsonix.Util.Type.exists(j)||Jsonix.Util.Type.isNaN(j)){return""
}else{Jsonix.Util.Ensure.ensureInteger(j);
var l=j<0?-1:(j>0?1:0);
var k=j*l;
var i=k%60;
var g=Math.floor(k/60);
var h;
if(l===0){return"Z"
}else{if(l>0){h="-"
}else{if(l<0){h="+"
}}h=h+this.printHour(g);
h=h+":";
h=h+this.printMinute(i);
return h
}}},printYear:function(b){return this.printInteger(b,4)
},printMonth:function(b){return this.printInteger(b,2)
},printDay:function(b){return this.printInteger(b,2)
},printHour:function(b){return this.printInteger(b,2)
},printMinute:function(b){return this.printInteger(b,2)
},printSecond:function(b){return this.printInteger(b,2)
},printFractionalSecond:function(f){Jsonix.Util.Ensure.ensureNumber(f);
if(f<0||f>=1){throw new Error("Fractional second ["+f+"] must be between 0 and 1.")
}else{if(f===0){return""
}else{var e=String(f);
var d=e.indexOf(".");
if(d<0){return""
}else{return e.substring(d)
}}}},printInteger:function(g,h){Jsonix.Util.Ensure.ensureInteger(g);
Jsonix.Util.Ensure.ensureInteger(h);
if(h<=0){throw new Error("Length ["+g+"] must be positive.")
}if(g<0){throw new Error("Value ["+g+"] must not be negative.")
}if(g>=Math.pow(10,h)){throw new Error("Value ["+g+"] must be less than ["+Math.pow(10,h)+"].")
}var f=String(g);
for(var e=f.length;
e=86400000){throw new Error("Invalid time ["+n+"].")
}if(n.originalTimezoneOffset===null){return this.printTime(new Jsonix.XML.Calendar({hour:n.getHours(),minute:n.getMinutes(),second:n.getSeconds(),fractionalSecond:(n.getMilliseconds()/1000)}))
}else{var s;
var m;
var l=n.getTimezoneOffset();
if(Jsonix.Util.NumberUtils.isInteger(n.originalTimezoneOffset)){m=n.originalTimezoneOffset;
s=new Date(n.getTime()-(60000*(m-l)))
}else{m=l;
s=n
}var o=s.getTime();
if(o>=0){return this.printTime(new Jsonix.XML.Calendar({hour:s.getHours(),minute:s.getMinutes(),second:s.getSeconds(),fractionalSecond:(s.getMilliseconds()/1000),timezone:m}))
}else{var p=Math.ceil(-o/3600000);
return this.printTime(new Jsonix.XML.Calendar({hour:(s.getHours()+p+m/60)%24,minute:s.getMinutes(),second:s.getSeconds(),fractionalSecond:(s.getMilliseconds()/1000),timezone:-p*60}))
}}},isInstance:function(f,e,d){return Jsonix.Util.Type.isDate(f)&&f.getTime()>-86400000&&f.getTime()<86400000
},CLASS_NAME:"Jsonix.Schema.XSD.Time"});
Jsonix.Schema.XSD.Time.INSTANCE=new Jsonix.Schema.XSD.Time();
Jsonix.Schema.XSD.Time.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Time.INSTANCE);
Jsonix.Schema.XSD.Date=Jsonix.Class(Jsonix.Schema.XSD.Calendar,{name:"Date",typeName:Jsonix.Schema.XSD.qname("date"),parse:function(o,t,p,l){var q=this.parseDate(o);
var s=new Date();
s.setFullYear(q.year);
s.setMonth(q.month-1);
s.setDate(q.day);
s.setHours(0);
s.setMinutes(0);
s.setSeconds(0);
s.setMilliseconds(0);
if(Jsonix.Util.Type.isNumber(q.fractionalSecond)){s.setMilliseconds(Math.floor(1000*q.fractionalSecond))
}var n;
var r;
var m=s.getTimezoneOffset();
if(Jsonix.Util.NumberUtils.isInteger(q.timezone)){n=q.timezone;
r=false
}else{n=m;
r=true
}var k=new Date(s.getTime()+(60000*(n-m)));
if(r){k.originalTimezoneOffset=null
}else{k.originalTimezoneOffset=n
}return k
},print:function(m,r,p,j){Jsonix.Util.Ensure.ensureDate(m);
var o=new Date(m.getTime());
o.setHours(0);
o.setMinutes(0);
o.setSeconds(0);
o.setMilliseconds(0);
if(m.originalTimezoneOffset===null){return this.printDate(new Jsonix.XML.Calendar({year:m.getFullYear(),month:m.getMonth()+1,day:m.getDate()}))
}else{if(Jsonix.Util.NumberUtils.isInteger(m.originalTimezoneOffset)){var q=new Date(m.getTime()-(60000*(m.originalTimezoneOffset-m.getTimezoneOffset())));
return this.printDate(new Jsonix.XML.Calendar({year:q.getFullYear(),month:q.getMonth()+1,day:q.getDate(),timezone:m.originalTimezoneOffset}))
}else{var k=m.getTime()-o.getTime();
if(k===0){return this.printDate(new Jsonix.XML.Calendar({year:m.getFullYear(),month:m.getMonth()+1,day:m.getDate()}))
}else{var l=k+(60000*m.getTimezoneOffset());
if(l<=43200000){return this.printDate(new Jsonix.XML.Calendar({year:m.getFullYear(),month:m.getMonth()+1,day:m.getDate(),timezone:Math.floor(l/60000)}))
}else{var n=new Date(m.getTime()+86400000);
return this.printDate(new Jsonix.XML.Calendar({year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate(),timezone:(Math.floor(l/60000)-1440)}))
}}}}},isInstance:function(f,e,d){return Jsonix.Util.Type.isDate(f)
},CLASS_NAME:"Jsonix.Schema.XSD.Date"});
Jsonix.Schema.XSD.Date.INSTANCE=new Jsonix.Schema.XSD.Date();
Jsonix.Schema.XSD.Date.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Date.INSTANCE);
Jsonix.Schema.XSD.GYearMonth=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"GYearMonth",typeName:Jsonix.Schema.XSD.qname("gYearMonth"),CLASS_NAME:"Jsonix.Schema.XSD.GYearMonth"});
Jsonix.Schema.XSD.GYearMonth.INSTANCE=new Jsonix.Schema.XSD.GYearMonth();
Jsonix.Schema.XSD.GYearMonth.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GYearMonth.INSTANCE);
Jsonix.Schema.XSD.GYear=Jsonix.Class(Jsonix.Schema.XSD.Calendar,{name:"GYear",typeName:Jsonix.Schema.XSD.qname("gYear"),parse:function(h,f,g,i){var j=this.splitGYear(h);
j.toString=function(){return"EmptyXMLElement. Call embedded 'year' or 'timezone' property"
};
return j
},splitGYear:function(g){var h=new RegExp("^"+Jsonix.Schema.XSD.Calendar.GYEAR_PATTERN+"$");
var f=g.match(h);
if(f!==null){var e={year:parseInt(f[1],10),_timezone:f[5],timezone:this.parseTimeZoneString(f[5])};
return e
}throw new Error("Value ["+g+"] doesn't match the gYear pattern.")
},parseTimeZoneString:function(c){if(c==="Z"||!Jsonix.Util.Type.exists(c)){return 0
}var d=c.split(":");
return -(parseInt(d[0],10)*60+parseInt(d[1],10))
},_validateGYear:function(c){var d=new RegExp("^"+Jsonix.Schema.XSD.Calendar.GYEAR_PATTERN+"$");
if(!d.test(c)){throw new Error("Value ["+c+"] doesn't match the gYear pattern.")
}},_validateYear:function(d){var c=new RegExp("^"+Jsonix.Schema.XSD.Calendar.YEAR_PATTERN+"$");
if(!c.test(d)){throw new Error("Value ["+d+"] doesn't match the year pattern.")
}},_validateTimeZone:function(c){var d=new RegExp("^"+Jsonix.Schema.XSD.Calendar.TIMEZONE_PATTERN+"$");
if(!d.test(c)){throw new Error("Value ["+c+"] doesn't match the time zone pattern.")
}},CLASS_NAME:"Jsonix.Schema.XSD.GYear"});
Jsonix.Schema.XSD.GYear.INSTANCE=new Jsonix.Schema.XSD.GYear();
Jsonix.Schema.XSD.GYear.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GYear.INSTANCE);
Jsonix.Schema.XSD.GMonthDay=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"GMonthDay",typeName:Jsonix.Schema.XSD.qname("gMonthDay"),CLASS_NAME:"Jsonix.Schema.XSD.GMonthDay"});
Jsonix.Schema.XSD.GMonthDay.INSTANCE=new Jsonix.Schema.XSD.GMonthDay();
Jsonix.Schema.XSD.GMonthDay.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GMonthDay.INSTANCE);
Jsonix.Schema.XSD.GDay=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"GDay",typeName:Jsonix.Schema.XSD.qname("gDay"),CLASS_NAME:"Jsonix.Schema.XSD.GDay"});
Jsonix.Schema.XSD.GDay.INSTANCE=new Jsonix.Schema.XSD.GDay();
Jsonix.Schema.XSD.GDay.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GDay.INSTANCE);
Jsonix.Schema.XSD.GMonth=Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType,{name:"GMonth",typeName:Jsonix.Schema.XSD.qname("gMonth"),CLASS_NAME:"Jsonix.Schema.XSD.GMonth"});
Jsonix.Schema.XSD.GMonth.INSTANCE=new Jsonix.Schema.XSD.GMonth();
Jsonix.Schema.XSD.GMonth.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GMonth.INSTANCE);
Jsonix.Schema.XSD.ID=Jsonix.Class(Jsonix.Schema.XSD.String,{name:"ID",typeName:Jsonix.Schema.XSD.qname("ID"),CLASS_NAME:"Jsonix.Schema.XSD.ID"});
Jsonix.Schema.XSD.ID.INSTANCE=new Jsonix.Schema.XSD.ID();
Jsonix.Schema.XSD.ID.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.ID.INSTANCE);
Jsonix.Schema.XSD.IDREF=Jsonix.Class(Jsonix.Schema.XSD.String,{name:"IDREF",typeName:Jsonix.Schema.XSD.qname("IDREF"),CLASS_NAME:"Jsonix.Schema.XSD.IDREF"});
Jsonix.Schema.XSD.IDREF.INSTANCE=new Jsonix.Schema.XSD.IDREF();
Jsonix.Schema.XSD.IDREF.INSTANCE.LIST=new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.IDREF.INSTANCE);
Jsonix.Schema.XSD.IDREFS=Jsonix.Class(Jsonix.Schema.XSD.List,{name:"IDREFS",initialize:function(){Jsonix.Schema.XSD.List.prototype.initialize.apply(this,[Jsonix.Schema.XSD.IDREF.INSTANCE,Jsonix.Schema.XSD.qname("IDREFS")," "])
},CLASS_NAME:"Jsonix.Schema.XSD.IDREFS"});
Jsonix.Schema.XSD.IDREFS.INSTANCE=new Jsonix.Schema.XSD.IDREFS();
Jsonix.Schema.XSI={};
Jsonix.Schema.XSI.NAMESPACE_URI="http://www.w3.org/2001/XMLSchema-instance";
Jsonix.Schema.XSI.PREFIX="xsi";
Jsonix.Schema.XSI.TYPE="type";
Jsonix.Schema.XSI.NIL="nil";
Jsonix.Schema.XSI.qname=function(b){Jsonix.Util.Ensure.ensureString(b);
return new Jsonix.XML.QName(Jsonix.Schema.XSI.NAMESPACE_URI,b,Jsonix.Schema.XSI.PREFIX)
};
Jsonix.Schema.XSI.TYPE_QNAME=Jsonix.Schema.XSI.qname(Jsonix.Schema.XSI.TYPE);
Jsonix.Context=Jsonix.Class(Jsonix.Mapping.Styled,{modules:[],typeInfos:null,typeNameKeyToTypeInfo:null,elementInfos:null,options:null,substitutionMembersMap:null,scopedElementInfosMap:null,supportXsiType:true,initialize:function(i,l){Jsonix.Mapping.Styled.prototype.initialize.apply(this,[l]);
this.modules=[];
this.elementInfos=[];
this.typeInfos={};
this.typeNameKeyToTypeInfo={};
this.registerBuiltinTypeInfos();
this.namespacePrefixes={};
this.prefixNamespaces={};
this.substitutionMembersMap={};
this.scopedElementInfosMap={};
if(Jsonix.Util.Type.exists(l)){Jsonix.Util.Ensure.ensureObject(l);
if(Jsonix.Util.Type.isObject(l.namespacePrefixes)){this.namespacePrefixes=Jsonix.Util.Type.cloneObject(l.namespacePrefixes,{})
}if(Jsonix.Util.Type.isBoolean(l.supportXsiType)){this.supportXsiType=l.supportXsiType
}}for(var j in this.namespacePrefixes){if(this.namespacePrefixes.hasOwnProperty(j)){p=this.namespacePrefixes[j];
this.prefixNamespaces[p]=j
}}if(Jsonix.Util.Type.exists(i)){Jsonix.Util.Ensure.ensureArray(i);
var g,h,k;
for(g=0;
g0&&f.charAt(0)==="."){var h=j.name||j.n||undefined;
Jsonix.Util.Ensure.ensureObject(j,"Type info mapping can only be resolved if module is provided.");
Jsonix.Util.Ensure.ensureString(h,"Type info mapping can only be resolved if module name is provided.");
g=h+f
}else{g=f
}if(!this.typeInfos[g]){throw new Error("Type info ["+g+"] is not known in this context.")
}else{return this.typeInfos[g]
}}else{Jsonix.Util.Ensure.ensureObject(j,"Type info mapping can only be resolved if module is provided.");
var i=j.createTypeInfo(f);
i.build(this,j);
return i
}}}},registerElementInfo:function(k,m){Jsonix.Util.Ensure.ensureObject(k);
this.elementInfos.push(k);
if(Jsonix.Util.Type.exists(k.substitutionHead)){var n=k.substitutionHead;
var l=n.key;
var h=this.substitutionMembersMap[l];
if(!Jsonix.Util.Type.isArray(h)){h=[];
this.substitutionMembersMap[l]=h
}h.push(k)
}var i;
if(Jsonix.Util.Type.exists(k.scope)){i=this.resolveTypeInfo(k.scope,m).name
}else{i="##global"
}var j=this.scopedElementInfosMap[i];
if(!Jsonix.Util.Type.isObject(j)){j={};
this.scopedElementInfosMap[i]=j
}j[k.elementName.key]=k
},getTypeInfoByValue:function(f){if(!Jsonix.Util.Type.exists(f)){return undefined
}if(Jsonix.Util.Type.isObject(f)){var d=f.TYPE_NAME;
if(Jsonix.Util.Type.isString(d)){var e=this.getTypeInfoByName(d);
if(e){return e
}}}return undefined
},getTypeInfoByName:function(b){return this.typeInfos[b]
},getTypeInfoByTypeName:function(c){var d=Jsonix.XML.QName.fromObjectOrString(c,this);
return this.typeNameKeyToTypeInfo[d.key]
},getTypeInfoByTypeNameKey:function(b){return this.typeNameKeyToTypeInfo[b]
},getElementInfo:function(o,m){if(Jsonix.Util.Type.exists(m)){var j=m.name;
var k=this.scopedElementInfosMap[j];
if(Jsonix.Util.Type.exists(k)){var n=k[o.key];
if(Jsonix.Util.Type.exists(n)){return n
}}}var l="##global";
var q=this.scopedElementInfosMap[l];
if(Jsonix.Util.Type.exists(q)){var i=q[o.key];
if(Jsonix.Util.Type.exists(i)){return i
}}return null
},getSubstitutionMembers:function(b){return this.substitutionMembersMap[Jsonix.XML.QName.fromObject(b).key]
},createMarshaller:function(){return new this.mappingStyle.marshaller(this)
},createUnmarshaller:function(){return new this.mappingStyle.unmarshaller(this)
},getNamespaceURI:function(b){Jsonix.Util.Ensure.ensureString(b);
return this.prefixNamespaces[b]
},getPrefix:function(e,d){Jsonix.Util.Ensure.ensureString(e);
var f=this.namespacePrefixes[e];
if(Jsonix.Util.Type.isString(f)){return f
}else{return d
}},builtinTypeInfos:[Jsonix.Schema.XSD.AnyType.INSTANCE,Jsonix.Schema.XSD.AnyURI.INSTANCE,Jsonix.Schema.XSD.Base64Binary.INSTANCE,Jsonix.Schema.XSD.Boolean.INSTANCE,Jsonix.Schema.XSD.Byte.INSTANCE,Jsonix.Schema.XSD.Calendar.INSTANCE,Jsonix.Schema.XSD.Date.INSTANCE,Jsonix.Schema.XSD.DateTime.INSTANCE,Jsonix.Schema.XSD.Decimal.INSTANCE,Jsonix.Schema.XSD.Double.INSTANCE,Jsonix.Schema.XSD.Duration.INSTANCE,Jsonix.Schema.XSD.Float.INSTANCE,Jsonix.Schema.XSD.GDay.INSTANCE,Jsonix.Schema.XSD.GMonth.INSTANCE,Jsonix.Schema.XSD.GMonthDay.INSTANCE,Jsonix.Schema.XSD.GYear.INSTANCE,Jsonix.Schema.XSD.GYearMonth.INSTANCE,Jsonix.Schema.XSD.HexBinary.INSTANCE,Jsonix.Schema.XSD.ID.INSTANCE,Jsonix.Schema.XSD.IDREF.INSTANCE,Jsonix.Schema.XSD.IDREFS.INSTANCE,Jsonix.Schema.XSD.Int.INSTANCE,Jsonix.Schema.XSD.Integer.INSTANCE,Jsonix.Schema.XSD.Language.INSTANCE,Jsonix.Schema.XSD.Long.INSTANCE,Jsonix.Schema.XSD.Name.INSTANCE,Jsonix.Schema.XSD.NCName.INSTANCE,Jsonix.Schema.XSD.NegativeInteger.INSTANCE,Jsonix.Schema.XSD.NMToken.INSTANCE,Jsonix.Schema.XSD.NMTokens.INSTANCE,Jsonix.Schema.XSD.NonNegativeInteger.INSTANCE,Jsonix.Schema.XSD.NonPositiveInteger.INSTANCE,Jsonix.Schema.XSD.NormalizedString.INSTANCE,Jsonix.Schema.XSD.Number.INSTANCE,Jsonix.Schema.XSD.PositiveInteger.INSTANCE,Jsonix.Schema.XSD.QName.INSTANCE,Jsonix.Schema.XSD.Short.INSTANCE,Jsonix.Schema.XSD.String.INSTANCE,Jsonix.Schema.XSD.Strings.INSTANCE,Jsonix.Schema.XSD.Time.INSTANCE,Jsonix.Schema.XSD.Token.INSTANCE,Jsonix.Schema.XSD.UnsignedByte.INSTANCE,Jsonix.Schema.XSD.UnsignedInt.INSTANCE,Jsonix.Schema.XSD.UnsignedLong.INSTANCE,Jsonix.Schema.XSD.UnsignedShort.INSTANCE],CLASS_NAME:"Jsonix.Context"});
// Complete Jsonix script is included above
return { Jsonix: Jsonix };
};
// If the require function exists ...
if (typeof require === 'function') {
// ... but the define function does not exists
if (typeof define !== 'function') {
// Load the define function via amdefine
var define = require('amdefine')(module);
// If we're not in browser
if (typeof window === 'undefined')
{
// Require xmldom, xmlhttprequest and fs
define(["xmldom", "xmlhttprequest", "fs"], _jsonix_factory);
}
else
{
// We're probably in browser, maybe browserify
// Do not require xmldom, xmlhttprequest as they'r provided by the browser
// Do not require fs since file system is not available anyway
define([], _jsonix_factory);
}
}
else {
// Otherwise assume we're in the browser/RequireJS environment
// Load the module without xmldom and xmlhttprequests dependencies
define([], _jsonix_factory);
}
}
// If the require function does not exists, we're not in Node.js and therefore in browser environment
else
{
// Just call the factory and set Jsonix as global.
var Jsonix = _jsonix_factory().Jsonix;
}