Package org.eclipse.jdt.core.dom

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


            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        parser.setSource(writer.toString().toCharArray());
        ASTNode ast = parser.createAST(new NullProgressMonitor());
        ast.accept(new ASTVisitor() {

            private Map<String, String> _imports = new HashMap<String, String>();
           
            @Override
            public void endVisit(TypeDeclaration node) {
                final ReflectionModeVisitor modeVisitor = new ReflectionModeVisitor(_imports, classname);               
                node.accept(modeVisitor);
               
                if (modeVisitor.getDelegate() != null) {
                    performPropertyParsingViaJDTAST(modeVisitor.getDelegate(), properties);
                    return;
                }
               
                if (modeVisitor.getPropertyMode() != ReflectionModeVisitor.MODE_UNKNOWN) {
                    node.accept(new ASTVisitor() {
                        @Override
                        public boolean visit(FieldDeclaration node) {
                            if (org.eclipse.jdt.core.dom.Modifier.isPublic(node.getModifiers())) {
                               
                                CodeCompletionAnnotationVisitor codeCompletion = new CodeCompletionAnnotationVisitor(_imports, classname);
View Full Code Here


        }
        catch (IOException e) {
        }
        parser.setSource(writer.toString().toCharArray());
        ASTNode ast = parser.createAST(new NullProgressMonitor());
        ast.accept(new ASTVisitor() {
            private Map<String, String> _imports = new HashMap<String, String>();

            @Override
            public void endVisit(ImportDeclaration node) {
                String packageName = node.getName().toString();
View Full Code Here

            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        parser.setSource(writer.toString().toCharArray());
        ASTNode ast = parser.createAST(new NullProgressMonitor());
        ast.accept(new ASTVisitor() {
           
            private Map<String, String> _imports = new HashMap<String, String>();

            @Override
            public void endVisit(ImportDeclaration node) {
View Full Code Here

                    _methodMode = MODE_EXCLUDE;
                    _propertyMode = MODE_INCLUDE;
                    _beanMode = BEAN_MODE_LOWERCASED;
                    _delegate = null;
                   
                    node.accept(new ASTVisitor() {                   

                        @Override
                        public void endVisit(MemberValuePair node) {
                            if (node.getName().toString().equals("methodMode")) {
                                if (node.getValue().toString().contains("MODE_EXCLUDE")) {
View Full Code Here

    */

    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

    }

    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

    }

    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

    }

    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

  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

  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

TOP

Related Classes of org.eclipse.jdt.core.dom.ASTVisitor

Copyright © 2018 www.massapicom. 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.