Examples of ASTVisitor


Examples of org.eclipse.jdt.core.dom.ASTVisitor

    }

    List<MarkerData> generateRemovedMethodMarker(IJavaProject javaProject, final String className, final String methodName, final Delta requiresDelta) throws JavaModelException {
        final List<MarkerData> markers = new LinkedList<MarkerData>();
        final CompilationUnit ast = createAST(javaProject, className);
        ast.accept(new ASTVisitor() {
            @Override
            public boolean visit(TypeDeclaration typeDecl) {
                ITypeBinding typeBinding = typeDecl.resolveBinding();
                if (typeBinding != null) {
                    if (typeBinding.getBinaryName().equals(className)) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

    }

    List<MarkerData> generateAddedMethodMarker(IJavaProject javaProject, String className, final String methodName, final Delta requiresDelta) throws JavaModelException {
        final List<MarkerData> markers = new LinkedList<MarkerData>();
        final CompilationUnit ast = createAST(javaProject, className);
        ast.accept(new ASTVisitor() {
            @Override
            public boolean visit(MethodDeclaration methodDecl) {
                String signature = ASTUtil.buildMethodSignature(methodDecl);
                if (signature.equals(methodName)) {
                    // Create the marker attribs here
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

    }

    List<MarkerData> generateRemovedMethodMarker(IJavaProject javaProject, final String className, final String methodName, final Delta requiresDelta) throws JavaModelException {
        final List<MarkerData> markers = new LinkedList<MarkerData>();
        final CompilationUnit ast = createAST(javaProject, className);
        ast.accept(new ASTVisitor() {
            @Override
            public boolean visit(TypeDeclaration typeDecl) {
                ITypeBinding typeBinding = typeDecl.resolveBinding();
                if (typeBinding != null) {
                    if (typeBinding.getBinaryName().equals(className)) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

  private void goThroughClass(ICompilationUnit ClassContent, final String contextTypeId) {
    ASTParser parser = ASTParser.newParser(AST.JLS3);
    parser.setSource(ClassContent);
    parser.setKind(ASTParser.K_COMPILATION_UNIT);
    final CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.accept(new ASTVisitor() {
      private boolean parameter = false;
      private String paramName = "";
      public void endVisit(FieldDeclaration node) {
        paramName = "";
        parameter = false;
        node.accept(new ASTVisitor() {
          public void endVisit(MarkerAnnotation node) {
            parameter = node.getTypeName().toString()
                .equals(TapestryContants.ANNOTATION_PARAMETER);
            super.endVisit(node);
          }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

  private void goThroughClass(String ClassContent) {
    ASTParser parser = ASTParser.newParser(AST.JLS3);
    parser.setSource(ClassContent.toCharArray());
    parser.setKind(ASTParser.K_COMPILATION_UNIT);
    final CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.accept(new ASTVisitor() {

      private String elNodeName;
      private boolean intoEL;

      public void endVisit(FieldDeclaration node) {
        elNodeName = "";
        intoEL = false;
        node.accept(new ASTVisitor() {
          public void endVisit(MarkerAnnotation node) {
            intoEL = node.getTypeName().toString().equals(TapestryContants.ANNOTATION_PROPERTY);
            super.endVisit(node);
          }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

  private void goThroughClass(String ClassContent) {
    ASTParser parser = ASTParser.newParser(AST.JLS3);
    parser.setSource(ClassContent.toCharArray());
    parser.setKind(ASTParser.K_COMPILATION_UNIT);
    final CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.accept(new ASTVisitor() {

      private String elNodeName;
      private boolean intoEL;
      private boolean definedId;

      public void endVisit(FieldDeclaration node) {
        elNodeName = "";
        intoEL = false;
        definedId = false;
        node.accept(new ASTVisitor() {
          public void endVisit(MarkerAnnotation node) {
            intoEL = node.getTypeName().toString()
                .equals(TapestryContants.COMPONENT_PROPERTY);
            super.endVisit(node);
          }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

    return name;
  }
  public static String getGetMethodName(CompilationUnit cunit, final String fieldName){
    TypeDeclaration type = (TypeDeclaration) cunit.types().get(0);
    final String[]ret=new String[1];
    type.accept(new ASTVisitor(){
      @Override
      public boolean visit(ReturnStatement node) {
        Expression exp = node.getExpression();
        if(exp!=null&&exp instanceof SimpleName){
          String retName = ((SimpleName)exp).getFullyQualifiedName();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

    });
    return ret[0];
 
  public static String findReturnFieldName(MethodDeclaration method){
    final String[]ret=new String[1];
    method.accept(new ASTVisitor(){
      @Override
      public boolean visit(ReturnStatement node) {
        Expression exp=node.getExpression();
        if(exp instanceof SimpleName ){
          ret[0]=((SimpleName)exp).getFullyQualifiedName();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

    ICompilationUnit comp_unit = model_element.getCompilationUnit();
    ASTNode node = getASTNodeFromCompilationUnit(comp_unit);
   
    // Now, find the corresponding type node
    final Box<NODETYPE> result = new Box<NODETYPE>(null);
    node.accept(new ASTVisitor() {
     
      @Override
      public void postVisit(ASTNode node) {
        // If this node is a subtype of the node we are
        // interested in, then we can ask the client's
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

    ICompilationUnit comp_unit = model_element.getCompilationUnit();
    ASTNode node = getASTNodeFromCompilationUnit(comp_unit);
   
    // Now, find the corresponding type node
    final Box<NODETYPE> result = new Box<NODETYPE>(null);
    node.accept(new ASTVisitor() {
     
      @Override
      public void postVisit(ASTNode node) {
        // If this node is a subtype of the node we are
        // interested in, then we can ask the client's
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.