Here you can find the source of createInterfaceContent(String typeName, @SuppressWarnings("rawtypes") List superInterfaces, String indentation, String lineSeparator)
public static String createInterfaceContent(String typeName, @SuppressWarnings("rawtypes") List superInterfaces, String indentation, String lineSeparator)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 itemis AG (http://www.itemis.eu) and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ import java.util.Iterator; import java.util.List; public class Main { public static String createInterfaceContent(String typeName, @SuppressWarnings("rawtypes") List superInterfaces, String indentation, String lineSeparator) { StringBuffer sb = new StringBuffer(); sb.append("interface "); sb.append(typeName);//from ww w . j a va2 s .c om @SuppressWarnings("rawtypes") Iterator i = superInterfaces.iterator(); if (i.hasNext()) { sb.append(" extends "); sb.append(stripPackage(i.next())); while (i.hasNext()) { sb.append(", "); sb.append(stripPackage(i.next())); } } sb.append(" {"); sb.append(lineSeparator); sb.append(indentation); sb.append(lineSeparator); sb.append("}"); return sb.toString(); } private static Object stripPackage(Object superType) { return superType.toString().replaceAll("^(\\w+\\.)*", ""); } }