jjg@46: /* jjg@1358: * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. jjg@46: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jjg@46: * jjg@46: * This code is free software; you can redistribute it and/or modify it jjg@46: * under the terms of the GNU General Public License version 2 only, as ohair@554: * published by the Free Software Foundation. Oracle designates this jjg@46: * particular file as subject to the "Classpath" exception as provided ohair@554: * by Oracle in the LICENSE file that accompanied this code. jjg@46: * jjg@46: * This code is distributed in the hope that it will be useful, but WITHOUT jjg@46: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jjg@46: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jjg@46: * version 2 for more details (a copy is included in the LICENSE file that jjg@46: * accompanied this code). jjg@46: * jjg@46: * You should have received a copy of the GNU General Public License version jjg@46: * 2 along with this work; if not, write to the Free Software Foundation, jjg@46: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jjg@46: * ohair@554: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@554: * or visit www.oracle.com if you need additional information or have any ohair@554: * questions. jjg@46: */ jjg@46: jjg@46: package com.sun.tools.javap; //javax.tools; jjg@46: jjg@46: import java.io.Writer; jjg@46: import java.nio.charset.Charset; jjg@46: import java.util.Locale; jjg@46: import java.util.concurrent.Callable; jjg@1358: import javax.tools.Diagnostic; jjg@46: import javax.tools.DiagnosticListener; jjg@46: import javax.tools.JavaFileManager; jjg@46: import javax.tools.JavaFileObject; jjg@46: import javax.tools.OptionChecker; jjg@46: import javax.tools.StandardJavaFileManager; jjg@1358: import javax.tools.StandardLocation; jjg@46: import javax.tools.Tool; jjg@46: jjg@46: /** jjg@46: * This class is intended to be put in javax.tools. jjg@46: * jjg@46: * @see DiagnosticListener jjg@46: * @see Diagnostic jjg@46: * @see JavaFileManager jjg@416: * @since 1.7 jjg@46: * jjg@581: *
This is NOT part of any supported API. jjg@581: * If you write code that depends on this, you do so at your own risk. jjg@46: * This code and its internal interfaces are subject to change or jjg@46: * deletion without notice. jjg@46: */ jjg@46: public interface DisassemblerTool extends Tool, OptionChecker { jjg@46: jjg@46: /** jjg@46: * Creates a future for a disassembly task with the given jjg@46: * components and arguments. The task might not have jjg@46: * completed as described in the DissemblerTask interface. jjg@46: * jjg@46: *
If a file manager is provided, it must be able to handle all
jjg@46: * locations defined in {@link StandardLocation}.
jjg@46: *
jjg@46: * @param out a Writer for additional output from the compiler;
jjg@46: * use {@code System.err} if {@code null}
jjg@46: * @param fileManager a file manager; if {@code null} use the
jjg@46: * compiler's standard filemanager
jjg@46: * @param diagnosticListener a diagnostic listener; if {@code
jjg@46: * null} use the compiler's default method for reporting
jjg@46: * diagnostics
jjg@46: * @param options compiler options, {@code null} means no options
jjg@46: * @param classes class names (for annotation processing), {@code
jjg@46: * null} means no class names
jjg@1358: * @return a task to perform the disassembly
jjg@46: * @throws RuntimeException if an unrecoverable error
jjg@46: * occurred in a user supplied component. The
jjg@46: * {@linkplain Throwable#getCause() cause} will be the error in
jjg@46: * user code.
jjg@46: * @throws IllegalArgumentException if any of the given
jjg@46: * compilation units are of other kind than
jjg@46: * {@linkplain JavaFileObject.Kind#SOURCE source}
jjg@46: */
jjg@46: DisassemblerTask getTask(Writer out,
jjg@46: JavaFileManager fileManager,
jjg@46: DiagnosticListener super JavaFileObject> diagnosticListener,
jjg@46: Iterable The standard file manager will be automatically reopened if
jjg@46: * it is accessed after calls to {@code flush} or {@code close}.
jjg@46: * The standard file manager must be usable with other tools.
jjg@46: *
jjg@46: * @param diagnosticListener a diagnostic listener for non-fatal
jjg@46: * diagnostics; if {@code null} use the compiler's default method
jjg@46: * for reporting diagnostics
jjg@46: * @param locale the locale to apply when formatting diagnostics;
jjg@46: * {@code null} means the {@linkplain Locale#getDefault() default locale}.
jjg@46: * @param charset the character set used for decoding bytes; if
jjg@46: * {@code null} use the platform default
jjg@46: * @return the standard file manager
jjg@46: */
jjg@46: StandardJavaFileManager getStandardFileManager(
jjg@46: DiagnosticListener super JavaFileObject> diagnosticListener,
jjg@46: Locale locale,
jjg@46: Charset charset);
jjg@46:
jjg@46: /**
jjg@46: * Interface representing a future for a disassembly task. The
jjg@46: * task has not yet started. To start the task, call
jjg@46: * the {@linkplain #call call} method.
jjg@46: *
jjg@46: * Before calling the call method, additional aspects of the
jjg@46: * task can be configured, for example, by calling the
jjg@46: * {@linkplain #setLocale setLocale} method.
jjg@46: */
jjg@46: interface DisassemblerTask extends Callable