Examples of unmarshall()


Examples of org.jongo.marshall.Unmarshaller.unmarshall()

        party.with(new Friend("Robert"));
        collection.save(party);

        Friend friend = collection.findOne("{friends.name:'Peter'}").projection("{friends.$:1}").map(new ResultHandler<Friend>() {
            public Friend map(DBObject dbo) {
                Party result = unmarshaller.unmarshall((BsonDocument) dbo, Party.class);
                return result.friends.get(0);
            }
        });

        assertThat(friend.getName()).isEqualTo("Peter");
View Full Code Here

Examples of org.kie.api.marshalling.Marshaller.unmarshall()

                // now unmarshall that byte[]
                ByteArrayInputStream bais = new ByteArrayInputStream( rsession.bytes );
                Marshaller marshaller = MarshallerFactory.newMarshaller(new KnowledgeBaseImpl(this), new ObjectMarshallingStrategy[]{MarshallerFactory.newSerializeMarshallingStrategy()});

                Environment environment = EnvironmentFactory.newEnvironment();
                KieSession ksession = marshaller.unmarshall( bais,
                                                             conf,
                                                             environment );
                session = (StatefulSession) ((StatefulKnowledgeSessionImpl) ksession).session;

                if ( keepReference ) {
View Full Code Here

Examples of org.kie.marshalling.Marshaller.unmarshall()

                // now unmarshall that byte[]
                ByteArrayInputStream bais = new ByteArrayInputStream( rsession.bytes );
                Marshaller marshaller = MarshallerFactory.newMarshaller( new KnowledgeBaseImpl( this )new ObjectMarshallingStrategy[] { MarshallerFactory.newSerializeMarshallingStrategy() }   );
               
                Environment environment = EnvironmentFactory.newEnvironment();
                KieSession ksession = marshaller.unmarshall( bais,
                                                                           conf,
                                                                           environment );
                session = (StatefulSession) ((StatefulKnowledgeSessionImpl) ksession).session;
   
                if ( keepReference ) {
View Full Code Here

Examples of org.mojavemvc.marshalling.DefaultEntityMarshaller.unmarshall()

   
    @Test
    public void defaultEntityMarshallerReturnsNullAfterUnmarshall() {
       
        DefaultEntityMarshaller m = new DefaultEntityMarshaller();
        assertNull(m.unmarshall(null, null));
    }
   
    @Test
    public void jsonEntityMarshallerSupportsJSONContentType() {
       
View Full Code Here

Examples of org.mojavemvc.marshalling.JSONEntityMarshaller.unmarshall()

    public void jsonEntityMarshallerUnmarshalls() {
       
        JSONEntityMarshaller m = new JSONEntityMarshaller();
        String json = "{\"val\":\"test\"}";
        ByteArrayInputStream in = new ByteArrayInputStream(json.getBytes());
        SimplePojo entity = m.unmarshall(in, SimplePojo.class);
        assertNotNull(entity);
        assertEquals("test", entity.getVal());
    }
   
    @Test
View Full Code Here

Examples of org.mojavemvc.marshalling.PlainTextEntityMarshaller.unmarshall()

    public void plainTextEntityMarshallerUnmarshallsString() {
       
        PlainTextEntityMarshaller m = new PlainTextEntityMarshaller();
        String text = "test";
        ByteArrayInputStream in = new ByteArrayInputStream(text.getBytes());
        String entity = m.unmarshall(in, String.class);
        assertNotNull(entity);
        assertEquals("test", entity);
    }
   
    @Test
View Full Code Here

Examples of org.mojavemvc.marshalling.PlainTextEntityMarshaller.unmarshall()

    public void plainTextEntityMarshallerUnmarshallsSimplePojo() {
       
        PlainTextEntityMarshaller m = new PlainTextEntityMarshaller();
        String text = "test";
        ByteArrayInputStream in = new ByteArrayInputStream(text.getBytes());
        SimplePojo entity = m.unmarshall(in, SimplePojo.class);
        assertNotNull(entity);
        assertEquals("test", entity.getVal());
    }
   
   
View Full Code Here

Examples of org.mojavemvc.marshalling.XMLEntityMarshaller.unmarshall()

    public void xmlEntityMarshallerUnmarshalls() {
       
        XMLEntityMarshaller m = new XMLEntityMarshaller();
        String xml = "<SimplePojo><val>test</val></SimplePojo>";
        ByteArrayInputStream in = new ByteArrayInputStream(xml.getBytes());
        SimplePojo entity = m.unmarshall(in, SimplePojo.class);
        assertNotNull(entity);
        assertEquals("test", entity.getVal());
    }
   
    @Test
View Full Code Here

Examples of org.opensaml.xml.io.Unmarshaller.unmarshall()

      UnmarshallerFactory factory = Configuration.getUnmarshallerFactory();
      Unmarshaller unmarshaller = factory.getUnmarshaller(element);
      if(unmarshaller == null)
         throw new IllegalStateException("Unmarshaller for element "+element.getLocalName()
               + " is null");
      return unmarshaller.unmarshall(element);
   }
}
View Full Code Here

Examples of org.openxml4j.opc.internal.PartUnmarshaller.unmarshall()

        if (partUnmarshaller != null) {
          UnmarshallContext context = new UnmarshallContext(this,
              part.partName);
          try {
            PackagePart unmarshallPart = partUnmarshaller
                .unmarshall(context, part.getInputStream());
            partList.put(unmarshallPart.partName, unmarshallPart);

            // Core properties case
            if (unmarshallPart instanceof PackagePropertiesPart)
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.