Examples of readObject()


Examples of org.apache.pivot.serialization.JSONSerializer.readObject()

            public void buttonPressed(Button button) {
                JSONSerializer serializer = new JSONSerializer();
                InputStream inputStream = getClass().getResourceAsStream("contact.json");

                try {
                    form.load((Map<String, Object>)serializer.readObject(inputStream));
                    sourceLabel.setText("JSON");
                } catch(Exception exception) {
                    System.err.println(exception);
                }
View Full Code Here

Examples of org.apache.pivot.serialization.PropertiesSerializer.readObject()

        Serializer<Map<?, ?>> serializer = new PropertiesSerializer();
        log("serializer instance created: " + serializer);

        ByteArrayInputStream inputStream = new ByteArrayInputStream(testBytes);
        @SuppressWarnings("unchecked")
        Map<String, Object> readData = (Map<String, Object>) serializer.readObject(inputStream);
        assertNotNull(readData);

        log("Succesfully Read");
        for (String key : readData) {
            log(key + "=" + readData.get(key));
View Full Code Here

Examples of org.apache.pivot.serialization.StringSerializer.readObject()

        log("readValues()");

        Serializer<String> serializer = new StringSerializer();

        ByteArrayInputStream inputStream = new ByteArrayInputStream(testBytes);
        String result = serializer.readObject(inputStream);
        assertNotNull(result);
        assertEquals(result, testString);

        // dump content, but useful only for text resources ...
        String dump = result;
View Full Code Here

Examples of org.apache.pivot.wtk.text.PlainTextSerializer.readObject()

                Document documentLocal;
                int n;
                try {
                    PlainTextSerializer serializer = new PlainTextSerializer();
                    StringReader reader = new StringReader(text);
                    documentLocal = serializer.readObject(reader);
                    n = documentLocal.getCharacterCount();

                    bulkOperation = true;
                    int start = selectionStart;
                    this.document.insertRange(documentLocal, start);
View Full Code Here

Examples of org.apache.pivot.wtkx.WTKXSerializer.readObject()

        frame.setTitle("Component Pane Test");
        frame.setPreferredSize(800, 600);
        frame.setLocation(20, 20);

        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        sheet = (Sheet)wtkxSerializer.readObject(this, "card_pane_test.wtkx");
        cardPane = (CardPane)wtkxSerializer.get("cardPane");
        sizeGroup = (ButtonGroup)wtkxSerializer.get("sizeGroup");

        sizeGroup.getButtonGroupListeners().add(new ButtonGroupListener.Adapter() {
            @Override
View Full Code Here

Examples of org.apache.pivot.xml.XMLSerializer.readObject()

public class XMLSerializerTest {
    @Test
    public void basicTest() throws IOException, SerializationException {
        XMLSerializer xmlSerializer = new XMLSerializer();

        Element root = xmlSerializer.readObject(getClass().getResourceAsStream("sample.xml"));

        assertEquals(root.getName(), "root");

        Element a = XMLSerializer.getElement(root, "a");
        assertEquals(a.getName(), "a");
View Full Code Here

Examples of org.apache.qpid.client.message.JMSStreamMessage.readObject()

    {
        JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
        bm.writeString(null);
        bm.writeObject(null);
        bm.reset();
        assertNull(bm.readObject());
        assertNull(bm.readObject());
    }

    public static junit.framework.Test suite()
    {
View Full Code Here

Examples of org.apache.qpid.client.util.ClassLoadingAwareObjectInputStream.readObject()

    {
        Serializable result = null;
        if (data != null && data.hasRemaining())
        {
            ClassLoadingAwareObjectInputStream in = new ClassLoadingAwareObjectInputStream(new ByteBufferInputStream(data));
            result = (Serializable) in.readObject();
        }
        return result;
    }
}
View Full Code Here

Examples of org.apache.qpid.jms.ListMessage.readObject()

          System.out.println(m);
    System.out.println("==========================================");
    System.out.println("Printing stream contents:");
    try {
      while(true)
        System.out.println(m.readObject());
    }
    catch (MessageEOFException e) {
      // DONE
    }
  }
View Full Code Here

Examples of org.apache.qpid.proton.TestDecoder.readObject()

    @Test
    public void testDescribed() throws IOException
    {
        TestDecoder d = createDecoder(getBytes("described"));
        DescribedType dt = (DescribedType) (d.readObject());
        assertEquals(Symbol.valueOf("foo-descriptor"), dt.getDescriptor());
        assertEquals("foo-value", dt.getDescribed());

        dt = (DescribedType) (d.readObject());
        assertEquals(12, dt.getDescriptor());
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.