@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public JavaSource<?> parse(final String data)
{
Document document = new Document(data);
ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setSource(document.get().toCharArray());
Map options = JavaCore.getOptions();
options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
options.put(CompilerOptions.OPTION_Encoding, "UTF-8");
parser.setCompilerOptions(options);
parser.setResolveBindings(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
unit.recordModifications();
TypeDeclarationFinderVisitor visitor = new TypeDeclarationFinderVisitor();
unit.accept(visitor);