public boolean supportsReadObject(Class type, boolean includeBaseClasses) { return getMethod( type, "readObject", new Class[]{ObjectInputStream.class}, includeBaseClasses) != null; }
public boolean supportsReadObject(Class type, boolean includeBaseClasses) { return getMethod( type, "readObject", new Class[]{ObjectInputStream.class}, includeBaseClasses) != null; }
public boolean supportsWriteObject(Class type, boolean includeBaseClasses) { return getMethod( type, "writeObject", new Class[]{ObjectOutputStream.class}, includeBaseClasses) != null; }
public boolean supportsWriteObject(Class type, boolean includeBaseClasses) { return getMethod( type, "writeObject", new Class[]{ObjectOutputStream.class}, includeBaseClasses) != null; }
public boolean supportsWriteObject(Class type, boolean includeBaseClasses) { return getMethod(type, "writeObject", new Class[]{ObjectOutputStream.class}, includeBaseClasses) != null; }
public boolean supportsReadObject(Class type, boolean includeBaseClasses) { return getMethod(type, "readObject", new Class[]{ObjectInputStream.class}, includeBaseClasses) != null; }
public boolean supportsWriteObject(Class type, boolean includeBaseClasses) { return getMethod(type, "writeObject", new Class[]{ObjectOutputStream.class}, includeBaseClasses) != null; }
public boolean supportsReadObject(Class type, boolean includeBaseClasses) { return getMethod(type, "readObject", new Class[]{ObjectInputStream.class}, includeBaseClasses) != null; }
private Method getMethod(Class type, String name, Class[] parameterTypes, boolean includeBaseclasses) { Method method = getMethod(type, name, parameterTypes); return method == NO_METHOD || (!includeBaseclasses && !method.getDeclaringClass().equals(type)) ? null : method; }
private Method getMethod(Class type, String name, Class[] parameterTypes, boolean includeBaseclasses) { Method method = getMethod(type, name, parameterTypes); return method == NO_METHOD || (!includeBaseclasses && !method.getDeclaringClass().equals(type)) ? null : method; }
public void callWriteObject(Class type, Object instance, ObjectOutputStream stream) { try { Method readObjectMethod = getMethod(type, "writeObject", new Class[]{ObjectOutputStream.class}, false); readObjectMethod.invoke(instance, new Object[]{stream}); } catch (IllegalAccessException e) { throw new ConversionException("Could not call " + instance.getClass().getName() + ".writeObject()", e); } catch (InvocationTargetException e) { throw new ConversionException("Could not call " + instance.getClass().getName() + ".writeObject()", e.getTargetException()); } }
public void callReadObject(Class type, Object object, ObjectInputStream stream) { try { Method readObjectMethod = getMethod(type, "readObject", new Class[]{ObjectInputStream.class}, false); readObjectMethod.invoke(object, new Object[]{stream}); } catch (IllegalAccessException e) { throw new ConversionException("Could not call " + object.getClass().getName() + ".readObject()", e); } catch (InvocationTargetException e) { throw new ConversionException("Could not call " + object.getClass().getName() + ".readObject()", e.getTargetException()); } }
public void callReadObject(Class type, Object object, ObjectInputStream stream) { try { Method readObjectMethod = getMethod(type, "readObject", new Class[]{ObjectInputStream.class}, false); readObjectMethod.invoke(object, new Object[]{stream}); } catch (IllegalAccessException e) { throw new ConversionException("Could not call " + object.getClass().getName() + ".readObject()", e); } catch (InvocationTargetException e) { throw new ConversionException("Could not call " + object.getClass().getName() + ".readObject()", e.getTargetException()); } }
public void callWriteObject(Class type, Object instance, ObjectOutputStream stream) { try { Method readObjectMethod = getMethod(type, "writeObject", new Class[]{ObjectOutputStream.class}, false); readObjectMethod.invoke(instance, new Object[]{stream}); } catch (IllegalAccessException e) { throw new ConversionException("Could not call " + instance.getClass().getName() + ".writeObject()", e); } catch (InvocationTargetException e) { throw new ConversionException("Could not call " + instance.getClass().getName() + ".writeObject()", e.getTargetException()); } }
private Method getMethod(Class type, String name, Class[] parameterTypes) { FastField method = new FastField(type, name); Method result = (Method)cache.get(method); if (result == null) { try { result = type.getDeclaredMethod(name, parameterTypes); if (!result.isAccessible()) { result.setAccessible(true); } } catch (NoSuchMethodException e) { result = getMethod(type.getSuperclass(), name, parameterTypes); } cache.put(method, result); } return result; }
private Method getMethod(Class type, String name, Class[] parameterTypes) { FastField method = new FastField(type, name); Method result = (Method)cache.get(method); if (result == null) { try { result = type.getDeclaredMethod(name, parameterTypes); if (!result.isAccessible()) { result.setAccessible(true); } } catch (NoSuchMethodException e) { result = getMethod(type.getSuperclass(), name, parameterTypes); } cache.put(method, result); } return result; }
public void callWriteObject(Class type, Object instance, ObjectOutputStream stream) { try { Method readObjectMethod = getMethod( type, "writeObject", new Class[]{ObjectOutputStream.class}, false); readObjectMethod.invoke(instance, new Object[]{stream}); } catch (IllegalAccessException e) { throw new ConversionException("Could not call " + instance.getClass().getName() + ".writeObject()", e); } catch (InvocationTargetException e) { throw new ConversionException("Could not call " + instance.getClass().getName() + ".writeObject()", e.getTargetException()); } }
public void callReadObject(Class type, Object object, ObjectInputStream stream) { try { Method readObjectMethod = getMethod( type, "readObject", new Class[]{ObjectInputStream.class}, false); readObjectMethod.invoke(object, new Object[]{stream}); } catch (IllegalAccessException e) { throw new ConversionException("Could not call " + object.getClass().getName() + ".readObject()", e); } catch (InvocationTargetException e) { throw new ConversionException("Could not call " + object.getClass().getName() + ".readObject()", e.getTargetException()); } }
public void callWriteObject(Class type, Object instance, ObjectOutputStream stream) { try { Method readObjectMethod = getMethod( type, "writeObject", new Class[]{ObjectOutputStream.class}, false); readObjectMethod.invoke(instance, new Object[]{stream}); } catch (IllegalAccessException e) { throw new ConversionException("Could not call " + instance.getClass().getName() + ".writeObject()", e); } catch (InvocationTargetException e) { throw new ConversionException("Could not call " + instance.getClass().getName() + ".writeObject()", e.getTargetException()); } }
public void callReadObject(Class type, Object object, ObjectInputStream stream) { try { Method readObjectMethod = getMethod( type, "readObject", new Class[]{ObjectInputStream.class}, false); readObjectMethod.invoke(object, new Object[]{stream}); } catch (IllegalAccessException e) { throw new ConversionException("Could not call " + object.getClass().getName() + ".readObject()", e); } catch (InvocationTargetException e) { throw new ConversionException("Could not call " + object.getClass().getName() + ".readObject()", e.getTargetException()); } }