コード例 #1
0
 public static String formatUserDescription(final User user) {
   if (user == null) return null;
   final String text = user.getDescription();
   if (text == null) return null;
   final HtmlBuilder builder = new HtmlBuilder(text, false, true, true);
   final UrlEntity[] urls = user.getDescriptionEntities();
   if (urls != null) {
     for (final UrlEntity url : urls) {
       final String expanded_url = url.getExpandedUrl();
       if (expanded_url != null) {
         builder.addLink(expanded_url, url.getDisplayUrl(), url.getStart(), url.getEnd());
       }
     }
   }
   return builder.build();
 }
コード例 #2
0
 public static String formatStatusText(final Status status) {
   if (status == null) return null;
   final HtmlBuilder builder = new HtmlBuilder(status.getText(), false, true, true);
   TwitterContentUtils.parseEntities(builder, status);
   return builder.build();
 }
コード例 #3
0
 public static String formatDirectMessageText(final DirectMessage message) {
   if (message == null) return null;
   final HtmlBuilder builder = new HtmlBuilder(message.getText(), false, true, true);
   TwitterContentUtils.parseEntities(builder, message);
   return builder.build();
 }