public static String genStub(IType parenttype, IMethod method, IImportsStructure imports) throws JavaModelException { boolean callSuper= !Flags.isAbstract(method.getFlags()) && !Flags.isStatic(method.getFlags()) && method.getDeclaringType().isClass(); return genStub(parenttype, method, callSuper, true, imports);
public static String genStub(IType parenttype, IMethod method, boolean callSuper, boolean addSeeTag, IImportsStructure imports) throws JavaModelException { IType declaringtype= method.getDeclaringType(); StringBuffer buf= new StringBuffer(); String[] paramTypes= method.getParameterTypes(); String[] paramNames= method.getParameterNames(); String[] excTypes= method.getExceptionTypes(); String retTypeSig= method.getReturnType();  int lastParam= paramTypes.length -1; if (!method.isConstructor()) {  if (addSeeTag) { genJavaDocSeeTag(declaringtype.getElementName(), method.getElementName(), paramTypes, buf); } else {  String desc= "Method " + method.getElementName(); genJavaDocStub(desc, paramNames, retTypeSig, excTypes, buf); } } else { String desc= "Constructor for " + parenttype.getElementName(); genJavaDocStub(desc, paramNames, Signature.SIG_VOID, excTypes, buf); } int flags= method.getFlags(); if (Flags.isPublic(flags) || (declaringtype.isInterface() && parenttype.isClass())) { buf.append("public "); } else if (Flags.isProtected(flags)) { buf.append("protected "); } else if (Flags.isPrivate(flags)) { buf.append("private "); } if (Flags.isSynchronized(flags)) { buf.append("synchronized "); } if (Flags.isVolatile(flags)) { buf.append("volatile "); } if (Flags.isStrictfp(flags)) { buf.append("strictfp "); } if (Flags.isStatic(flags)) { buf.append("static "); }  if (!method.isConstructor()) { String retTypeFrm= Signature.toString(retTypeSig); if (!isBuiltInType(retTypeSig)) { resolveAndAdd(retTypeSig, declaringtype, imports); } buf.append(Signature.getSimpleName(retTypeFrm)); buf.append(' '); buf.append(method.getElementName()); } else { buf.append(parenttype.getElementName()); } buf.append('('); for (int i= 0; i <= lastParam; i++) { String paramTypeSig= paramTypes[i]; String paramTypeFrm= Signature.toString(paramTypeSig); if (!isBuiltInType(paramTypeSig)) { resolveAndAdd(paramTypeSig, declaringtype, imports); } buf.append(Signature.getSimpleName(paramTypeFrm)); buf.append(' '); buf.append(paramNames[i]); if (i < lastParam) { buf.append(", "); } } buf.append(')');  int lastExc= excTypes.length - 1; if (lastExc >= 0) { buf.append(" throws "); for (int i= 0; i <= lastExc; i++) { String excTypeSig= excTypes[i]; String excTypeFrm= Signature.toString(excTypeSig); resolveAndAdd(excTypeSig, declaringtype, imports); buf.append(Signature.getSimpleName(excTypeFrm)); if (i < lastExc) { buf.append(", "); } } } if (parenttype.isInterface()) { buf.append(";\n\n"); } else { buf.append(" {\n\t"); if (!callSuper) { if (retTypeSig != null && !retTypeSig.equals(Signature.SIG_VOID)) { buf.append('\t'); if (!isBuiltInType(retTypeSig) || Signature.getArrayCount(retTypeSig) > 0) { buf.append("return null;\n\t"); } else if (retTypeSig.equals(Signature.SIG_BOOLEAN)) { buf.append("return false;\n\t"); } else { buf.append("return 0;\n\t"); } } } else { buf.append('\t'); if (!method.isConstructor()) { if (!Signature.SIG_VOID.equals(retTypeSig)) { buf.append("return "); } buf.append("super."); buf.append(method.getElementName()); } else { buf.append("super"); } buf.append('('); for (int i= 0; i <= lastParam; i++) { buf.append(paramNames[i]); if (i < lastParam) { buf.append(", "); } } buf.append(");\n\t"); } buf.append("}\n\n"); } return buf.toString();
	public static String genStub(IType parenttype, IMethod method, IImportsStructure imports) throws JavaModelException {		boolean callSuper= !Flags.isAbstract(method.getFlags()) && !Flags.isStatic(method.getFlags())			&& method.getDeclaringType().isClass();		return genStub(parenttype, method, callSuper, true, imports);	}