Examples of toObject()


Examples of org.mozilla.javascript.Context.toObject()

        // Initialize context and global scope object
        try {
            Context cx = Context.enter();
            global = new ImporterTopLevel(cx);
            Scriptable bsf = cx.toObject(new BSFFunctions(mgr, this), global);
            global.put("bsf", global, bsf);

            int size = declaredBeans.size();
            for (int i = 0; i < size; i++) {
                declareBean((BSFDeclaredBean) declaredBeans.elementAt(i));
View Full Code Here

Examples of org.nustaq.serialization.simpleapi.OnHeapCoder.toObject()

                CarBench.FueldData.class, CarBench.OptionalExtras.class);

        byte arr[] = new byte[1000000];
        int len = coder.toByteArray(original, arr, 0, (int) arr.length);

        Object deser = coder.toObject(arr, 0, (int) arr.length);
        assertTrue(DeepEquals.deepEquals(deser,original));

        onhbench(original, coder, arr, 0);
        onhbench(original, coder, arr, 0);
        onhbench(original, coder, arr, 0);
View Full Code Here

Examples of org.nutz.dao.Chain.toObject()

   * Issue 93
   */
  @Test
  public void test_chain_to_object() {
    Chain c = Chain.from(Lang.map("{name:'zzh',age:30}"));
    Worker w = c.toObject(Worker.class);
    assertEquals("zzh", w.name);
    assertEquals(30, w.age);
  }

}
View Full Code Here

Examples of org.nutz.mongo.entity.MongoEntity.toObject()

      if (null != v) {
        // 如果是 DBObject
        if (v instanceof DBObject) {
          MongoEntity en = Mongos.entity(eleType);
          if (en instanceof StaticMongoEntity) {
            o = en.toObject((DBObject) v);
          } else
            o = Lang.map2Object(((DBObject) v).toMap(), eleType);
        }
        // 否则就强制转换一下
        else {
View Full Code Here

Examples of org.openengsb.core.api.model.BeanDescription.toObject()

    @Test
    public void testWrapAndUnWrapSimpleBean_shouldBeEqualObject() throws Exception {
        SimpleTestBean bean = new SimpleTestBean("42", 42L);
        BeanDescription beanDescription = BeanDescription.fromObject(bean);
        SimpleTestBean bean2 = beanDescription.toObject(SimpleTestBean.class);

        assertThat(bean2.getLongValue(), is(42L));
        assertThat(bean2.getStringValue(), is("42"));
    }
View Full Code Here

Examples of org.restlet.engine.converter.ConverterHelper.toObject()

            if (ch != null) {
                Context.getCurrentLogger().fine(
                        "The following converter was selected for the "
                                + source + " representation: " + ch);

                result = ch.toObject(source, target, resource);

                if (result instanceof Representation) {
                    Representation resultRepresentation = (Representation) result;

                    // Copy the variant metadata
View Full Code Here

Examples of org.restlet.service.ConverterService.toObject()

    public void testRepresentationToObject() throws IOException, JAXBException {
        ConverterService cs = new ConverterService();
        JaxbRepresentation<Sample> sampleRep = new JaxbRepresentation<Sample>(
                MediaType.APPLICATION_XML, new Sample());
        Object rep = cs.toObject(sampleRep, Sample.class, null);
        assertTrue(rep instanceof Sample);
    }
}
View Full Code Here

Examples of us.monoid.web.JSONResource.toObject()

      json.put("redirect_uri", req.getRequestURL().toString());
      json.put("grant_type", "authorization_code");
      json.put("code", authorizationCode);

      JSONResource tokenInfo = resty.json(tokenUri, content(json));
      return new Tokens(tokenInfo.toObject());

    } catch (Exception ex) {
      throw new IllegalStateException("Cannot get Token from Auth0", ex);
    }
  }
View Full Code Here

Examples of voldemort.serialization.Serializer.toObject()

                                                                                                        JsonTypes.STRING,
                                                                                                        "age",
                                                                                                        JsonTypes.INT32)));
        assertEquals("Key order in Map should not matter while serializing/deserializing",
                     data,
                     outOfOrderSerializer.toObject(getSerializer(typeSig).toBytes(data)));

        outOfOrderSerializer = new JsonTypeSerializer(new JsonTypeDefinition(ImmutableMap.of("color",
                                                                                             JsonTypes.STRING,
                                                                                             "age",
                                                                                             JsonTypes.INT32,
View Full Code Here

Examples of voldemort.serialization.Serializer.toObject()

                                                                                             JsonTypes.INT32,
                                                                                             "name",
                                                                                             JsonTypes.STRING)));
        assertEquals("Key order in Map should not matter while serializing/deserializing",
                     data,
                     outOfOrderSerializer.toObject(getSerializer(typeSig).toBytes(data)));

        outOfOrderSerializer = new JsonTypeSerializer(new JsonTypeDefinition(ImmutableMap.of("age",
                                                                                             JsonTypes.INT32,
                                                                                             "name",
                                                                                             JsonTypes.STRING,
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.