org.objectweb.fractal.juliac.compile.jdk6.JavaFileManagerLogger Maven / Gradle / Ivy
The newest version!
/***
* Juliac
* Copyright (C) 2009-2013 Inria, Univ. Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: [email protected]
*
* Author: Lionel Seinturier
*/
package org.objectweb.fractal.juliac.compile.jdk6;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.tools.FileObject;
import javax.tools.ForwardingJavaFileManager;
import javax.tools.JavaFileManager;
import javax.tools.JavaFileObject;
import javax.tools.JavaFileObject.Kind;
/**
* A {@link JavaFileManager} which logs output files created by the Java
* compiler. This class is used to keep a record of created .class
* files.
*
* @author Lionel Seinturier
* @since 2.2.3
*/
public class JavaFileManagerLogger
extends ForwardingJavaFileManager {
public JavaFileManagerLogger( M fileManager ) {
super(fileManager);
}
public List getClassNames() { return classNames; }
private List classNames = new ArrayList();
@Override
public JavaFileObject getJavaFileForOutput(
Location location, String className, Kind kind,
FileObject sibling )
throws IOException {
classNames.add(className);
return super.getJavaFileForOutput(location,className,kind,sibling);
}
}