@@ -850,7 +850,7 @@ this.unmarshalElement(this.context,f,j,h);
850850return g
851851} , CLASS_NAME :"Jsonix.Binding.Unmarshaller" } ) ;
852852Jsonix . Binding . Unmarshaller . Simplified = Jsonix . Class ( Jsonix . Binding . Unmarshaller , Jsonix . Binding . Unmarshalls . Element . AsSimplifiedElementRef , { CLASS_NAME :"Jsonix.Binding.Unmarshaller.Simplified" } ) ;
853- Jsonix . Model . TypeInfo = Jsonix . Class ( { name :null , baseTypeInfo :null , initialize :function ( ) { } , isBasedOn :function ( c ) { var d = this ;
853+ Jsonix . Model . TypeInfo = Jsonix . Class ( { module : null , name :null , baseTypeInfo :null , initialize :function ( ) { } , isBasedOn :function ( c ) { var d = this ;
854854while ( d ) { if ( c === d ) { return true
855855} d = d . baseTypeInfo
856856} return false
@@ -886,15 +886,15 @@ for(var s=0;
886886s < x . length ;
887887s ++ ) { this . p ( x [ s ] )
888888} } , getPropertyInfoByName :function ( b ) { return this . propertiesMap [ b ]
889- } , destroy :function ( ) { } , build :function ( i , j ) { if ( ! this . built ) { this . baseTypeInfo = i . resolveTypeInfo ( this . baseTypeInfo , j ) ;
890- if ( Jsonix . Util . Type . exists ( this . baseTypeInfo ) ) { this . baseTypeInfo . build ( i , j )
891- } for ( var f = 0 ;
892- f < this . properties . length ;
893- f ++ ) { var h = this . properties [ f ] ;
894- h . build ( i , j )
895- } var g = { elements :null , attributes :{ } , anyAttribute :null , value :null , any :null } ;
896- this . buildStructure ( i , g ) ;
897- this . structure = g
889+ } , destroy :function ( ) { } , build :function ( h ) { if ( ! this . built ) { this . baseTypeInfo = h . resolveTypeInfo ( this . baseTypeInfo , this . module ) ;
890+ if ( Jsonix . Util . Type . exists ( this . baseTypeInfo ) ) { this . baseTypeInfo . build ( h )
891+ } for ( var e = 0 ;
892+ e < this . properties . length ;
893+ e ++ ) { var g = this . properties [ e ] ;
894+ g . build ( h , this . module )
895+ } var f = { elements :null , attributes :{ } , anyAttribute :null , value :null , any :null } ;
896+ this . buildStructure ( h , f ) ;
897+ this . structure = f
898898} } , buildStructure :function ( h , f ) { if ( Jsonix . Util . Type . exists ( this . baseTypeInfo ) ) { this . baseTypeInfo . buildStructure ( h , f )
899899} for ( var e = 0 ;
900900e < this . properties . length ;
@@ -995,39 +995,39 @@ var h=f.values||f.vs||undefined;
995995Jsonix . Util . Ensure . ensureExists ( h ) ;
996996if ( ! ( Jsonix . Util . Type . isObject ( h ) || Jsonix . Util . Type . isArray ( h ) ) ) { throw new Error ( "Enum values must be either an array or an object." )
997997} else { this . entries = h
998- } } , build :function ( r , q ) { if ( ! this . built ) { this . baseTypeInfo = r . resolveTypeInfo ( this . baseTypeInfo , q ) ;
999- this . baseTypeInfo . build ( r , q ) ;
1000- var n = this . entries ;
1001- var p = { } ;
1002- var j = [ ] ;
1003- var k = [ ] ;
998+ } } , build :function ( m ) { if ( ! this . built ) { this . baseTypeInfo = m . resolveTypeInfo ( this . baseTypeInfo , this . module ) ;
999+ this . baseTypeInfo . build ( m ) ;
1000+ var p = this . entries ;
1001+ var j = { } ;
1002+ var l = [ ] ;
1003+ var i = [ ] ;
10041004var o = 0 ;
1005- var l ;
1006- var m ;
1007- if ( Jsonix . Util . Type . isArray ( n ) ) { for ( o = 0 ;
1008- o < n . length ;
1009- o ++ ) { m = n [ o ] ;
1010- if ( Jsonix . Util . Type . isString ( m ) ) { l = m ;
1005+ var n ;
1006+ var k ;
1007+ if ( Jsonix . Util . Type . isArray ( p ) ) { for ( o = 0 ;
1008+ o < p . length ;
1009+ o ++ ) { k = p [ o ] ;
1010+ if ( Jsonix . Util . Type . isString ( k ) ) { n = k ;
10111011if ( ! ( Jsonix . Util . Type . isFunction ( this . baseTypeInfo . parse ) ) ) { throw 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." )
1012- } m = this . baseTypeInfo . parse ( m , r , null , this )
1013- } else { if ( this . baseTypeInfo . isInstance ( m , r , this ) ) { if ( ! ( Jsonix . Util . Type . isFunction ( this . baseTypeInfo . print ) ) ) { throw 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." )
1014- } l = this . baseTypeInfo . print ( m , r , null , this )
1015- } else { throw new Error ( "Enum value [" + m + "] is not an instance of the enum base type [" + this . baseTypeInfo . name + "]." )
1016- } } p [ l ] = m ;
1017- j [ o ] = l ;
1018- k [ o ] = m
1019- } } else { if ( Jsonix . Util . Type . isObject ( n ) ) { for ( l in n ) { if ( n . hasOwnProperty ( l ) ) { m = n [ l ] ;
1020- if ( Jsonix . Util . Type . isString ( m ) ) { if ( ! ( Jsonix . Util . Type . isFunction ( this . baseTypeInfo . parse ) ) ) { throw 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." )
1021- } m = this . baseTypeInfo . parse ( m , r , null , this )
1022- } else { if ( ! this . baseTypeInfo . isInstance ( m , r , this ) ) { throw new Error ( "Enum value [" + m + "] is not an instance of the enum base type [" + this . baseTypeInfo . name + "]." )
1023- } } p [ l ] = m ;
1024- j [ o ] = l ;
1025- k [ o ] = m ;
1012+ } k = this . baseTypeInfo . parse ( k , m , null , this )
1013+ } else { if ( this . baseTypeInfo . isInstance ( k , m , this ) ) { if ( ! ( Jsonix . Util . Type . isFunction ( this . baseTypeInfo . print ) ) ) { throw 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." )
1014+ } n = this . baseTypeInfo . print ( k , m , null , this )
1015+ } else { throw new Error ( "Enum value [" + k + "] is not an instance of the enum base type [" + this . baseTypeInfo . name + "]." )
1016+ } } j [ n ] = k ;
1017+ l [ o ] = n ;
1018+ i [ o ] = k
1019+ } } else { if ( Jsonix . Util . Type . isObject ( p ) ) { for ( n in p ) { if ( p . hasOwnProperty ( n ) ) { k = p [ n ] ;
1020+ if ( Jsonix . Util . Type . isString ( k ) ) { if ( ! ( Jsonix . Util . Type . isFunction ( this . baseTypeInfo . parse ) ) ) { throw 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." )
1021+ } k = this . baseTypeInfo . parse ( k , m , null , this )
1022+ } else { if ( ! this . baseTypeInfo . isInstance ( k , m , this ) ) { throw new Error ( "Enum value [" + k + "] is not an instance of the enum base type [" + this . baseTypeInfo . name + "]." )
1023+ } } j [ n ] = k ;
1024+ l [ o ] = n ;
1025+ i [ o ] = k ;
10261026o ++
10271027} } } else { throw new Error ( "Enum values must be either an array or an object." )
1028- } } this . entries = p ;
1029- this . keys = j ;
1030- this . values = k ;
1028+ } } this . entries = j ;
1029+ this . keys = l ;
1030+ this . values = i ;
10311031this . built = true
10321032} } , unmarshal :function ( e , f , h ) { var g = f . getElementText ( ) ;
10331033return this . parse ( g , e , f , h )
@@ -1046,7 +1046,7 @@ f<this.values.length;
10461046f ++ ) { if ( this . values [ f ] === g ) { return true
10471047} } return false
10481048} , CLASS_NAME :"Jsonix.Model.EnumLeafInfo" } ) ;
1049- Jsonix . Model . ElementInfo = Jsonix . Class ( { elementName :null , typeInfo :null , substitutionHead :null , scope :null , built :false , initialize :function ( g ) { Jsonix . Util . Ensure . ensureObject ( g ) ;
1049+ Jsonix . Model . ElementInfo = Jsonix . Class ( { module : null , elementName :null , typeInfo :null , substitutionHead :null , scope :null , built :false , initialize :function ( g ) { Jsonix . Util . Ensure . ensureObject ( g ) ;
10501050var j = g . defaultElementNamespaceURI || g . dens || "" ;
10511051this . defaultElementNamespaceURI = j ;
10521052var h = g . elementName || g . en || undefined ;
@@ -1059,8 +1059,8 @@ var l=g.substitutionHead||g.sh||null;
10591059this . substitutionHead = l ;
10601060var i = g . scope || g . sc || null ;
10611061this . scope = i
1062- } , build :function ( c , d ) { if ( ! this . built ) { this . typeInfo = c . resolveTypeInfo ( this . typeInfo , d ) ;
1063- this . scope = c . resolveTypeInfo ( this . scope , d ) ;
1062+ } , build :function ( b ) { if ( ! this . built ) { this . typeInfo = b . resolveTypeInfo ( this . typeInfo , this . module ) ;
1063+ this . scope = b . resolveTypeInfo ( this . scope , this . module ) ;
10641064this . built = true
10651065} } , CLASS_NAME :"Jsonix.Model.ElementInfo" } ) ;
10661066Jsonix . Model . PropertyInfo = Jsonix . Class ( { name :null , collection :false , targetNamespace :"" , defaultElementNamespaceURI :"" , defaultAttributeNamespaceURI :"" , built :false , initialize :function ( r ) { Jsonix . Util . Ensure . ensureObject ( r ) ;
@@ -1507,19 +1507,23 @@ var h=f.defaultAttributeNamespaceURI||f.dans||this.defaultAttributeNamespaceURI;
15071507f . defaultAttributeNamespaceURI = h ;
15081508this . initializeNames ( f ) ;
15091509var i = new this . mappingStyle . classInfo ( f , { mappingStyle :this . mappingStyle } ) ;
1510+ i . module = this ;
15101511return i
15111512} , createEnumLeafInfo :function ( d ) { Jsonix . Util . Ensure . ensureObject ( d ) ;
15121513this . initializeNames ( d ) ;
15131514var c = new this . mappingStyle . enumLeafInfo ( d , { mappingStyle :this . mappingStyle } ) ;
1515+ c . module = this ;
15141516return c
1515- } , createList :function ( e ) { Jsonix . Util . Ensure . ensureObject ( e ) ;
1516- var g = e . baseTypeInfo || e . typeInfo || e . bti || e . ti || "String" ;
1517- var f = e . typeName || e . tn || null ;
1518- if ( Jsonix . Util . Type . exists ( f ) ) { if ( Jsonix . Util . Type . isString ( f ) ) { f = new Jsonix . XML . QName ( this . targetNamespace , f )
1519- } else { f = Jsonix . XML . QName . fromObject ( f )
1520- } } var h = e . separator || e . sep || " " ;
1521- Jsonix . Util . Ensure . ensureExists ( g ) ;
1522- return new Jsonix . Schema . XSD . List ( g , f , h )
1517+ } , createList :function ( f ) { Jsonix . Util . Ensure . ensureObject ( f ) ;
1518+ var h = f . baseTypeInfo || f . typeInfo || f . bti || f . ti || "String" ;
1519+ var g = f . typeName || f . tn || null ;
1520+ if ( Jsonix . Util . Type . exists ( g ) ) { if ( Jsonix . Util . Type . isString ( g ) ) { g = new Jsonix . XML . QName ( this . targetNamespace , g )
1521+ } else { g = Jsonix . XML . QName . fromObject ( g )
1522+ } } var i = f . separator || f . sep || " " ;
1523+ Jsonix . Util . Ensure . ensureExists ( h ) ;
1524+ var j = new Jsonix . Schema . XSD . List ( h , g , i ) ;
1525+ j . module = this ;
1526+ return j
15231527} , createElementInfo :function ( g ) { Jsonix . Util . Ensure . ensureObject ( g ) ;
15241528g = Jsonix . Util . Type . cloneObject ( g ) ;
15251529var i = g . defaultElementNamespaceURI || g . dens || this . defaultElementNamespaceURI ;
@@ -1537,6 +1541,7 @@ if(Jsonix.Util.Type.exists(l)){if(Jsonix.Util.Type.isObject(l)){g.substitutionHe
15371541} else { Jsonix . Util . Ensure . ensureString ( l ) ;
15381542g . substitutionHead = new Jsonix . XML . QName ( this . defaultElementNamespaceURI , l )
15391543} } var k = new this . mappingStyle . elementInfo ( g , { mappingStyle :this . mappingStyle } ) ;
1544+ k . module = this ;
15401545return k
15411546} , registerTypeInfos :function ( d ) { for ( var e = 0 ;
15421547e < this . typeInfos . length ;
@@ -1594,7 +1599,7 @@ if(!Jsonix.Util.Type.exists(this.name)){this.name=e.name+"*"
15941599} var g = Jsonix . Util . StringUtils . trim ( this . separator ) ;
15951600if ( g . length === 0 ) { this . trimmedSeparator = Jsonix . Util . StringUtils . whitespaceCharacters
15961601} else { this . trimmedSeparator = g
1597- } } , build :function ( c , d ) { if ( ! this . built ) { this . typeInfo = c . resolveTypeInfo ( this . typeInfo , d ) ;
1602+ } } , build :function ( b ) { if ( ! this . built ) { this . typeInfo = b . resolveTypeInfo ( this . typeInfo , this . module ) ;
15981603this . built = true
15991604} } , print :function ( i , k , g , j ) { if ( ! Jsonix . Util . Type . exists ( i ) ) { return null
16001605} Jsonix . Util . Ensure . ensureArray ( i ) ;
@@ -2136,13 +2141,13 @@ if(e){throw new Error("At least one of the components (years, months, days, hour
21362141var g = "" ;
21372142if ( h . sign === - 1 ) { g += "-"
21382143} g += "P" ;
2139- if ( h . years ) { g += ( h . years + "Y" )
2140- } if ( h . months ) { g += ( h . months + "M" )
2141- } if ( h . days ) { g += ( h . days + "D" )
2142- } if ( h . hours || h . minutes || h . seconds ) { g += "T" ;
2143- if ( h . hours ) { g += ( h . hours + "H" )
2144- } if ( h . minutes ) { g += ( h . minutes + "M" )
2145- } if ( h . seconds ) { g += ( h . seconds + "S" )
2144+ if ( Jsonix . Util . Type . exists ( h . years ) ) { g += ( h . years + "Y" )
2145+ } if ( Jsonix . Util . Type . exists ( h . months ) ) { g += ( h . months + "M" )
2146+ } if ( Jsonix . Util . Type . exists ( h . days ) ) { g += ( h . days + "D" )
2147+ } if ( Jsonix . Util . Type . exists ( h . hours ) || Jsonix . Util . Type . exists ( h . minutes ) || Jsonix . Util . Type . exists ( h . seconds ) ) { g += "T" ;
2148+ if ( Jsonix . Util . Type . exists ( h . hours ) ) { g += ( h . hours + "H" )
2149+ } if ( Jsonix . Util . Type . exists ( h . minutes ) ) { g += ( h . minutes + "M" )
2150+ } if ( Jsonix . Util . Type . exists ( h . seconds ) ) { g += ( h . seconds + "S" )
21462151} } return g
21472152} , parse :function ( m , p , j , o ) { var k = new RegExp ( "^" + Jsonix . Schema . XSD . Duration . PATTERN + "$" ) ;
21482153var i = m . match ( k ) ;
0 commit comments