@Override public void defaultWriteObject() throws IOException { for (Property property : desc.getSerializableProperties()) { try { out.getAndWriteProperty(v, property); } catch (IllegalAccessException e) { throw new IOException(e); } catch (InvocationTargetException e) { throw new IOException(e); } } }
@Override public void defaultReadObject() throws IOException, ClassNotFoundException { for (Property property : desc.getSerializableProperties()) { try { in.readAndSetProperty(v, property); } catch (IllegalAccessException e) { throw new IOException(e); } catch (InvocationTargetException e) { throw new IOException(e); } } }
@Override public void defaultWriteObject() throws IOException { for (Property property : desc.getSerializableProperties()) { try { out.getAndWriteProperty(v, property); } catch (IllegalAccessException e) { throw new IOException(e); } catch (InvocationTargetException e) { throw new IOException(e); } } }
@Override public void defaultWriteObject() throws IOException { for (Property property : desc.getSerializableProperties()) { try { out.getAndWriteProperty(v, property); } catch (IllegalAccessException e) { throw new IOException(e); } catch (InvocationTargetException e) { throw new IOException(e); } } }
@Override public void defaultReadObject() throws IOException, ClassNotFoundException { for (Property property : desc.getSerializableProperties()) { try { in.readAndSetProperty(v, property); } catch (IllegalAccessException e) { throw new IOException(e); } catch (InvocationTargetException e) { throw new IOException(e); } } }
@Override public void defaultReadObject() throws IOException, ClassNotFoundException { for (Property property : desc.getSerializableProperties()) { try { in.readAndSetProperty(v, property); } catch (IllegalAccessException e) { throw new IOException(e); } catch (InvocationTargetException e) { throw new IOException(e); } } }
public ClassDescriptor(Reflection reflection, Class<?> cls) { this.cls = cls; this.instantiator = getInstantiator(reflection, cls); if (!Externalizable.class.isAssignableFrom(cls)) { this.writeObjectMethod = getPrivateMethod(cls, "writeObject", WRITE_OBJECT_PARAMS, Void.TYPE); this.readObjectMethod = getPrivateMethod(cls, "readObject", READ_OBJECT_PARAMS, Void.TYPE); } else { this.writeObjectMethod = null; this.readObjectMethod = null; } this.writeReplaceMethod = getInheritedMethod(cls, "writeReplace", null, Object.class); this.readResolveMethod = getInheritedMethod(cls, "readResolve", null, Object.class); this.properties = getSerializableProperties(reflection, cls); this.parent = reflection.getDescriptor(cls.getSuperclass()); }
public ClassDescriptor(Reflection reflection, Class<?> cls) { this.cls = cls; this.instantiator = getInstantiator(reflection, cls); if (!Externalizable.class.isAssignableFrom(cls)) { this.writeObjectMethod = getPrivateMethod(cls, "writeObject", WRITE_OBJECT_PARAMS, Void.TYPE); this.readObjectMethod = getPrivateMethod(cls, "readObject", READ_OBJECT_PARAMS, Void.TYPE); } else { this.writeObjectMethod = null; this.readObjectMethod = null; } this.writeReplaceMethod = getInheritedMethod(cls, "writeReplace", null, Object.class); this.readResolveMethod = getInheritedMethod(cls, "readResolve", null, Object.class); this.properties = getSerializableProperties(reflection, cls); this.parent = reflection.getDescriptor(cls.getSuperclass()); }
public ClassDescriptor(Reflection reflection, Class<?> cls) { this.cls = cls; this.instantiator = getInstantiator(reflection, cls); if (!Externalizable.class.isAssignableFrom(cls)) { this.writeObjectMethod = getPrivateMethod(cls, "writeObject", WRITE_OBJECT_PARAMS, Void.TYPE); this.readObjectMethod = getPrivateMethod(cls, "readObject", READ_OBJECT_PARAMS, Void.TYPE); } else { this.writeObjectMethod = null; this.readObjectMethod = null; } this.writeReplaceMethod = getInheritedMethod(cls, "writeReplace", null, Object.class); this.readResolveMethod = getInheritedMethod(cls, "readResolve", null, Object.class); this.properties = getSerializableProperties(reflection, cls); this.parent = reflection.getDescriptor(cls.getSuperclass()); }
protected void encodeSerializable(OutputContext ctx, Serializable v, ClassDescriptor desc) throws IOException, IllegalAccessException, InvocationTargetException { ClassDescriptor parentDesc = desc.getParent(); if (parentDesc != null) encodeSerializable(ctx, v, parentDesc); if (desc.hasWriteObjectMethod()) desc.invokeWriteObjectMethod(new JMFObjectOutputStream(ctx, desc, v), v); else { for (Property property : desc.getSerializableProperties()) ctx.getAndWriteProperty(v, property); } }
protected void decodeSerializable(InputContext ctx, Serializable v, ClassDescriptor desc) throws IOException, ClassNotFoundException, IllegalAccessException, InvocationTargetException { ClassDescriptor parentDesc = desc.getParent(); if (parentDesc != null) decodeSerializable(ctx, v, parentDesc); if (desc.hasReadObjectMethod()) desc.invokeReadObjectMethod(new JMFObjectInputStream(ctx, desc, v), v); else { for (Property property : desc.getSerializableProperties()) ctx.readAndSetProperty(v, property); } }
protected void decodeSerializable(InputContext ctx, Serializable v, ClassDescriptor desc) throws IOException, ClassNotFoundException, IllegalAccessException, InvocationTargetException { ClassDescriptor parentDesc = desc.getParent(); if (parentDesc != null) decodeSerializable(ctx, v, parentDesc); if (desc.hasReadObjectMethod()) desc.invokeReadObjectMethod(new JMFObjectInputStream(ctx, desc, v), v); else { for (Property property : desc.getSerializableProperties()) ctx.readAndSetProperty(v, property); } }
protected void decodeSerializable(InputContext ctx, Serializable v, ClassDescriptor desc) throws IOException, ClassNotFoundException, IllegalAccessException, InvocationTargetException { ClassDescriptor parentDesc = desc.getParent(); if (parentDesc != null) decodeSerializable(ctx, v, parentDesc); if (desc.hasReadObjectMethod()) desc.invokeReadObjectMethod(new JMFObjectInputStream(ctx, desc, v), v); else { for (Property property : desc.getSerializableProperties()) ctx.readAndSetProperty(v, property); } }
protected void encodeSerializable(OutputContext ctx, Serializable v, ClassDescriptor desc) throws IOException, IllegalAccessException, InvocationTargetException { ClassDescriptor parentDesc = desc.getParent(); if (parentDesc != null) encodeSerializable(ctx, v, parentDesc); if (desc.hasWriteObjectMethod()) desc.invokeWriteObjectMethod(new JMFObjectOutputStream(ctx, desc, v), v); else { for (Property property : desc.getSerializableProperties()) ctx.getAndWriteProperty(v, property); } }
protected void encodeSerializable(OutputContext ctx, Serializable v, ClassDescriptor desc) throws IOException, IllegalAccessException, InvocationTargetException { ClassDescriptor parentDesc = desc.getParent(); if (parentDesc != null) encodeSerializable(ctx, v, parentDesc); if (desc.hasWriteObjectMethod()) desc.invokeWriteObjectMethod(new JMFObjectOutputStream(ctx, desc, v), v); else { for (Property property : desc.getSerializableProperties()) ctx.getAndWriteProperty(v, property); } }