class TmxMapParser {

    public static TiledMap parse (File tmxFile) throws TiledParserException {
        Objects.requireNonNull(tmxFile);

        if (!tmxFile.exists()) {
            throw new TiledParserException("tmx map file doesn't exists: " + tmxFile.getAbsolutePath());
        }

        Document doc = null;

        try {
            doc = getDoc(tmxFile);
        } catch (DocumentException e) {
            Log.e(LOG_TAG, "");
            throw new IllegalStateException("Cannot parse tmx file: " + tmxFile.getAbsolutePath());
        }

        //first get root element
        Element rootElement = doc.getRootElement();

        //get tmx format version
        String tmxFormatVersion = rootElement.attributeValue("version");

        if (!isSupportedVersion(tmxFormatVersion)) {
            throw new TiledParserException("Unknown tmx format version '" + tmxFormatVersion + "': " + tmxFile.getAbsolutePath());
        }

        String tmxDir = tmxFile.getParentFile().getAbsolutePath().replace("\\", "/") + "/";

        return TmxParser.parse(doc, rootElement, tmxDir);
    }

    protected  TmxMapParser();

}