equal
deleted
inserted
replaced
44 |
44 |
45 IriSP.SerializerFactory.prototype.getSerializer = function(metadataOptions) { |
45 IriSP.SerializerFactory.prototype.getSerializer = function(metadataOptions) { |
46 /* This function returns serializer set-up with the correct |
46 /* This function returns serializer set-up with the correct |
47 configuration - takes a metadata struct describing the metadata source |
47 configuration - takes a metadata struct describing the metadata source |
48 */ |
48 */ |
|
49 |
|
50 if (metadataOptions === undefined) |
|
51 /* return an empty serializer */ |
|
52 return IriSP.Serializer("", ""); |
|
53 |
49 switch(metadataOptions.type) { |
54 switch(metadataOptions.type) { |
50 case "json": |
55 case "json": |
51 return new IriSP.JSONSerializer(this._dataloader, metadataOptions.src); |
56 return new IriSP.JSONSerializer(this._dataloader, metadataOptions.src); |
52 break; |
57 break; |
53 |
58 |
54 case "dummy": /* only used for unit testing - not defined in production */ |
59 case "dummy": /* only used for unit testing - not defined in production */ |
55 return new IriSP.MockSerializer(this._dataloader, metadataOptions.src); |
60 return new IriSP.MockSerializer(this._dataloader, metadataOptions.src); |
56 break; |
61 break; |
|
62 |
|
63 case "empty": |
|
64 return new IriSP.Serializer("", "empty"); |
|
65 break; |
57 |
66 |
58 default: |
67 default: |
59 return undefined; |
68 return undefined; |
60 } |
69 } |
61 }; |
70 }; |
62 |
71 |
63 |
72 |