Package br.com.objectos.way.ui

Examples of br.com.objectos.way.ui.Context


  @Inject
  private ObjectMapper mapper;

  public void map_test() throws JsonGenerationException, JsonMappingException, IOException {
    Context context = Context.of();
    context.put("name", "abc");
    context.put("number", 123);

    String res = mapper.writeValueAsString(context);

    assertThat(res, equalTo("{\"name\":\"abc\",\"number\":123}"));
  }
View Full Code Here


    assertThat(res, equalTo("{\"name\":\"abc\",\"number\":123}"));
  }

  public void root_test() throws JsonGenerationException, JsonMappingException, IOException {
    Context context = Context.of(new Pojo("abc", 123));

    String res = mapper.writeValueAsString(context);

    assertThat(res, equalTo("{\"name\":\"abc\",\"number\":123}"));
  }
View Full Code Here

    assertThat(res, equalTo("{\"name\":\"abc\",\"number\":123}"));
  }

  public void merge_test() throws JsonGenerationException, JsonMappingException, IOException {
    Context context = Context.of(new Pojo("abc", 123));
    context.put("m", new Pojo("n", 9));

    String res = mapper.writeValueAsString(context);

    assertThat(res,
        equalTo("{\"name\":\"abc\",\"number\":123,\"m\":{\"name\":\"n\",\"number\":9}}"));
View Full Code Here

    if (isValid() && redirect != null) {
      redirectUrl = redirect.getUrl(updated);
    }

    Context context = null;
    FormResponse json = FormJson.of(context, errors, redirectUrl);
    return Reply.with(json).as(Json.class);
  }
View Full Code Here

      } catch (Throwable e) {
        errors.add(Errors.toForm(e));
      }
    }

    Context context = null;
    String redirectUrl = null;

    if (errors.isEmpty()) {
      if (decorator != null) {
        context = Context.of();
View Full Code Here

TOP

Related Classes of br.com.objectos.way.ui.Context

Copyright © 2018 www.massapicom. 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.