private static void printSubjectEntry(Subject se) { if (se == null) return; if (se.getSummary() != null) System.out.println("summary is " + se.getSummary().getPlainText()); System.out.println("author is " + se.getAuthors().get(0).getName()); System.out.println("title is " + se.getTitle().getPlainText()); for (Attribute attr : se.getAttributes()) { System.out.println(attr.getName() + " : " + attr.getContent()); } System.out.println("id is " + se.getId()); for (Tag tag : se.getTags()) { System.out.println(tag.getName() + " : " + tag.getCount()); } Rating rating = se.getRating(); if (rating != null) System.out.println( "max is " + rating.getMax() + " min is " + rating.getMin() + " numRaters is " + rating.getNumRaters() + " average is " + rating.getAverage()); System.out.println("********************"); }
private static void printMiniblogEntry(MiniblogEntry me) { if (me.getContent() != null) System.out.println( "content is " + ((TextContent) me.getContent()).getContent().getPlainText()); System.out.println("title is " + me.getTitle().getPlainText()); System.out.println("id is " + me.getId()); System.out.println("published time is " + me.getPublished()); for (Attribute attr : me.getAttributes()) { System.out.println(attr.getName() + " : " + attr.getContent()); } System.out.println("-------------------"); }
private static void printNoteEntry(NoteEntry noteEntry) { if (noteEntry.getSummary() != null) System.out.println("summary is " + noteEntry.getSummary().getPlainText()); if (noteEntry.getContent() != null) System.out.println( "content is " + ((TextContent) noteEntry.getContent()).getContent().getPlainText()); if (noteEntry.getAuthors() != null) { if (!noteEntry.getAuthors().isEmpty()) System.out.println("author is " + noteEntry.getAuthors().get(0).getName()); } System.out.println("title is " + noteEntry.getTitle().getPlainText()); /* for (Attribute attr : noteEntry.getAttributes()) { System.out.println(attr.getName() + " : " + attr.getContent()); }*/ // System.out.println(noteEntry.getAttributes().isEmpty()); for (Attribute attr : noteEntry.getAttributes()) { System.out.println(attr.getName() + " : " + attr.getContent()); } System.out.println("id is " + noteEntry.getId()); System.out.println("-------------------"); }