src/share/classes/com/sun/source/util/JavacTask.java

changeset 1
9a66ca7c79fa
child 554
9d9f26857129
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/share/classes/com/sun/source/util/JavacTask.java	Sat Dec 01 00:00:00 2007 +0000
     1.3 @@ -0,0 +1,91 @@
     1.4 +/*
     1.5 + * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 + *
     1.8 + * This code is free software; you can redistribute it and/or modify it
     1.9 + * under the terms of the GNU General Public License version 2 only, as
    1.10 + * published by the Free Software Foundation.  Sun designates this
    1.11 + * particular file as subject to the "Classpath" exception as provided
    1.12 + * by Sun in the LICENSE file that accompanied this code.
    1.13 + *
    1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 + * version 2 for more details (a copy is included in the LICENSE file that
    1.18 + * accompanied this code).
    1.19 + *
    1.20 + * You should have received a copy of the GNU General Public License version
    1.21 + * 2 along with this work; if not, write to the Free Software Foundation,
    1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 + *
    1.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    1.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
    1.26 + * have any questions.
    1.27 + */
    1.28 +
    1.29 +package com.sun.source.util;
    1.30 +
    1.31 +import com.sun.source.tree.CompilationUnitTree;
    1.32 +import com.sun.source.tree.Tree;
    1.33 +import java.io.IOException;
    1.34 +import javax.lang.model.element.Element;
    1.35 +import javax.lang.model.type.TypeMirror;
    1.36 +import javax.lang.model.util.Elements;
    1.37 +import javax.lang.model.util.Types;
    1.38 +import javax.tools.JavaCompiler.CompilationTask;
    1.39 +import javax.tools.JavaFileObject;
    1.40 +
    1.41 +/**
    1.42 + * Provides access to functionality specific to the Sun Java Compiler, javac.
    1.43 + *
    1.44 + * @author Peter von der Ahé
    1.45 + * @author Jonathan Gibbons
    1.46 + * @since 1.6
    1.47 + */
    1.48 +public abstract class JavacTask implements CompilationTask {
    1.49 +
    1.50 +    /**
    1.51 +     * Parse the specified files returning a list of abstract syntax trees.
    1.52 +     *
    1.53 +     * @return a list of abstract syntax trees
    1.54 +     * @throws IOException if an unhandled I/O error occurred in the compiler.
    1.55 +     */
    1.56 +    public abstract Iterable<? extends CompilationUnitTree> parse()
    1.57 +        throws IOException;
    1.58 +
    1.59 +    /**
    1.60 +     * Complete all analysis.
    1.61 +     *
    1.62 +     * @return a list of elements that were analyzed
    1.63 +     * @throws IOException if an unhandled I/O error occurred in the compiler.
    1.64 +     */
    1.65 +    public abstract Iterable<? extends Element> analyze() throws IOException;
    1.66 +
    1.67 +    /**
    1.68 +     * Generate code.
    1.69 +     *
    1.70 +     * @return a list of files that were generated
    1.71 +     * @throws IOException if an unhandled I/O error occurred in the compiler.
    1.72 +     */
    1.73 +    public abstract Iterable<? extends JavaFileObject> generate() throws IOException;
    1.74 +
    1.75 +    /**
    1.76 +     * The specified listener will receive events describing the progress of
    1.77 +     * this compilation task.
    1.78 +     */
    1.79 +    public abstract void setTaskListener(TaskListener taskListener);
    1.80 +
    1.81 +    /**
    1.82 +     * Get a type mirror of the tree node determined by the specified path.
    1.83 +     */
    1.84 +    public abstract TypeMirror getTypeMirror(Iterable<? extends Tree> path);
    1.85 +    /**
    1.86 +     * Get a utility object for dealing with program elements.
    1.87 +     */
    1.88 +    public abstract Elements getElements();
    1.89 +
    1.90 +    /**
    1.91 +     * Get a utility object for dealing with type mirrors.
    1.92 +     */
    1.93 +    public abstract Types getTypes();
    1.94 +}

mercurial