@Override public boolean supports( Class type ) { return getConstructorForClass(type) != null; }
/** * Creat a new instance of the class accepting a single outputstream constructor. * @param type Type of object to create. * @param outputStream resulting output stream. * @return A new instance of the outputstream-derived class. */ private Object createInstanceOfClass(Class type,OutputStream outputStream) { try { return getConstructorForClass(type).newInstance(outputStream); } catch (Exception e) { throw new DynamicClassResolutionException(type, e); } } }