Package org.eclipse.jdt.core.compiler

Examples of org.eclipse.jdt.core.compiler.IProblem


                public void acceptResult(CompilationResult result) {
                    try {
                        if (result.hasProblems()) {
                            IProblem[] problems = result.getProblems();
                            for (int i = 0; i < problems.length; i++) {
                                IProblem problem = problems[i];
                                String name =
                                    new String(problems[i].getOriginatingFileName());
                                errorHandler.handleError(name,
                                                         problem.getSourceLineNumber(),
                                                         -1,
                                                         problem.getMessage());
                            }
                        } else {
                            ClassFile[] classFiles = result.getClassFiles();
                            for (int i = 0; i < classFiles.length; i++) {
                                ClassFile classFile = classFiles[i];
View Full Code Here


                public void acceptResult(CompilationResult result) {
                    try {
                        if (result.hasProblems()) {
                            IProblem[] problems = result.getProblems();
                            for (int i = 0; i < problems.length; i++) {
                                IProblem problem = problems[i];
                                String name =
                                    new String(problems[i].getOriginatingFileName());
                                handleError(name,
                                            problem.getSourceLineNumber(),
                                            -1,
                                            problem.getMessage());
                            }
                        } else {
                            ClassFile[] classFiles = result.getClassFiles();
                            for (int i = 0; i < classFiles.length; i++) {
                                ClassFile classFile = classFiles[i];
View Full Code Here

                public void acceptResult(CompilationResult result) {
                    try {
                        if (result.hasProblems()) {
                            IProblem[] problems = result.getProblems();
                            for (int i = 0; i < problems.length; i++) {
                                IProblem problem = problems[i];
                                if (problem.isError()) {
                                    String name =
                                        new String(problems[i].getOriginatingFileName());
                                    try {
                                        problemList.add(ErrorDispatcher.createJavacError
                                                (name, pageNodes, new StringBuilder(problem.getMessage()),
                                                        problem.getSourceLineNumber(), ctxt));
                                    } catch (JasperException e) {
                                        log.error("Error visiting node", e);
                                    }
                                }
                            }
View Full Code Here

                public void acceptResult(CompilationResult result) {
                    try {
                        if (result.hasProblems()) {
                            IProblem[] problems = result.getProblems();
                            for (int i = 0; i < problems.length; i++) {
                                IProblem problem = problems[i];
                                if (problem.isError()) {
                                    String name =
                                        new String(problems[i].getOriginatingFileName());
                                    try {
                                        problemList.add(ErrorDispatcher.createJavacError
                                                (name, pageNodes, new StringBuilder(problem.getMessage()),
                                                        problem.getSourceLineNumber(), ctxt));
                                    } catch (JasperException e) {
                                        log.error("Error visiting node", e);
                                    }
                                }
                            }
View Full Code Here

                public void acceptResult(CompilationResult result) {
                    try {
                        if (result.hasErrors()) {
                            IProblem[] errors = result.getErrors();
                            for (int i = 0; i < errors.length; i++) {
                                IProblem error = errors[i];
                                String name = new String(errors[i].getOriginatingFileName());
                                handleError(name, error.getSourceLineNumber(), -1, error.getMessage());
                            }
                        } else {
                            ClassFile[] classFiles = result.getClassFiles();
                            for (int i = 0; i < classFiles.length; i++) {
                                ClassFile classFile = classFiles[i];
View Full Code Here

                public void acceptResult(CompilationResult result) {
                    try {
                        if (result.hasProblems()) {
                            IProblem[] problems = result.getProblems();
                            for (int i = 0; i < problems.length; i++) {
                                IProblem problem = problems[i];
                                if (problem.isError()) {
                                    String name =
                                        new String(problems[i].getOriginatingFileName());
                                    try {
                                        problemList.add(ErrorDispatcher.createJavacError
                                                (name, pageNodes, new StringBuffer(problem.getMessage()),
                                                        problem.getSourceLineNumber(), ctxt));
                                    } catch (JasperException e) {
                                        log.error("Error visiting node", e);
                                    }
                                }
                            }
View Full Code Here

        final ICompilerRequestor compilerRequestor = new ICompilerRequestor() {
            public void acceptResult( final CompilationResult pResult ) {
                if (pResult.hasProblems()) {
                    final IProblem[] iproblems = pResult.getProblems();
                    for (int i = 0; i < iproblems.length; i++) {
                        final IProblem iproblem = iproblems[i];
                        final CompilationProblem problem = new EclipseCompilationProblem(iproblem);
                        if (problemHandler != null) {
                            problemHandler.handle(problem);
                        }
                        problems.add(problem);
View Full Code Here

        final ICompilerRequestor compilerRequestor = new ICompilerRequestor() {
            public void acceptResult( final CompilationResult pResult ) {
                if (pResult.hasProblems()) {
                    final IProblem[] iproblems = pResult.getProblems();
                    for (int i = 0; i < iproblems.length; i++) {
                        final IProblem iproblem = iproblems[i];
                        final CompilationProblem problem = new EclipseCompilationProblem(iproblem);
                        if (problemHandler != null) {
                            problemHandler.handle(problem);
                        }
                        problems.add(problem);
View Full Code Here

        // System.out
        // .println("ECS: " + problems[i].getMessage() + ","
        // + problems[i].isError() + ","
        // + problems[i].isWarning());

        IProblem problem = problems[i];

        int a[] = calculateTabIndexAndLineNumber(problem);
        Problem p = new Problem(problem, a[0], a[1]);
        if ((Boolean) errorList[i][8])
          p.setType(Problem.ERROR);
View Full Code Here

    compiler.compile(new ICompilationUnit[] { unit });
    // System.out.println(unit.getContents());
    List problems = requestor.getProblems();
    boolean error = false;
    for (Iterator it = problems.iterator(); it.hasNext();) {
      IProblem problem = (IProblem) it.next();
      StringBuffer buffer = new StringBuffer();
      buffer.append(problem.getMessage());
      buffer.append(" line: ");
      buffer.append(problem.getSourceLineNumber());
      String msg = buffer.toString();
      if (problem.isError()) {
        error = true;
        msg = "Error:\n" + msg + " " + problem.toString();
      } else if (problem.isWarning())
        msg = "Warning:\n" + msg;

      System.out.println(msg);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.compiler.IProblem

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.