public static <T> T createFromJsonMapResource(Class<T> type, String resource) { Map<String,Object> config = null; JsonParserAndMapper laxParser = new JsonParserFactory().createLaxParser(); if (resource.endsWith( ".json" )) { config = laxParser.parseMap( IO.read(resource) ); } else if (resource.endsWith( "/" )) { config = new LinkedHashMap<>( ); handleDir( config, laxParser, resource ); } return Creator.create( type, config ); }
public static <T> T createFromJsonMapResource(Class<T> type, String resource) { Map<String,Object> config = null; JsonParserAndMapper laxParser = new JsonParserFactory().createLaxParser(); if (resource.endsWith( ".json" )) { config = laxParser.parseMap( IO.read(resource) ); } else if (resource.endsWith( "/" )) { config = new LinkedHashMap<>( ); handleDir( config, laxParser, resource ); } return Creator.create( type, config ); }
public static <T> T createFromJsonMapResource(Class<T> type, String resource) { Map<String,Object> config = null; JsonParserAndMapper laxParser = new JsonParserFactory().createLaxParser(); if (resource.endsWith( ".json" )) { config = laxParser.parseMap( IO.read(resource) ); } else if (resource.endsWith( "/" )) { config = new LinkedHashMap<>( ); handleDir( config, laxParser, resource ); } return Creator.create( type, config ); }
public static <T> T createFromJsonMap(Class<T> type, String str) { Map<String,Object> config = new JsonParserFactory().createLaxParser().parseMap( str ); return Creator.create( type, config ); }
public static <T> T createFromJsonMap(Class<T> type, String str) { Map<String,Object> config = new JsonParserFactory().createLaxParser().parseMap( str ); return Creator.create( type, config ); }
public static <T> T createFromJsonMap(Class<T> type, String str) { Map<String,Object> config = new JsonParserFactory().createLaxParser().parseMap( str ); return Creator.create( type, config ); }
public JsonParserAndMapper parser () { return new JsonParserFactory().setLazyChop( true ).createLaxParser(); }