Java 类org.eclipse.jdt.core.dom.TypeDeclarationStatement 实例源码

项目:eclipse.jdt.ls    文件:UnusedCodeFix.java   
@Override
public void rewriteAST(CompilationUnitRewrite cuRewrite, LinkedProposalModel linkedModel) throws CoreException {
    ASTRewrite rewrite= cuRewrite.getASTRewrite();
    IBinding binding= fUnusedName.resolveBinding();
    CompilationUnit root= (CompilationUnit) fUnusedName.getRoot();
    String displayString= FixMessages.UnusedCodeFix_RemoveUnusedTypeParameter_description;
    TextEditGroup group= createTextEditGroup(displayString, cuRewrite);

    if (binding.getKind() == IBinding.TYPE) {
        ITypeBinding decl= ((ITypeBinding) binding).getTypeDeclaration();
        ASTNode declaration= root.findDeclaringNode(decl);
        if (declaration.getParent() instanceof TypeDeclarationStatement) {
            declaration= declaration.getParent();
        }
        rewrite.remove(declaration, group);
    }
}
项目:che    文件:UnusedCodeFix.java   
@Override
public void rewriteAST(CompilationUnitRewrite cuRewrite, LinkedProposalModel linkedModel)
    throws CoreException {
  ASTRewrite rewrite = cuRewrite.getASTRewrite();
  IBinding binding = fUnusedName.resolveBinding();
  CompilationUnit root = (CompilationUnit) fUnusedName.getRoot();
  String displayString = FixMessages.UnusedCodeFix_RemoveUnusedTypeParameter_description;
  TextEditGroup group = createTextEditGroup(displayString, cuRewrite);

  if (binding.getKind() == IBinding.TYPE) {
    ITypeBinding decl = ((ITypeBinding) binding).getTypeDeclaration();
    ASTNode declaration = root.findDeclaringNode(decl);
    if (declaration.getParent() instanceof TypeDeclarationStatement) {
      declaration = declaration.getParent();
    }
    rewrite.remove(declaration, group);
  }
}
项目:Eclipse-Postfix-Code-Completion    文件:UnusedCodeFix.java   
@Override
public void rewriteAST(CompilationUnitRewrite cuRewrite, LinkedProposalModel linkedModel) throws CoreException {
    ASTRewrite rewrite= cuRewrite.getASTRewrite();
    IBinding binding= fUnusedName.resolveBinding();
    CompilationUnit root= (CompilationUnit) fUnusedName.getRoot();
    String displayString= FixMessages.UnusedCodeFix_RemoveUnusedTypeParameter_description;
    TextEditGroup group= createTextEditGroup(displayString, cuRewrite);

    if (binding.getKind() == IBinding.TYPE) {
        ITypeBinding decl= ((ITypeBinding) binding).getTypeDeclaration();
        ASTNode declaration= root.findDeclaringNode(decl);
        if (declaration.getParent() instanceof TypeDeclarationStatement) {
            declaration= declaration.getParent();
        }
        rewrite.remove(declaration, group);
    }
}
项目:eclipse.jdt.ls    文件:FlowAnalyzer.java   
@Override
public void endVisit(TypeDeclarationStatement node) {
    if (skipNode(node)) {
        return;
    }
    assignFlowInfo(node, node.getDeclaration());
}
项目:code    文件:WorkspaceUtilities.java   
@Override
   public boolean visit(TypeDeclarationStatement node) {
    ITypeBinding typeBinding = node.resolveBinding();
    addNewBinding(typeBinding, node);
    addNewTypeBinding(typeBinding);
    return true;
}
项目:code    文件:WorkspaceUtilities.java   
@Override
   public boolean visit(TypeDeclarationStatement node) {
    ITypeBinding typeBinding = node.resolveBinding();
    addNewBinding(typeBinding, node);
    addNewTypeBinding(typeBinding);
    return true;
}
项目:code    文件:WorkspaceUtilities.java   
@Override
   public boolean visit(TypeDeclarationStatement node) {
    ITypeBinding typeBinding = node.resolveBinding();
    addNewBinding(typeBinding, node);
    addNewTypeBinding(typeBinding);
    return true;
}
项目:che    文件:ScopeAnalyzer.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
  if (hasFlag(TYPES, fFlags) && node.getStartPosition() + node.getLength() < fPosition) {
    fBreak = fRequestor.acceptBinding(node.resolveBinding());
    return false;
  }
  return !fBreak && isInside(node);
}
项目:che    文件:ScopeAnalyzer.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
  if (hasFlag(TYPES, fFlags) && fPosition < node.getStartPosition()) {
    fBreak = fRequestor.acceptBinding(node.resolveBinding());
  }
  return false;
}
项目:che    文件:InlineConstantRefactoring.java   
/**
 * @param scope not a TypeDeclaration
 * @return Set containing Strings representing simple names
 */
