aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/textserialize/serializer/QueryTreeSerializer.java
blob: 93c54d636b52f4e5747f0e67a415aa2710f0e97b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.textserialize.serializer;

import com.yahoo.prelude.query.Item;
import com.yahoo.search.query.textserialize.item.ItemExecutorRegistry;


/**
 * @author Tony Vaagenes
 */
public class QueryTreeSerializer {
    public String serialize(Item root) {
        ItemIdMapper itemIdMapper = new ItemIdMapper();
        return ItemExecutorRegistry.getByType(root.getItemType()).itemToForm(root, itemIdMapper).serialize(itemIdMapper);
    }
}