Class CompilationTestHelper.Result

  • Enclosing class:
    CompilationTestHelper

    public static class CompilationTestHelper.Result
    extends java.lang.Object
    A result contains information about various aspects of a compiled piece of code.
    Noextend:
    This class is not intended to be subclassed by clients.
    Noinstantiate:
    This class is not intended to be instantiated by clients.
    • Constructor Summary

      Constructors 
      Constructor Description
      Result()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doCompile()  
      protected void doGenerate()  
      protected void doIndex()  
      protected void doLinking()  
      protected void doValidation()  
      java.util.Map<java.lang.String,​java.lang.CharSequence> getAllGeneratedResources()  
      java.lang.ClassLoader getClassLoader()
      Ensures compilation has happened and returns the class loader including compiled classes.
      java.lang.Class<?> getCompiledClass()
      Convenience method for single generated Java classes
      java.lang.Class<?> getCompiledClass​(java.lang.String className)
      Convenience method for single generated Java classes
      java.util.Map<java.lang.String,​java.lang.Class<?>> getCompiledClasses()
      Ensures compilation has happened and returns any generated and compiled Java classes.
      java.util.List<org.eclipse.xtext.validation.Issue> getErrorsAndWarnings()
      Ensures validation has happened and returns any errors and warnings
      java.util.Map<java.lang.String,​java.lang.String> getGeneratedCode()
      Ensures generation happened and returns a map of the generated Java source files.
      java.lang.String getGeneratedCode​(java.lang.String typeName)
      convenience method.
      org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()  
      java.lang.String getSingleGeneratedCode()
      Convenience method for the common case, that only one file is generated.
      protected void setCheckMode​(org.eclipse.xtext.validation.CheckMode checkMode)  
      protected void setJavaCompiler​(OnTheFlyJavaCompiler2 javaCompiler)  
      protected void setOutputConfigurations​(java.lang.Iterable<? extends org.eclipse.xtext.generator.OutputConfiguration> outputConfiguration)  
      protected void setResources​(java.util.List<org.eclipse.emf.ecore.resource.Resource> sources)  
      protected void setResourceSet​(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Result

        public Result()
    • Method Detail

      • setResourceSet

        protected void setResourceSet​(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
      • setCheckMode

        protected void setCheckMode​(org.eclipse.xtext.validation.CheckMode checkMode)
        Since:
        2.8
      • setResources

        protected void setResources​(java.util.List<org.eclipse.emf.ecore.resource.Resource> sources)
      • setOutputConfigurations

        protected void setOutputConfigurations​(java.lang.Iterable<? extends org.eclipse.xtext.generator.OutputConfiguration> outputConfiguration)
      • getErrorsAndWarnings

        public java.util.List<org.eclipse.xtext.validation.Issue> getErrorsAndWarnings()
        Ensures validation has happened and returns any errors and warnings
        Returns:
        errors and warnings contained in the currently processed sources
      • getCompiledClasses

        public java.util.Map<java.lang.String,​java.lang.Class<?>> getCompiledClasses()
        Ensures compilation has happened and returns any generated and compiled Java classes.
        Returns:
        the compiled Java classes
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Ensures compilation has happened and returns the class loader including compiled classes.
        Returns:
        the class loader after the compilation happend
      • getGeneratedCode

        public java.util.Map<java.lang.String,​java.lang.String> getGeneratedCode()
        Ensures generation happened and returns a map of the generated Java source files.
        Returns:
        a map of the generated Java source files, where the key is the qualified class name and the value the generated Java code.
      • getGeneratedCode

        public java.lang.String getGeneratedCode​(java.lang.String typeName)
        convenience method. Same as getGeneratedCode().get(typeName)
      • getSingleGeneratedCode

        public java.lang.String getSingleGeneratedCode()
        Convenience method for the common case, that only one file is generated.
      • getResourceSet

        public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
        Returns:
        the resource set used in this compilation process
      • getCompiledClass

        public java.lang.Class<?> getCompiledClass()
        Convenience method for single generated Java classes
      • getCompiledClass

        public java.lang.Class<?> getCompiledClass​(java.lang.String className)
        Convenience method for single generated Java classes
      • getAllGeneratedResources

        public java.util.Map<java.lang.String,​java.lang.CharSequence> getAllGeneratedResources()
        Returns:
        all generated resources. the key is the file path and the value denotes the generated text.
      • doIndex

        protected void doIndex()
      • doLinking

        protected void doLinking()
      • doValidation

        protected void doValidation()
      • doGenerate

        protected void doGenerate()
      • doCompile

        protected void doCompile()