Jsonix Value Property

by Alexey Valikov

HTML

<script src="https://rawgithub.com/highsource/jsonix/master/dist/Jsonix-all.js"></script>

JavaScript

var One = {
    name: 'One',
    typeInfos: [{
        type: 'classInfo',
        localName: 'ValueType',
        propertyInfos: [{
            name: 'data',
            type: 'value',
            typeInfo: 'String'
        }]
    }],
    elementInfos: [{
        elementName: 'value',
        typeInfo: 'One.ValueType'
    }]
};
var context = new Jsonix.Context([One]);
var unmarshaller = context.createUnmarshaller();
var data = unmarshaller.unmarshalString('<value>Some text.</value>');
console.log(data);