private Set<String> getLocallyDeclaredNames(BodyDeclaration scope) {
  Assert.isTrue(!(scope instanceof AbstractTypeDeclaration));

  final Set<String> result = new HashSet<String>();

  if (scope instanceof FieldDeclaration) return result;

  scope.accept(
      new HierarchicalASTVisitor() {

        @Override
        public boolean visit(AbstractTypeDeclaration node) {
          Assert.isTrue(node.getParent() instanceof TypeDeclarationStatement);

          result.add(node.getName().getIdentifier());
          return false;
        }

        @Override
        public boolean visit(AnonymousClassDeclaration anonDecl) {
          return false;
        }

        @Override
        public boolean visit(VariableDeclaration varDecl) {
          result.add(varDecl.getName().getIdentifier());
          return false;
        }
      });
  return result;
}
项目:Eclipse-Postfix-Code-Completion    文件:InlineConstantRefactoring.java   
/**
 * @param scope not a TypeDeclaration
 * @return Set containing Strings representing simple names
 */
private Set<String> getLocallyDeclaredNames(BodyDeclaration scope) {
    Assert.isTrue(!(scope instanceof AbstractTypeDeclaration));

    final Set<String> result= new HashSet<String>();

    if (scope instanceof FieldDeclaration)
        return result;

    scope.accept(new HierarchicalASTVisitor() {

        @Override
        public boolean visit(AbstractTypeDeclaration node) {
            Assert.isTrue(node.getParent() instanceof TypeDeclarationStatement);

            result.add(node.getName().getIdentifier());
            return false;
        }

        @Override
        public boolean visit(AnonymousClassDeclaration anonDecl) {
            return false;
        }

        @Override
        public boolean visit(VariableDeclaration varDecl) {
            result.add(varDecl.getName().getIdentifier());
            return false;
        }
    });
    return result;
}
项目:Eclipse-Postfix-Code-Completion    文件:ScopeAnalyzer.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    if (hasFlag(TYPES, fFlags) && node.getStartPosition() + node.getLength() < fPosition) {
        fBreak= fRequestor.acceptBinding(node.resolveBinding());
        return false;
    }
    return !fBreak && isInside(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:ScopeAnalyzer.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    if (hasFlag(TYPES, fFlags) && fPosition < node.getStartPosition()) {
        fBreak= fRequestor.acceptBinding(node.resolveBinding());
    }
    return false;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:InlineConstantRefactoring.java   
/**
 * @param scope not a TypeDeclaration
 * @return Set containing Strings representing simple names
 */
private Set<String> getLocallyDeclaredNames(BodyDeclaration scope) {
    Assert.isTrue(!(scope instanceof AbstractTypeDeclaration));

    final Set<String> result= new HashSet<String>();

    if (scope instanceof FieldDeclaration)
        return result;

    scope.accept(new HierarchicalASTVisitor() {

        @Override
        public boolean visit(AbstractTypeDeclaration node) {
            Assert.isTrue(node.getParent() instanceof TypeDeclarationStatement);

            result.add(node.getName().getIdentifier());
            return false;
        }

        @Override
        public boolean visit(AnonymousClassDeclaration anonDecl) {
            return false;
        }

        @Override
        public boolean visit(VariableDeclaration varDecl) {
            result.add(varDecl.getName().getIdentifier());
            return false;
        }
    });
    return result;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ASTFlattener.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    if (node.getAST().apiLevel() >= JLS3) {
        node.getDeclaration().accept(this);
    }
    return false;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ScopeAnalyzer.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    if (hasFlag(TYPES, fFlags) && node.getStartPosition() + node.getLength() < fPosition) {
        fBreak= fRequestor.acceptBinding(node.resolveBinding());
        return false;
    }
    return !fBreak && isInside(node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ScopeAnalyzer.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    if (hasFlag(TYPES, fFlags) && fPosition < node.getStartPosition()) {
        fBreak= fRequestor.acceptBinding(node.resolveBinding());
    }
    return false;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:NaiveASTFlattener.java   
public boolean visit(TypeDeclarationStatement node) {
    if (node.getAST().apiLevel() == JLS2) {
        getTypeDeclaration(node).accept(this);
    }
    if (node.getAST().apiLevel() >= JLS3) {
        node.getDeclaration().accept(this);
    }
    return false;
}
项目:eclipse.jdt.ls    文件:CodeScopeBuilder.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    fScope.addName(node.getDeclaration().getName().getIdentifier());
    return false;
}
项目:che    文件:CodeScopeBuilder.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
  fScope.addName(node.getDeclaration().getName().getIdentifier());
  return false;
}
项目:che    文件:NameCollector.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
  names.add(node.getDeclaration().getName().getIdentifier());
  return false;
}
项目:evosuite    文件:LoggingVisitor.java   
/** {@inheritDoc} */
@Override
public void endVisit(TypeDeclarationStatement node) {
    logger.warn("Method endVisitTypeDeclarationStatement for " + node + " for " + node + " not implemented!");
    super.endVisit(node);
}
项目:evosuite    文件:LoggingVisitor.java   
/** {@inheritDoc} */
@Override
public boolean visit(TypeDeclarationStatement node) {
    logger.warn("Method visitTypeDeclarationStatement for " + node + " not implemented!");
    return super.visit(node);
}
项目:Beagle    文件:NotRecursingAstVisitor.java   
@Override
public boolean visit(final TypeDeclarationStatement node) {
    return false;
}
项目:Beagle    文件:InstrumentableAstNodeLister.java   
@Override
public boolean visit(final TypeDeclarationStatement node) {
    // not instrumentable, may contain instrumentable nodes
    return true;
}
项目:tassal    文件:IdentifierPerType.java   
@Override
public boolean visit(final TypeDeclarationStatement node) {
    addToMap(identifiers, node, node.getDeclaration().getName()
            .toString());
    return super.visit(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:MoveInnerToTopRefactoring.java   
private boolean isInLocalTypeInsideInputType(ASTNode node, AbstractTypeDeclaration declaration) {
    final TypeDeclarationStatement statement= (TypeDeclarationStatement) ASTNodes.getParent(node, TypeDeclarationStatement.class);
    return statement != null && ASTNodes.isParent(statement, declaration);
}
项目:Eclipse-Postfix-Code-Completion    文件:PullUpRefactoringProcessor.java   
@Override
public final void endVisit(final TypeDeclarationStatement node) {
    fTypeDeclarationStatement= false;
    super.endVisit(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:PullUpRefactoringProcessor.java   
@Override
public final boolean visit(final TypeDeclarationStatement node) {
    fTypeDeclarationStatement= true;
    return super.visit(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:FlowAnalyzer.java   
@Override
public void endVisit(TypeDeclarationStatement node) {
    if (skipNode(node))
        return;
    assignFlowInfo(node, node.getDeclaration());
}
项目:Eclipse-Postfix-Code-Completion    文件:NameCollector.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    names.add(node.getDeclaration().getName().getIdentifier());
    return false;
}
项目:Eclipse-Postfix-Code-Completion    文件:AstMatchingNodeFinder.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    if (node.subtreeMatch(fMatcher, fNodeToMatch))
        return matches(node);
    return super.visit(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:ConstraintCollector.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    add(fCreator.create(node));
    return true;
}
项目:Eclipse-Postfix-Code-Completion    文件:GenericVisitor.java   
@Override
public void endVisit(TypeDeclarationStatement node) {
    endVisitNode(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:GenericVisitor.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    return visitNode(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:CodeScopeBuilder.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    fScope.addName(node.getDeclaration().getName().getIdentifier());
    return false;
}
项目:Eclipse-Postfix-Code-Completion    文件:ExceptionOccurrencesFinder.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    // don't dive into local type declarations.
    return false;
}
项目:Eclipse-Postfix-Code-Completion    文件:ImplementOccurrencesFinder.java   
@Override
public boolean visit(TypeDeclarationStatement node) {
    // don't dive into local type declarations.
    return false;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:MoveInnerToTopRefactoring.java   
private boolean isInLocalTypeInsideInputType(ASTNode node, AbstractTypeDeclaration declaration) {
    final TypeDeclarationStatement statement= (TypeDeclarationStatement) ASTNodes.getParent(node, TypeDeclarationStatement.class);
    return statement != null && ASTNodes.isParent(statement, declaration);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:PullUpRefactoringProcessor.java   
@Override
public final void endVisit(final TypeDeclarationStatement node) {
    fTypeDeclarationStatement= false;
    super.endVisit(node);
}