Examples of PofValue


Examples of com.tangosol.io.pof.reflect.PofValue

        }
        return extractPojo(entry, target);
    }

    public Object extractFromBinary(PofContext ctx, Binary bin) {
        PofValue root = PofValueParser.parse(bin, ctx);
        PofSerializer codec = ctx.getPofSerializer(root.getTypeId());
        if (codec instanceof ReflectionPofSerializer) {
            Object[] holder = new Object[1];
            String reminder;
            try {
                reminder = ((ReflectionPofSerializer)codec).extract(root, path, holder);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return extractFinal(holder[0], reminder);
        }
        else {
            Object value = root.getValue();
            return extractFinal(value, path);
        }
    }
View Full Code Here

Examples of com.tangosol.io.pof.reflect.PofValue

    @Test
    public void testTypeA() {
        ConfigurablePofContext ctx = new ConfigurablePofContext(XmlHelper.loadXml(getClass().getResource("/test-pof-config.xml")));
       
        Binary blob = ExternalizableHelper.toBinary(new TypeA(), ctx);
        PofValue root = PofValueParser.parse(blob, ctx);
   
        Assert.assertTrue(root instanceof ComplexPofValue);
       
        ComplexPofValue cf = (ComplexPofValue) root;
        @SuppressWarnings("unused")
    PofValue p0 = cf.getChild(0);
        PofValue p1 = cf.getChild(1);
        PofValue p2 = cf.getChild(2);
        PofValue p3 = cf.getChild(3);
        PofValue p4 = cf.getChild(4);
        PofValue p5 = cf.getChild(5);
        PofValue p6 = cf.getChild(6);
        @SuppressWarnings("unused")
        PofValue p7 = cf.getChild(6);
       
        Assert.assertEquals("ABC", p1.getValue(String.class));
        Assert.assertEquals("", p2.getValue(String.class));
        Assert.assertEquals(null, p3.getValue(String.class));
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.