package com.nedap.archie.adlparser.odin;

import com.fasterxml.jackson.databind.JavaType;
import com.nedap.archie.adlparser.antlr.AdlLexer;
import com.nedap.archie.adlparser.antlr.AdlParser;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.ANTLRInputStream;

import java.io.IOException;

/**
 * Created by pieter.bos on 02/11/15.
 */
public class OdinObjectParser {

    public static <T> T convert(AdlParser.Odin_textContext odin, Class<T> clazz) {
        try {
            return OdinToJsonConverter.getObjectMapper().readValue(new OdinToJsonConverter().convert(odin), clazz);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static <T> T convert(AdlParser.Odin_textContext odin, JavaType clazz) {
        try {

            return OdinToJsonConverter.getObjectMapper().readValue(new OdinToJsonConverter().convert(odin), clazz);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static <T> T convert(String odin, Class<T> clazz) {
        AdlLexer adlLexer = new AdlLexer(new ANTLRInputStream(odin));
        AdlParser parser = new AdlParser(new CommonTokenStream(adlLexer));
        return convert(parser.odin_text(), clazz);
    }
}

@@ -790,17 +790,16 @@
   try %7B%0A
-%0A
         
@@ -992,32 +992,32 @@
        %7D%0A    %7D%0A%0A
-
     public stati
@@ -1264,11 +1264,277 @@
 );%0A    %7D
+%0A%0A    public static %3CT%3E T convert(String odin, JavaType clazz) %7B%0A        AdlLexer adlLexer = new AdlLexer(new ANTLRInputStream(odin));%0A        AdlParser parser = new AdlParser(new CommonTokenStream(adlLexer));%0A        return convert(parser.odin_text(), clazz);%0A    %7D
 %0A%7D%0A

Add missing method in Odin Object parser