java.beans.Encoder Java Examples
The following examples show how to use
java.beans.Encoder.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Test5023552.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate(Container.class, new PersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { Container container = (Container) oldInstance; Component component = container.getComponent(); return new Expression(container, component, "create", new Object[] {component}); } }); }
Example #2
Source File: Test8005065.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private static void testDefaultPersistenceDelegate() { Encoder encoder = new Encoder(); String[] array = { "array" }; MyDPD dpd = new MyDPD(array); dpd.instantiate(dpd, encoder); array[0] = null; dpd.instantiate(dpd, encoder); }
Example #3
Source File: Test8005065.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private static void testDefaultPersistenceDelegate() { Encoder encoder = new Encoder(); String[] array = { "array" }; MyDPD dpd = new MyDPD(array); dpd.instantiate(dpd, encoder); array[0] = null; dpd.instantiate(dpd, encoder); }
Example #4
Source File: Test4968523.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private static void test(Class<?> type, PersistenceDelegate pd) { Encoder encoder1 = new Encoder(); Encoder encoder2 = new XMLEncoder(System.out); PersistenceDelegate pd1 = encoder1.getPersistenceDelegate(type); PersistenceDelegate pd2 = encoder2.getPersistenceDelegate(type); encoder1.setPersistenceDelegate(type, pd); if (pd1 == encoder1.getPersistenceDelegate(type)) throw new Error("first persistence delegate is not changed"); if (pd2 != encoder2.getPersistenceDelegate(type)) throw new Error("second persistence delegate is changed"); }
Example #5
Source File: Test4968523.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private static void test(Class<?> type, PersistenceDelegate pd) { Encoder encoder1 = new Encoder(); Encoder encoder2 = new XMLEncoder(System.out); PersistenceDelegate pd1 = encoder1.getPersistenceDelegate(type); PersistenceDelegate pd2 = encoder2.getPersistenceDelegate(type); encoder1.setPersistenceDelegate(type, pd); if (pd1 == encoder1.getPersistenceDelegate(type)) throw new Error("first persistence delegate is not changed"); if (pd2 != encoder2.getPersistenceDelegate(type)) throw new Error("second persistence delegate is changed"); }
Example #6
Source File: Test4968523.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
private static void test(Class<?> type, PersistenceDelegate pd) { Encoder encoder1 = new Encoder(); Encoder encoder2 = new XMLEncoder(System.out); PersistenceDelegate pd1 = encoder1.getPersistenceDelegate(type); PersistenceDelegate pd2 = encoder2.getPersistenceDelegate(type); encoder1.setPersistenceDelegate(type, pd); if (pd1 == encoder1.getPersistenceDelegate(type)) throw new Error("first persistence delegate is not changed"); if (pd2 != encoder2.getPersistenceDelegate(type)) throw new Error("second persistence delegate is changed"); }
Example #7
Source File: Test4968523.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private static void test(Class<?> type, PersistenceDelegate pd) { Encoder encoder1 = new Encoder(); Encoder encoder2 = new XMLEncoder(System.out); PersistenceDelegate pd1 = encoder1.getPersistenceDelegate(type); PersistenceDelegate pd2 = encoder2.getPersistenceDelegate(type); encoder1.setPersistenceDelegate(type, pd); if (pd1 == encoder1.getPersistenceDelegate(type)) throw new Error("first persistence delegate is not changed"); if (pd2 != encoder2.getPersistenceDelegate(type)) throw new Error("second persistence delegate is changed"); }
Example #8
Source File: Test8005065.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private static void testDefaultPersistenceDelegate() { Encoder encoder = new Encoder(); String[] array = { "array" }; MyDPD dpd = new MyDPD(array); dpd.instantiate(dpd, encoder); array[0] = null; dpd.instantiate(dpd, encoder); }
Example #9
Source File: Test8013416.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@Override protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); Public<String, String> map = (Public) oldInstance; for (Entry<String, String> entry : map.getAll()) { String[] args = {entry.getKey(), entry.getValue()}; out.writeStatement(new Statement(oldInstance, "put", args)); } }
Example #10
Source File: Test4968523.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private static void test(Class<?> type, PersistenceDelegate pd) { Encoder encoder1 = new Encoder(); Encoder encoder2 = new XMLEncoder(System.out); PersistenceDelegate pd1 = encoder1.getPersistenceDelegate(type); PersistenceDelegate pd2 = encoder2.getPersistenceDelegate(type); encoder1.setPersistenceDelegate(type, pd); if (pd1 == encoder1.getPersistenceDelegate(type)) throw new Error("first persistence delegate is not changed"); if (pd2 != encoder2.getPersistenceDelegate(type)) throw new Error("second persistence delegate is changed"); }
Example #11
Source File: Test4936682.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate( OuterClass.InnerClass.class, new DefaultPersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { OuterClass.InnerClass inner = (OuterClass.InnerClass) oldInstance; OuterClass outer = inner.getOuter(); return new Expression(inner, outer, "getInner", new Object[0]); } } ); }
Example #12
Source File: Test5023552.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate(Container.class, new PersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { Container container = (Container) oldInstance; Component component = container.getComponent(); return new Expression(container, component, "create", new Object[] {component}); } }); }
Example #13
Source File: Test5023552.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate(Container.class, new PersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { Container container = (Container) oldInstance; Component component = container.getComponent(); return new Expression(container, component, "create", new Object[] {component}); } }); }
Example #14
Source File: Test4936682.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate( OuterClass.InnerClass.class, new DefaultPersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { OuterClass.InnerClass inner = (OuterClass.InnerClass) oldInstance; OuterClass outer = inner.getOuter(); return new Expression(inner, outer, "getInner", new Object[0]); } } ); }
Example #15
Source File: Test8013416.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Override protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); Public<String, String> map = (Public) oldInstance; for (Entry<String, String> entry : map.getAll()) { String[] args = {entry.getKey(), entry.getValue()}; out.writeStatement(new Statement(oldInstance, "put", args)); } }
Example #16
Source File: Test4679556.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate(C.class, new DefaultPersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { C c = (C) oldInstance; return new Expression(c, c.getX(), "createC", new Object[] {}); } }); }
Example #17
Source File: Test4936682.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate( OuterClass.InnerClass.class, new DefaultPersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { OuterClass.InnerClass inner = (OuterClass.InnerClass) oldInstance; OuterClass outer = inner.getOuter(); return new Expression(inner, outer, "getInner", new Object[0]); } } ); }
Example #18
Source File: XMLSerializer.java From development with Apache License 2.0 | 5 votes |
@Override protected Expression instantiate(Object oldInstance, Encoder out) { byte[] e = (byte[]) oldInstance; return new Expression(e, ByteArrayPersistenceDelegate.class, "decode", new Object[] { ByteArrayPersistenceDelegate.encode(e) }); }
Example #19
Source File: MainPanel.java From java-swing-tips with MIT License | 5 votes |
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") @Override protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder encoder) { super.initialize(type, oldInstance, newInstance, encoder); DefaultTableModel m = (DefaultTableModel) oldInstance; for (int row = 0; row < m.getRowCount(); row++) { for (int col = 0; col < m.getColumnCount(); col++) { Object[] o = {m.getValueAt(row, col), row, col}; encoder.writeStatement(new Statement(oldInstance, "setValueAt", o)); } } }
Example #20
Source File: Test5023552.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate(Container.class, new PersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { Container container = (Container) oldInstance; Component component = container.getComponent(); return new Expression(container, component, "create", new Object[] {component}); } }); }
Example #21
Source File: Test5023552.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate(Container.class, new PersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { Container container = (Container) oldInstance; Component component = container.getComponent(); return new Expression(container, component, "create", new Object[] {component}); } }); }
Example #22
Source File: Test4936682.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate( OuterClass.InnerClass.class, new DefaultPersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { OuterClass.InnerClass inner = (OuterClass.InnerClass) oldInstance; OuterClass outer = inner.getOuter(); return new Expression(inner, outer, "getInner", new Object[0]); } } ); }
Example #23
Source File: Test8013416.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
@Override protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) { super.initialize(type, oldInstance, newInstance, out); Public<String, String> map = (Public) oldInstance; for (Entry<String, String> entry : map.getAll()) { String[] args = {entry.getKey(), entry.getValue()}; out.writeStatement(new Statement(oldInstance, "put", args)); } }
Example #24
Source File: Test4968523.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private static void test(Class<?> type, PersistenceDelegate pd) { Encoder encoder1 = new Encoder(); Encoder encoder2 = new XMLEncoder(System.out); PersistenceDelegate pd1 = encoder1.getPersistenceDelegate(type); PersistenceDelegate pd2 = encoder2.getPersistenceDelegate(type); encoder1.setPersistenceDelegate(type, pd); if (pd1 == encoder1.getPersistenceDelegate(type)) throw new Error("first persistence delegate is not changed"); if (pd2 != encoder2.getPersistenceDelegate(type)) throw new Error("second persistence delegate is changed"); }
Example #25
Source File: MainPanel.java From java-swing-tips with MIT License | 5 votes |
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") @Override protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder encoder) { super.initialize(type, oldInstance, newInstance, encoder); DefaultTableModel m = (DefaultTableModel) oldInstance; for (int row = 0; row < m.getRowCount(); row++) { for (int col = 0; col < m.getColumnCount(); col++) { Object[] o = {m.getValueAt(row, col), row, col}; encoder.writeStatement(new Statement(oldInstance, "setValueAt", o)); } } }
Example #26
Source File: Test4679556.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate(C.class, new DefaultPersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { C c = (C) oldInstance; return new Expression(c, c.getX(), "createC", new Object[] {}); } }); }
Example #27
Source File: Test5023552.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate(Container.class, new PersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { Container container = (Container) oldInstance; Component component = container.getComponent(); return new Expression(container, component, "create", new Object[] {component}); } }); }
Example #28
Source File: MainPanel.java From java-swing-tips with MIT License | 5 votes |
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") @Override protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder encoder) { super.initialize(type, oldInstance, newInstance, encoder); DefaultTableModel m = (DefaultTableModel) oldInstance; // Vector v = m.getDataVector(); // for (int i = 0; i < m.getRowCount(); i++) { // encoder.writeStatement(new Statement(oldInstance, "addRow", new Object[] { (Vector) v.get(i) })); // } for (int row = 0; row < m.getRowCount(); row++) { for (int col = 0; col < m.getColumnCount(); col++) { Object[] o = {m.getValueAt(row, col), row, col}; encoder.writeStatement(new Statement(oldInstance, "setValueAt", o)); } } }
Example #29
Source File: Test5023552.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
protected void initialize(XMLEncoder encoder) { encoder.setPersistenceDelegate(Container.class, new PersistenceDelegate() { protected Expression instantiate(Object oldInstance, Encoder out) { Container container = (Container) oldInstance; Component component = container.getComponent(); return new Expression(container, component, "create", new Object[] {component}); } }); }
Example #30
Source File: Test5023550.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
protected Expression instantiate(Object old, Encoder out) { XMLEncoder encoder = (XMLEncoder) out; return new Expression(old, encoder.getOwner(), "newB", new Object[0]); }