Java Collection Convert toHtml(Collection collection)

Here you can find the source of toHtml(Collection collection)

Description

to Html

License

Open Source License

Declaration

public static String toHtml(Collection collection) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;
import java.util.Iterator;

public class Main {
    public static String toHtml(Collection collection) {

        StringBuffer sb = new StringBuffer();

        sb.append("<ul>");

        Iterator iterator = collection.iterator();

        while (iterator.hasNext()) {
            sb.append("<li>");
            sb.append(iterator.next());/*  w w  w. j  ava2 s . c o m*/
            sb.append("</li>");
        }

        sb.append("</ul>");

        return sb.toString();
    }
}

Related

  1. toDoubles(Collection numbers)
  2. toEnumeration(final Collection collection)
  3. toEscapedStringWithDelimiters(Collection objects, String delim)
  4. toggleEntry(T entry, Collection collection)
  5. toHashSet(Collection c)
  6. toIntegerCollection(int[] ints)
  7. toJSONString(Collection collection)
  8. tokenSetString(Collection tokens)
  9. toLimitLengthString(final Collection coll, final int limit)