String content= context.evaluate(template).getString();
TemplateBuffer buffer= context.evaluate(template); if (buffer == null) return null; String content= buffer.getString();
	public static String getCompilationUnitContent(ICompilationUnit cu, String typeComment, String typeContent, String lineDelimiter) throws CoreException {		IPackageFragment pack= (IPackageFragment) cu.getParent();		String packDecl= pack.isDefaultPackage() ? "" : "package " + pack.getElementName() + ';'; //$NON-NLS-1$ //$NON-NLS-2$		Template template= CodeTemplates.getCodeTemplate(CodeTemplates.NEWTYPE);		if (template == null) {			return null;		}		IJavaProject project= cu.getJavaProject();		CodeTemplateContext context= new CodeTemplateContext(template.getContextTypeName(), project, lineDelimiter, 0);		context.setCompilationUnitVariables(cu);		context.setVariable(CodeTemplateContextType.PACKAGE_DECLARATION, packDecl);		context.setVariable(CodeTemplateContextType.TYPE_COMMENT, typeComment);		context.setVariable(CodeTemplateContextType.TYPE_DECLARATION, typeContent);		context.setVariable(CodeTemplateContextType.TYPENAME, Signature.getQualifier(cu.getElementName()));		String content= context.evaluate(template).getString();		if (content.length() == 0) {			return null;		}		return content;	}		