lib/packages/parsers.js
function(schema, raw_tag, exclude_name) {

		var tags = Lava.parsers.Common.asBlockType(raw_tag.content, 'tag'),
			i = 0,
			count = tags.length,
			result = {},
			descriptor,
			name;

		for (; i < count; i++) {

			descriptor = schema.properties[tags[i].name];
			if (Lava.schema.DEBUG && !descriptor) Lava.t("Unknown tag in object: " + tags[i].name);
			if (Lava.schema.DEBUG && (tags[i].name in result)) Lava.t('[Storage] duplicate item in object: ' + tags[i].name);
			result[tags[i].name] = this[this._object_property_handlers[descriptor.type]](descriptor, tags[i]);

		}

		for (name in raw_tag.attributes) {

			if (exclude_name && name == 'name') continue;
			descriptor = schema.properties[name];
			if (Lava.schema.DEBUG && (!descriptor || !descriptor.is_attribute)) Lava.t("Unknown attribute in object: " + name);
			if (Lava.schema.DEBUG && (name in result)) Lava.t('[Storage] duplicate item (attribute) in object: ' + name);
			result[name] = this[this._object_attributes_handlers[descriptor.type]](descriptor, raw_tag.attributes[name]);

		}

		return result;

	}
function(schema, raw_tag, exclude_name) {

		var tags = Lava.parsers.Common.asBlockType(raw_tag.content, 'tag'),
			i = 0,
			count = tags.length,
			result = {},
			descriptor,
			name;

		for (; i < count; i++) {

			descriptor = schema.properties[tags[i].name];
			if (Lava.schema.DEBUG && !descriptor) Lava.t("Unknown tag in object: " + tags[i].name);
			if (Lava.schema.DEBUG && (tags[i].name in result)) Lava.t('[Storage] duplicate item in object: ' + tags[i].name);
			result[tags[i].name] = this[this._object_property_handlers[descriptor.type]](descriptor, tags[i]);

		}

		for (name in raw_tag.attributes) {

			if (exclude_name && name == 'name') continue;
			descriptor = schema.properties[name];
			if (Lava.schema.DEBUG && (!descriptor || !descriptor.is_attribute)) Lava.t("Unknown attribute in object: " + name);
			if (Lava.schema.DEBUG && (name in result)) Lava.t('[Storage] duplicate item (attribute) in object: ' + name);
			result[name] = this[this._object_attributes_handlers[descriptor.type]](descriptor, raw_tag.attributes[name]);

		}

		return result;

	}
function ( schema , raw_tag , exclude_name ) { var tags = Lava . parsers . Common . asBlockType ( raw_tag . content , 'tag' ) , i = 0 , count = tags . length , result = { } , descriptor , name ; for ( ; i < count ; i ++ ) { descriptor = schema . properties [ tags [ i ] . name ] ; if ( Lava . schema . DEBUG && ! descriptor ) Lava . t ( "Unknown tag in object: " + tags [ i ] . name ) ; if ( Lava . schema . DEBUG && ( tags [ i ] . name in result ) ) Lava . t ( '[Storage] duplicate item in object: ' + tags [ i ] . name ) ; result [ tags [ i ] . name ] = this [ this . _object_property_handlers [ descriptor . type ] ] ( descriptor , tags [ i ] ) ; } for ( name in raw_tag . attributes ) { if ( exclude_name && name == 'name' ) continue ; descriptor = schema . properties [ name ] ; if ( Lava . schema . DEBUG && ( ! descriptor || ! descriptor . is_attribute ) ) Lava . t ( "Unknown attribute in object: " + name ) ; if ( Lava . schema . DEBUG && ( name in result ) ) Lava . t ( '[Storage] duplicate item (attribute) in object: ' + name ) ; result [ name ] = this [ this . _object_attributes_handlers [ descriptor . type ] ] ( descriptor , raw_tag . attributes [ name ] ) ; } return result ; }
Convert `raw_rag` into object with given `schema`
@param {_cStorageItemSchema} schema
@param {_cRawTag} raw_tag
@param {boolean} exclude_name
@returns {Object}
Convert raw_rag into object with given schema