Package org.eclipse.jdt.internal.compiler.env

Examples of org.eclipse.jdt.internal.compiler.env.INameEnvironment


  protected String compileUnits(final JRCompilationUnit[] units, String classpath, File tempDirFile)
  {
    final StringBuffer problemBuffer = new StringBuffer();


    INameEnvironment env = getNameEnvironment(units);

    final IErrorHandlingPolicy policy =
      DefaultErrorHandlingPolicies.proceedWithAllProblems();

    final Map settings = getJdtSettings();
View Full Code Here


    return null
  }

  protected INameEnvironment getNameEnvironment(final JRCompilationUnit[] units)
  {
    final INameEnvironment env = new INameEnvironment()
    {
      public NameEnvironmentAnswer findType(char[][] compoundTypeName)
      {
        StringBuffer result = new StringBuffer();
        String sep = "";
View Full Code Here

                }
                return result;
            }
        }

        final INameEnvironment env = new INameEnvironment() {

                public NameEnvironmentAnswer
                    findType(char[][] compoundTypeName) {
                    String result = "";
                    String sep = "";
View Full Code Here

        IProblemFactory problemFactory = new DefaultProblemFactory(Locale.ENGLISH);

        /**
         * To find types ...
         */
        INameEnvironment nameEnvironment = new NameEnv(this);

        /**
         * Compilation result
         */
        ICompilerRequestor compilerRequestor = new CompilerRequestor(this);
View Full Code Here

            return new org.drools.compiler.commons.jci.compilers.CompilationResult(result);
        }

        final IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.proceedWithAllProblems();
        final IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());
        final INameEnvironment nameEnvironment = new INameEnvironment() {

            public NameEnvironmentAnswer findType( final char[][] pCompoundTypeName ) {
                final StringBuilder result = new StringBuilder();
                for (int i = 0; i < pCompoundTypeName.length; i++) {
                    if (i != 0) {
View Full Code Here

  public byte[] compile(final String str, IJavaProject prj) {
    Map prjOptions = prj.getOptions(true);

    CompilerOptions options = new CompilerOptions(prjOptions);

    INameEnvironment environment = new NameEnvironment(prj);
    IErrorHandlingPolicy policy = new IErrorHandlingPolicy() {

     
      public boolean stopOnFirstError() {
        return false;
      }

     
      public boolean proceedOnErrors() {
        return true;
      }
    };

    ICompilerRequestor requestor = new ICompilerRequestor() {

     
      public void acceptResult(CompilationResult result) {
        ClassFile[] classFiles = result.getClassFiles();
        for (ClassFile f : classFiles) {
          resultBytes = f.getBytes();
          break;
        }
      }
    };
    IProblemFactory problemFactory = new DefaultProblemFactory();
    Compiler c = new Compiler(environment, policy, options, requestor,
        problemFactory);
    c.compile(new ICompilationUnit[] { new Unit(str) });
    environment.cleanup();
    return resultBytes;
  }
View Full Code Here

  public CategorizedProblem[] validate(final String str, IJavaProject prj) {
    Map prjOptions = prj.getOptions(true);

    CompilerOptions options = new CompilerOptions(prjOptions);

    INameEnvironment environment = new NameEnvironment(prj);
    IErrorHandlingPolicy policy = new IErrorHandlingPolicy() {

     
      public boolean stopOnFirstError() {
        return false;
      }

     
      public boolean proceedOnErrors() {
        return true;
      }
    };
   
    ICompilerRequestor requestor = new ICompilerRequestor() {

     
      public void acceptResult(CompilationResult result) {
        ClassFile[] classFiles = result.getClassFiles();
        for (ClassFile f : classFiles) {
          resultBytes = f.getBytes();
          break;
        }
        problems=result.getAllProblems();
      }
    };
    IProblemFactory problemFactory = new DefaultProblemFactory();
    Compiler c = new Compiler(environment, policy, options, requestor,
        problemFactory);
    c.compile(new ICompilationUnit[] { new Unit(str) });
    environment.cleanup();
    return problems;
  }
View Full Code Here

            return new org.drools.commons.jci.compilers.CompilationResult(result);
        }

        final IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.proceedWithAllProblems();
        final IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());
        final INameEnvironment nameEnvironment = new INameEnvironment() {

            public NameEnvironmentAnswer findType( final char[][] pCompoundTypeName ) {
                final StringBuilder result = new StringBuilder();
                for (int i = 0; i < pCompoundTypeName.length; i++) {
                    if (i != 0) {
View Full Code Here

    Sandbox(AbstractCompiler outer, boolean doGenerateBytes) {
      this.outer = outer;
      this.doGenerateBytes = doGenerateBytes;
      rememberPackage("");

      INameEnvironment env = new INameEnvironmentImpl();
      IErrorHandlingPolicy pol = DefaultErrorHandlingPolicies.proceedWithAllProblems();
      IProblemFactory probFact = new DefaultProblemFactory(Locale.getDefault());
      ICompilerRequestor req = new ICompilerRequestorImpl();
      CompilerOptions options = getCompilerOptions();
View Full Code Here

            return new org.apache.commons.jci.compilers.CompilationResult(result);
        }

        final IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.proceedWithAllProblems();
        final IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());
        final INameEnvironment nameEnvironment = new INameEnvironment() {

            public NameEnvironmentAnswer findType( final char[][] pCompoundTypeName ) {
                final StringBuilder result = new StringBuilder();
                for (int i = 0; i < pCompoundTypeName.length; i++) {
                    if (i != 0) {
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.env.INameEnvironment

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.