@@ -297,7 +297,6 @@ Jsonix.Request = Jsonix
297297 transport . onreadystatechange = function ( ) {
298298 that . handleTransport ( transport , onSuccess , onFailure ) ;
299299 } ;
300- console . log ( 'Sending.' ) ;
301300 transport . send ( data ) ;
302301 }
303302 }
@@ -1872,7 +1871,7 @@ Jsonix.Binding.ElementUnmarshaller = Jsonix.Class({
18721871 if ( input . eventType != 1 ) {
18731872 throw new Error ( "Parser must be on START_ELEMENT to read next element." ) ;
18741873 }
1875- var typeInfo = this . getInputTypeInfo ( context , input , scope ) ;
1874+ var typeInfo = this . getTypeInfoByInputElement ( context , input , scope ) ;
18761875 var name = input . getName ( ) ;
18771876 var elementValue ;
18781877 if ( this . allowTypedObject && Jsonix . Util . Type . exists ( typeInfo ) ) {
@@ -1889,21 +1888,26 @@ Jsonix.Binding.ElementUnmarshaller = Jsonix.Class({
18891888 }
18901889 callback ( elementValue ) ;
18911890 } ,
1892- getInputTypeInfo : function ( context , input , scope )
1893- {
1894- // Issue #70 work in progress here
1891+ getTypeInfoByInputElement : function ( context , input , scope ) {
18951892 var xsiTypeInfo = null ;
18961893 if ( context . supportXsiType ) {
18971894 var xsiType = input . getAttributeValueNS ( Jsonix . Schema . XSI . NAMESPACE_URI , Jsonix . Schema . XSI . TYPE ) ;
1898- if ( Jsonix . Util . StringUtils . isNotBlank ( xsiType ) )
1899- {
1895+ if ( Jsonix . Util . StringUtils . isNotBlank ( xsiType ) ) {
19001896 var xsiTypeName = Jsonix . Schema . XSD . QName . INSTANCE . parse ( xsiType , context , input , scope ) ;
19011897 xsiTypeInfo = context . getTypeInfoByTypeNameKey ( xsiTypeName . key ) ;
19021898 }
19031899 }
19041900 var name = input . getName ( ) ;
19051901 var typeInfo = xsiTypeInfo ? xsiTypeInfo : this . getTypeInfoByElementName ( name , context , scope ) ;
19061902 return typeInfo ;
1903+ } ,
1904+ getTypeInfoByElementName : function ( name , context , scope ) {
1905+ var elementInfo = context . getElementInfo ( name , scope ) ;
1906+ if ( Jsonix . Util . Type . exists ( elementInfo ) ) {
1907+ return elementInfo . typeInfo ;
1908+ } else {
1909+ return undefined ;
1910+ }
19071911 }
19081912} ) ;
19091913
@@ -2000,14 +2004,6 @@ Jsonix.Binding.Unmarshaller = Jsonix.Class(Jsonix.Binding.ElementUnmarshaller, {
20002004 convertToElementValue : function ( elementValue , context , input , scope ) {
20012005 return elementValue ;
20022006 } ,
2003- getTypeInfoByElementName : function ( name , context , scope ) {
2004- var elementInfo = context . getElementInfo ( name , scope ) ;
2005- if ( Jsonix . Util . Type . exists ( elementInfo ) ) {
2006- return elementInfo . typeInfo ;
2007- } else {
2008- return undefined ;
2009- }
2010- } ,
20112007 CLASS_NAME : 'Jsonix.Binding.Unmarshaller'
20122008} ) ;
20132009Jsonix . Binding . Unmarshaller . Simplified = Jsonix . Class ( Jsonix . Binding . Unmarshaller , Jsonix . Binding . ElementUnmarshaller . Simplified , {
@@ -3019,12 +3015,8 @@ Jsonix.Model.ElementsPropertyInfo = Jsonix.Class(Jsonix.Model.AbstractElementsPr
30193015 var actualTypeInfo = context . getTypeInfoByValue ( value ) ;
30203016 if ( actualTypeInfo && actualTypeInfo . typeName )
30213017 {
3022- console . log ( "Actual type info:" ) ;
3023- console . log ( actualTypeInfo ) ;
30243018 for ( var jndex = 0 ; jndex < this . elementTypeInfos . length ; jndex ++ ) {
30253019 var eti = this . elementTypeInfos [ jndex ] ;
3026- console . log ( "Checking element type info:" ) ;
3027- console . log ( eti ) ;
30283020 var ti = eti . typeInfo ;
30293021 // TODO Can be optimized
30303022 // Find an element type info which has a type info that is a supertype of the actual type info
@@ -3132,7 +3124,7 @@ Jsonix.Model.ElementMapPropertyInfo = Jsonix.Class(Jsonix.Model.AbstractElements
31323124 }
31333125 return result ;
31343126 } ,
3135- getInputTypeInfo : function ( context , input , scope ) {
3127+ getTypeInfoByInputElement : function ( context , input , scope ) {
31363128 return this . entryTypeInfo ;
31373129 } ,
31383130 convertToElementValue : function ( elementValue , context , input , scope ) {
@@ -3583,14 +3575,6 @@ Jsonix.Model.AnyElementPropertyInfo = Jsonix.Class(Jsonix.Binding.ElementMarshal
35833575 convertToElementValue : function ( elementValue , context , input , scope ) {
35843576 return elementValue ;
35853577 } ,
3586- getTypeInfoByElementName : function ( name , context , scope ) {
3587- var elementInfo = context . getElementInfo ( name , scope ) ;
3588- if ( Jsonix . Util . Type . exists ( elementInfo ) ) {
3589- return elementInfo . typeInfo ;
3590- } else {
3591- return undefined ;
3592- }
3593- } ,
35943578 doBuild : function ( context , module ) {
35953579 // Nothing to do
35963580 } ,
0 commit comments