Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.CompilationUnit.accept()


    options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_6);
    parser.setCompilerOptions(options);
    CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.recordModifications();
    rewrite = ASTRewrite.create(cu.getAST());
    cu.accept(new XQASTVisitor());

    TextEdit edits = cu.rewrite(doc, null);
    try {
      edits.apply(doc);
    } catch (MalformedTreeException e) {
View Full Code Here


      parser.setKind(ASTParser.K_COMPILATION_UNIT);
      CompilationUnit unit = (CompilationUnit) parser.createAST(null);
      unit.recordModifications();

      TypeDeclarationFinderVisitor visitor = new TypeDeclarationFinderVisitor();
      unit.accept(visitor);

      List<AbstractTypeDeclaration> declarations = visitor.getTypeDeclarations();
      if (!declarations.isEmpty())
      {
         AbstractTypeDeclaration declaration = declarations.get(0);
View Full Code Here

      parser.setKind(ASTParser.K_COMPILATION_UNIT);
      CompilationUnit unit = (CompilationUnit) parser.createAST(null);
      unit.recordModifications();

      TypeDeclarationFinderVisitor visitor = new TypeDeclarationFinderVisitor();
      unit.accept(visitor);

      List<AbstractTypeDeclaration> declarations = visitor.getTypeDeclarations();
      if (!declarations.isEmpty())
      {
         AbstractTypeDeclaration declaration = declarations.get(0);
View Full Code Here

      parser.setKind(ASTParser.K_COMPILATION_UNIT);
      CompilationUnit unit = (CompilationUnit) parser.createAST(null);
      unit.recordModifications();

      TypeDeclarationFinderVisitor visitor = new TypeDeclarationFinderVisitor();
      unit.accept(visitor);

      List<AbstractTypeDeclaration> declarations = visitor.getTypeDeclarations();
      if (!declarations.isEmpty())
      {
         AbstractTypeDeclaration declaration = declarations.get(0);
View Full Code Here

      parser.setKind(ASTParser.K_COMPILATION_UNIT);
      CompilationUnit unit = (CompilationUnit) parser.createAST(null);
      unit.recordModifications();

      TypeDeclarationFinderVisitor visitor = new TypeDeclarationFinderVisitor();
      unit.accept(visitor);

      List<AbstractTypeDeclaration> declarations = visitor.getTypeDeclarations();
      if (!declarations.isEmpty())
      {
         AbstractTypeDeclaration declaration = declarations.get(0);
View Full Code Here

    options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_6);
    parser.setCompilerOptions(options);
    CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.recordModifications();
    rewrite = ASTRewrite.create(cu.getAST());
    cu.accept(new XQASTVisitor());

    TextEdit edits = cu.rewrite(doc, null);
    try {
      edits.apply(doc);
    } catch (MalformedTreeException e) {
View Full Code Here

    if (unit != null) {
      if (breakpoint instanceof JavaClassPrepareBreakpoint
          || breakpoint instanceof JavaWatchpoint
          || breakpoint instanceof JavaMethodEntryBreakpoint
          || breakpoint instanceof JavaMethodBreakpoint) {
        unit.accept(new BreakpointVerifier(breakpoint, unit));
      } else if (breakpoint instanceof JavaLineBreakpoint) {
        JavaLineBreakpoint bp = (JavaLineBreakpoint) breakpoint;
        // line breakpoint use the ValidBreakpointLocationLocator to
        // (re)place it
        int currentline = bp.getLineNumber();
View Full Code Here

        // line breakpoint use the ValidBreakpointLocationLocator to
        // (re)place it
        int currentline = bp.getLineNumber();
        ValidBreakpointLocationLocator locator = new ValidBreakpointLocationLocator(
            unit, currentline, true, true);
        unit.accept(locator);
        int newline = locator.getLineLocation();
        if (locator.getLocationType() == ValidBreakpointLocationLocator.LOCATION_LINE) {
          if (currentline != newline) {
            bp.getMarker().setAttribute(JavaBreakpoint.TYPE_NAME,
                locator.getFullyQualifiedTypeName());
View Full Code Here

            ASTParser parser = ASTParser.newParser(AST.JLS4);
            parser.setResolveBindings(true);
            parser.setSource(type.getTypeRoot());
            CompilationUnit cu = (CompilationUnit) parser
                .createAST(null);
            cu.accept(new ASTVisitor(false) {
              @Override
              public boolean visit(AnonymousClassDeclaration node) {
                ITypeBinding binding = node.resolveBinding();
                if (binding == null)
                  return false;
View Full Code Here

    parser.setCompilerOptions(options);
    CompilationUnit unit = (CompilationUnit) parser.createAST(null);
    SourceBasedSourceGenerator visitor = new SourceBasedSourceGenerator(
        type, createInAStaticMethod, fLocalVariableTypeNames,
        fLocalVariableNames, fCodeSnippet, sourceLevel);
    unit.accept(visitor);

    if (visitor.hasError()) {
      throw new DebugException(new Status(IStatus.ERROR,
          JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK,
          visitor.getError(), null));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.