/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.csu.sdmx.validation.model.data;

import org.w3c.dom.Document;

/**
 *
 * @author themi
 */
public class DataFactory {
    
    public static SDMXData get(Document doc){
        String type = doc.getDocumentElement().getNodeName();
            
        if(type.equals(SDMXData.COMPACT))
            return new CompactData(doc);
        if(type.equals(SDMXData.CROSS))
            return new CrossData(doc);
        if(type.equals(SDMXData.UTILITY))
            return new UtilityData(doc);
       
        return null;
    }
}
