@Test public void composingAdapterFactory() throws Exception { Jsouper jsouper = new Jsouper.Builder().add(new MovieReviewAdapterFactory()) .add(Movie.class, new MovieAdapter()) .build(); ElementAdapter<MovieReview> movieReviewAdapter = jsouper.adapter(MovieReview.class); MovieReview movieReview = movieReviewAdapter.fromElement(document); assertThat(movieReview.movie).isEqualTo(new Movie("Deadpool", "Sample description", 4)); assertThat(movieReview.review).isEqualTo("Ryan Reynolds is adorable!"); }
public <T> ElementAdapter<T> adapter(Type type) { return adapter(type, Util.NO_ANNOTATIONS); }
Jsouper { public <T> ElementAdapter<T> adapter(Type type) { return adapter(type, Util.NO_ANNOTATIONS); } }
Jsouper { public <T> ElementAdapter<T> adapter(Type type) { return adapter(type, Util.NO_ANNOTATIONS); } Jsouper(Builder builder); }
Jsouper { public <T> ElementAdapter<T> adapter(Type type) { return adapter(type, Util.NO_ANNOTATIONS); } Jsouper(Builder builder); ElementAdapter<T> adapter(Type type); ElementAdapter<T> adapter(Type type, Set<? extends Annotation> annotations); }
Jsouper { public <T> ElementAdapter<T> adapter(Type type) { return adapter(type, Util.NO_ANNOTATIONS); } Jsouper(Builder builder); ElementAdapter<T> adapter(Type type); ElementAdapter<T> adapter(Type type, Set<? extends Annotation> annotations);  }