JavapFileManager.java revision 3560:bbf4cfc235bd
1139749Simp/* 233323Sphk * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. 333323Sphk * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 433323Sphk * 533323Sphk * This code is free software; you can redistribute it and/or modify it 633323Sphk * under the terms of the GNU General Public License version 2 only, as 733323Sphk * published by the Free Software Foundation. Oracle designates this 833323Sphk * particular file as subject to the "Classpath" exception as provided 933323Sphk * by Oracle in the LICENSE file that accompanied this code. 1036938Sphk * 1136938Sphk * This code is distributed in the hope that it will be useful, but WITHOUT 12185003Sjhb * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1336938Sphk * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1436938Sphk * version 2 for more details (a copy is included in the LICENSE file that 1533323Sphk * accompanied this code). 1633323Sphk * 17119418Sobrien * You should have received a copy of the GNU General Public License version 18119418Sobrien * 2 along with this work; if not, write to the Free Software Foundation, 19119418Sobrien * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2033323Sphk * 21187576Sjhb * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2233323Sphk * or visit www.oracle.com if you need additional information or have any 2333323Sphk * questions. 2455939Snsouch */ 25187576Sjhb 2655939Snsouchpackage com.sun.tools.javap; 2733323Sphk 2836739Sphkimport java.io.PrintWriter; 2955939Snsouchimport java.nio.charset.Charset; 3055939Snsouchimport javax.tools.DiagnosticListener; 3155939Snsouchimport javax.tools.JavaFileObject; 3233323Sphk 3333323Sphkimport com.sun.tools.javac.file.JavacFileManager; 3455939Snsouchimport com.sun.tools.javac.util.Context; 3555939Snsouch 3633323Sphk/** 3749550Sphk * javap's implementation of JavaFileManager. 3833323Sphk * 3997228Speter * <p><b>This is NOT part of any supported API. 4088220Simp * If you write code that depends on this, you do so at your own risk. 4149550Sphk * This code and its internal interfaces are subject to change or 42143390Simp * deletion without notice.</b> 4383818Sphk */ 44130585Sphkpublic class JavapFileManager extends JavacFileManager { 4583818Sphk private JavapFileManager(Context context, Charset charset) { 4683818Sphk super(context, true, charset); 4783818Sphk setSymbolFileEnabled(false); 48187576Sjhb } 4983818Sphk 5055939Snsouch public static JavapFileManager create(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) { 51187576Sjhb Context javac_context = new Context(); 5255939Snsouch 5355939Snsouch if (dl != null) 5449550Sphk javac_context.put(DiagnosticListener.class, dl); 5533323Sphk javac_context.put(com.sun.tools.javac.util.Log.errKey, log); 56187576Sjhb 5783818Sphk return new JavapFileManager(javac_context, null); 5833323Sphk } 5955939Snsouch} 6055939Snsouch