Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.ObjectMapper.configure()


public class LoadAllCards
{
  public static void main(String[] args) throws JsonParseException, JsonMappingException, IOException
  {
    ObjectMapper mapper = new ObjectMapper();
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

    @SuppressWarnings("unchecked")
    List<MTGCard> allCards = getAllCards((Map<String, MTGSet>)mapper.readValue(new File("AllSets.json"), new TypeReference<Map<String, MTGSet>>()  {}));
   
    System.out.println("Number of cards: " + allCards.size());
View Full Code Here


    final Map<Integer, FoodmartQuery> queries =
        new LinkedHashMap<Integer, FoodmartQuery>();

    private FoodMartQuerySet() throws IOException {
      final ObjectMapper mapper = new ObjectMapper();
      mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
      mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);

      final InputStream inputStream = new FoodMartQuery().getQueries();
      FoodmartRoot root = mapper.readValue(inputStream, FoodmartRoot.class);
      for (FoodmartQuery query : root.queries) {
View Full Code Here

        new LinkedHashMap<Integer, FoodmartQuery>();

    private FoodMartQuerySet() throws IOException {
      final ObjectMapper mapper = new ObjectMapper();
      mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
      mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);

      final InputStream inputStream = new FoodMartQuery().getQueries();
      FoodmartRoot root = mapper.readValue(inputStream, FoodmartRoot.class);
      for (FoodmartQuery query : root.queries) {
        queries.put(query.id, query);
View Full Code Here

* Unit test for data models.
*/
public class ModelTest {
  private ObjectMapper mapper() {
    final ObjectMapper mapper = new ObjectMapper();
    mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
    mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
    return mapper;
  }

  /** Reads a simple schema from a string into objects. */
 
View Full Code Here

*/
public class ModelTest {
  private ObjectMapper mapper() {
    final ObjectMapper mapper = new ObjectMapper();
    mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
    mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
    return mapper;
  }

  /** Reads a simple schema from a string into objects. */
  @Test public void testRead() throws IOException {
View Full Code Here

  }

  public RelNode read(String s) throws IOException {
    lastRel = null;
    final ObjectMapper mapper = new ObjectMapper();
    mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
    mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
    Map<String, Object> o = mapper.readValue(s, TYPE_REF);
    readRels((List<Map<String, Object>>) o.get("rels"));
    System.out.println(lastRel);
    return lastRel;
View Full Code Here

  public RelNode read(String s) throws IOException {
    lastRel = null;
    final ObjectMapper mapper = new ObjectMapper();
    mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
    mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
    Map<String, Object> o = mapper.readValue(s, TYPE_REF);
    readRels((List<Map<String, Object>>) o.get("rels"));
    System.out.println(lastRel);
    return lastRel;
  }
View Full Code Here

    final Map<Integer, FoodmartQuery> queries =
        new LinkedHashMap<Integer, FoodmartQuery>();

    private FoodMartQuerySet() throws IOException {
      final ObjectMapper mapper = new ObjectMapper();
      mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
      mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);

      final InputStream inputStream = new FoodMartQuery().getQueries();
      FoodmartRoot root = mapper.readValue(inputStream, FoodmartRoot.class);
      for (FoodmartQuery query : root.queries) {
View Full Code Here

        new LinkedHashMap<Integer, FoodmartQuery>();

    private FoodMartQuerySet() throws IOException {
      final ObjectMapper mapper = new ObjectMapper();
      mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
      mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);

      final InputStream inputStream = new FoodMartQuery().getQueries();
      FoodmartRoot root = mapper.readValue(inputStream, FoodmartRoot.class);
      for (FoodmartQuery query : root.queries) {
        queries.put(query.id, query);
View Full Code Here

  }

  public RelNode read(String s) throws IOException {
    lastRel = null;
    final ObjectMapper mapper = new ObjectMapper();
    mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
    mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
    Map<String, Object> o = mapper.readValue(s, TYPE_REF);
    readRels((List<Map<String, Object>>) o.get("rels"));
    System.out.println(lastRel);
    return lastRel;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.