FileObjectWithLocation.java revision 3170:dc017a37aac5
11541Srgrimes/*
21541Srgrimes * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
31541Srgrimes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41541Srgrimes *
51541Srgrimes * This code is free software; you can redistribute it and/or modify it
61541Srgrimes * under the terms of the GNU General Public License version 2 only, as
71541Srgrimes * published by the Free Software Foundation.  Oracle designates this
81541Srgrimes * particular file as subject to the "Classpath" exception as provided
91541Srgrimes * by Oracle in the LICENSE file that accompanied this code.
101541Srgrimes *
111541Srgrimes * This code is distributed in the hope that it will be useful, but WITHOUT
121541Srgrimes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
131541Srgrimes * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
141541Srgrimes * version 2 for more details (a copy is included in the LICENSE file that
151541Srgrimes * accompanied this code).
161541Srgrimes *
171541Srgrimes * You should have received a copy of the GNU General Public License version
181541Srgrimes * 2 along with this work; if not, write to the Free Software Foundation,
191541Srgrimes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
201541Srgrimes *
211541Srgrimes * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
221541Srgrimes * or visit www.oracle.com if you need additional information or have any
231541Srgrimes * questions.
241541Srgrimes */
251541Srgrimes
261541Srgrimespackage com.sun.tools.sjavac.comp;
271541Srgrimes
281541Srgrimesimport javax.tools.FileObject;
2914505Shsuimport javax.tools.ForwardingFileObject;
3050477Speterimport javax.tools.JavaFileManager.Location;
311541Srgrimes
321541Srgrimesimport com.sun.tools.javac.api.ClientCodeWrapper.Trusted;
332165Spaul
342165Spaul@Trusted
352165Spaulpublic class FileObjectWithLocation<F extends FileObject> extends ForwardingFileObject<F> {
3615492Sbde
3770834Swollman    private final Location loc;
38130380Srwatson
39130380Srwatson    public FileObjectWithLocation(F delegate, Location loc) {
401541Srgrimes        super(delegate);
411541Srgrimes        this.loc = loc;
421541Srgrimes    }
431541Srgrimes
441541Srgrimes    public Location getLocation() {
451541Srgrimes        return loc;
461541Srgrimes    }
4736079Swollman
4836079Swollman    public FileObject getDelegate() {
49129958Srwatson        return fileObject;
50129958Srwatson    }
51129958Srwatson
52129958Srwatson    public String toString() {
53129958Srwatson        return "FileObjectWithLocation[" + fileObject + "]";
54129958Srwatson    }
55129958Srwatson}
56129958Srwatson