Search in sources :

Example 6 with CeylonFileObject

use of org.eclipse.ceylon.compiler.java.codegen.CeylonFileObject in project ceylon by eclipse.

the class CeyloncFileManager method getJavaFileForInput.

@Override
public JavaFileObject getJavaFileForInput(Location location, String className, JavaFileObject.Kind kind) throws IOException {
    nullCheck(location);
    // validateClassName(className);
    nullCheck(className);
    nullCheck(kind);
    if (!sourceOrClass.contains(kind))
        throw new IllegalArgumentException("Invalid kind " + kind);
    JavaFileObject file = getFileForInput(location, forClass(className, kind));
    if (file != null && file.getName().endsWith(".ceylon")) {
        return new CeylonFileObject(file);
    } else {
        return file;
    }
}
Also used : JavaFileObject(org.eclipse.ceylon.javax.tools.JavaFileObject) CeylonFileObject(org.eclipse.ceylon.compiler.java.codegen.CeylonFileObject)

Aggregations

CeylonFileObject (org.eclipse.ceylon.compiler.java.codegen.CeylonFileObject)6 JavaFileObject (org.eclipse.ceylon.javax.tools.JavaFileObject)4 Package (org.eclipse.ceylon.model.typechecker.model.Package)2 ArrayList (java.util.ArrayList)1 CeylonClassWriter (org.eclipse.ceylon.compiler.java.codegen.CeylonClassWriter)1 CeylonCompilationUnit (org.eclipse.ceylon.compiler.java.codegen.CeylonCompilationUnit)1 PhasedUnit (org.eclipse.ceylon.compiler.typechecker.context.PhasedUnit)1 CompletionFailure (org.eclipse.ceylon.langtools.tools.javac.code.Symbol.CompletionFailure)1 ClassWriter (org.eclipse.ceylon.langtools.tools.javac.jvm.ClassWriter)1 JCCompilationUnit (org.eclipse.ceylon.langtools.tools.javac.tree.JCTree.JCCompilationUnit)1 DiagnosticSource (org.eclipse.ceylon.langtools.tools.javac.util.DiagnosticSource)1 ListBuffer (org.eclipse.ceylon.langtools.tools.javac.util.ListBuffer)1 Module (org.eclipse.ceylon.model.typechecker.model.Module)1 Modules (org.eclipse.ceylon.model.typechecker.model.Modules)1