EMMA Coverage Report (generated Thu Dec 06 15:24:05 GMT 2007)
[all classes][javax.tools]

COVERAGE SUMMARY FOR SOURCE FILE [StandardLocation.java]

nameclass, %method, %block, %line, %
StandardLocation.java0%   (0/2)0%   (0/10)0%   (0/148)0%   (0/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StandardLocation0%   (0/1)0%   (0/7)0%   (0/134)0%   (0/15)
<static initializer> 0%   (0/1)0%   (0/68)0%   (0/8)
StandardLocation (String, int): void 0%   (0/1)0%   (0/5)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
isOutputLocation (): boolean 0%   (0/1)0%   (0/10)0%   (0/1)
locationFor (String): JavaFileManager$Location 0%   (0/1)0%   (0/39)0%   (0/5)
valueOf (String): StandardLocation 0%   (0/1)0%   (0/5)0%   (0/1)
values (): StandardLocation [] 0%   (0/1)0%   (0/4)0%   (0/1)
     
class StandardLocation$10%   (0/1)0%   (0/3)0%   (0/14)0%   (0/3)
StandardLocation$1 (String): void 0%   (0/1)0%   (0/6)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
isOutputLocation (): boolean 0%   (0/1)0%   (0/5)0%   (0/1)

1/*
2 * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25 
26package javax.tools;
27 
28import javax.tools.JavaFileManager.Location;
29 
30import java.io.File;
31import java.util.*;
32import java.util.concurrent.*;
33 
34/**
35 * Standard locations of file objects.
36 *
37 * @author Peter von der Ah&eacute;
38 * @since 1.6
39 */
40public enum StandardLocation implements Location {
41 
42    /**
43     * Location of new class files.
44     */
45    CLASS_OUTPUT,
46 
47    /**
48     * Location of new source files.
49     */
50    SOURCE_OUTPUT,
51 
52    /**
53     * Location to search for user class files.
54     */
55    CLASS_PATH,
56 
57    /**
58     * Location to search for existing source files.
59     */
60    SOURCE_PATH,
61 
62    /**
63     * Location to search for annotation processors.
64     */
65    ANNOTATION_PROCESSOR_PATH,
66 
67    /**
68     * Location to search for platform classes.  Sometimes called
69     * the boot class path.
70     */
71    PLATFORM_CLASS_PATH;
72 
73    /**
74     * Gets a location object with the given name.  The following
75     * property must hold: {@code locationFor(x) ==
76     * locationFor(y)} if and only if {@code x.equals(y)}.
77     * The returned location will be an output location if and only if
78     * name ends with {@code "_OUTPUT"}.
79     *
80     * @param name a name
81     * @return a location
82     */
83    public static Location locationFor(final String name) {
84        if (locations.isEmpty()) {
85            // can't use valueOf which throws IllegalArgumentException
86            for (Location location : values())
87                locations.putIfAbsent(location.getName(), location);
88        }
89        locations.putIfAbsent(name.toString(/* null-check */), new Location() {
90                public String getName() { return name; }
91                public boolean isOutputLocation() { return name.endsWith("_OUTPUT"); }
92            });
93        return locations.get(name);
94    }
95    //where
96        private static ConcurrentMap<String,Location> locations
97            = new ConcurrentHashMap<String,Location>();
98 
99    public String getName() { return name(); }
100 
101    public boolean isOutputLocation() {
102        return this == CLASS_OUTPUT || this == SOURCE_OUTPUT;
103    }
104}

[all classes][javax.tools]
EMMA 2.0.5312 (C) Vladimir Roubtsov