Java Code Examples for javax.tools.StandardLocation#ANNOTATION_PROCESSOR_PATH

The following examples show how to use javax.tools.StandardLocation#ANNOTATION_PROCESSOR_PATH . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Locations.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
void initHandlers() {
    handlersForLocation = new HashMap<Location, LocationHandler>();
    handlersForOption = new EnumMap<Option, LocationHandler>(Option.class);

    LocationHandler[] handlers = {
        new BootClassPathLocationHandler(),
        new ClassPathLocationHandler(),
        new SimpleLocationHandler(StandardLocation.SOURCE_PATH, Option.SOURCEPATH),
        new SimpleLocationHandler(StandardLocation.ANNOTATION_PROCESSOR_PATH, Option.PROCESSORPATH),
        new OutputLocationHandler((StandardLocation.CLASS_OUTPUT), Option.D),
        new OutputLocationHandler((StandardLocation.SOURCE_OUTPUT), Option.S),
        new OutputLocationHandler((StandardLocation.NATIVE_HEADER_OUTPUT), Option.H)
    };

    for (LocationHandler h: handlers) {
        handlersForLocation.put(h.location, h);
        for (Option o: h.options)
            handlersForOption.put(o, h);
    }
}
 
Example 2
Source File: Locations.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
void initHandlers() {
    handlersForLocation = new HashMap<Location, LocationHandler>();
    handlersForOption = new EnumMap<Option, LocationHandler>(Option.class);

    LocationHandler[] handlers = {
        new BootClassPathLocationHandler(),
        new ClassPathLocationHandler(),
        new SimpleLocationHandler(StandardLocation.SOURCE_PATH, Option.SOURCEPATH),
        new SimpleLocationHandler(StandardLocation.ANNOTATION_PROCESSOR_PATH, Option.PROCESSORPATH),
        new OutputLocationHandler((StandardLocation.CLASS_OUTPUT), Option.D),
        new OutputLocationHandler((StandardLocation.SOURCE_OUTPUT), Option.S),
        new OutputLocationHandler((StandardLocation.NATIVE_HEADER_OUTPUT), Option.H)
    };

    for (LocationHandler h: handlers) {
        handlersForLocation.put(h.location, h);
        for (Option o: h.options)
            handlersForOption.put(o, h);
    }
}
 
Example 3
Source File: Locations.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
void initHandlers() {
    handlersForLocation = new HashMap<Location, LocationHandler>();
    handlersForOption = new EnumMap<Option, LocationHandler>(Option.class);

    LocationHandler[] handlers = {
        new BootClassPathLocationHandler(),
        new ClassPathLocationHandler(),
        new SimpleLocationHandler(StandardLocation.SOURCE_PATH, Option.SOURCEPATH),
        new SimpleLocationHandler(StandardLocation.ANNOTATION_PROCESSOR_PATH, Option.PROCESSORPATH),
        new OutputLocationHandler((StandardLocation.CLASS_OUTPUT), Option.D),
        new OutputLocationHandler((StandardLocation.SOURCE_OUTPUT), Option.S),
        new OutputLocationHandler((StandardLocation.NATIVE_HEADER_OUTPUT), Option.H)
    };

    for (LocationHandler h: handlers) {
        handlersForLocation.put(h.location, h);
        for (Option o: h.options)
            handlersForOption.put(o, h);
    }
}
 
Example 4
Source File: Locations.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
void initHandlers() {
    handlersForLocation = new HashMap<Location, LocationHandler>();
    handlersForOption = new EnumMap<Option, LocationHandler>(Option.class);

    LocationHandler[] handlers = {
        new BootClassPathLocationHandler(),
        new ClassPathLocationHandler(),
        new SimpleLocationHandler(StandardLocation.SOURCE_PATH, Option.SOURCEPATH),
        new SimpleLocationHandler(StandardLocation.ANNOTATION_PROCESSOR_PATH, Option.PROCESSORPATH),
        new OutputLocationHandler((StandardLocation.CLASS_OUTPUT), Option.D),
        new OutputLocationHandler((StandardLocation.SOURCE_OUTPUT), Option.S),
        new OutputLocationHandler((StandardLocation.NATIVE_HEADER_OUTPUT), Option.H)
    };

    for (LocationHandler h: handlers) {
        handlersForLocation.put(h.location, h);
        for (Option o: h.options)
            handlersForOption.put(o, h);
    }
}
 
Example 5
Source File: Locations.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
void initHandlers() {
    handlersForLocation = new HashMap<Location, LocationHandler>();
    handlersForOption = new EnumMap<Option, LocationHandler>(Option.class);

    LocationHandler[] handlers = {
        new BootClassPathLocationHandler(),
        new ClassPathLocationHandler(),
        new SimpleLocationHandler(StandardLocation.SOURCE_PATH, Option.SOURCEPATH),
        new SimpleLocationHandler(StandardLocation.ANNOTATION_PROCESSOR_PATH, Option.PROCESSORPATH),
        new OutputLocationHandler((StandardLocation.CLASS_OUTPUT), Option.D),
        new OutputLocationHandler((StandardLocation.SOURCE_OUTPUT), Option.S),
        new OutputLocationHandler((StandardLocation.NATIVE_HEADER_OUTPUT), Option.H)
    };

    for (LocationHandler h: handlers) {
        handlersForLocation.put(h.location, h);
        for (Option o: h.options)
            handlersForOption.put(o, h);
    }
}
 
Example 6
Source File: Locations.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
void initHandlers() {
    handlersForLocation = new HashMap<Location, LocationHandler>();
    handlersForOption = new EnumMap<Option, LocationHandler>(Option.class);

    LocationHandler[] handlers = {
        new BootClassPathLocationHandler(),
        new ClassPathLocationHandler(),
        new SimpleLocationHandler(StandardLocation.SOURCE_PATH, Option.SOURCEPATH),
        new SimpleLocationHandler(StandardLocation.ANNOTATION_PROCESSOR_PATH, Option.PROCESSORPATH),
        new OutputLocationHandler((StandardLocation.CLASS_OUTPUT), Option.D),
        new OutputLocationHandler((StandardLocation.SOURCE_OUTPUT), Option.S),
        new OutputLocationHandler((StandardLocation.NATIVE_HEADER_OUTPUT), Option.H)
    };

    for (LocationHandler h: handlers) {
        handlersForLocation.put(h.location, h);
        for (Option o: h.options)
            handlersForOption.put(o, h);
    }
}
 
Example 7
Source File: Locations.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
void initHandlers() {
    handlersForLocation = new HashMap<Location, LocationHandler>();
    handlersForOption = new EnumMap<Option, LocationHandler>(Option.class);

    LocationHandler[] handlers = {
        new BootClassPathLocationHandler(),
        new ClassPathLocationHandler(),
        new SimpleLocationHandler(StandardLocation.SOURCE_PATH, Option.SOURCEPATH),
        new SimpleLocationHandler(StandardLocation.ANNOTATION_PROCESSOR_PATH, Option.PROCESSORPATH),
        new OutputLocationHandler((StandardLocation.CLASS_OUTPUT), Option.D),
        new OutputLocationHandler((StandardLocation.SOURCE_OUTPUT), Option.S),
        new OutputLocationHandler((StandardLocation.NATIVE_HEADER_OUTPUT), Option.H)
    };

    for (LocationHandler h: handlers) {
        handlersForLocation.put(h.location, h);
        for (Option o: h.options)
            handlersForOption.put(o, h);
    }
}
 
Example 8
Source File: MemoryBasedJavaFileManager.java    From spring-init with Apache License 2.0 5 votes vote down vote up
@Override
public ClassLoader getClassLoader(Location location) {
	logger.debug("getClassLoader({})", location);
	if (location == StandardLocation.ANNOTATION_PROCESSOR_PATH && processorPath != null) {
		logger.debug("building classloader for processor path {}", processorPath);
		try {
			return new URLClassLoader(new URL[] {new File(processorPath).toURI().toURL()},this.getClass().getClassLoader());
		} catch (MalformedURLException mue) {
			logger.info("Bad URL for "+processorPath);
		}
	}
	// Do not simply return the context classloader as it may get closed and then
	// be unusable for loading any further classes
	return null; // Do not currently need to load plugins
}
 
Example 9
Source File: MemoryBasedJavaFileManager.java    From spring-init with Apache License 2.0 5 votes vote down vote up
@Override
public boolean hasLocation(Location location) {
	logger.debug("hasLocation({})", location);
	return (location == StandardLocation.SOURCE_PATH
			|| location == StandardLocation.CLASS_PATH
			|| location == StandardLocation.PLATFORM_CLASS_PATH
			|| (this.processorPath != null && location == StandardLocation.ANNOTATION_PROCESSOR_PATH));
}
 
Example 10
Source File: Locations.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
void initHandlers() {
    handlersForLocation = new HashMap<>();
    handlersForOption = new EnumMap<>(Option.class);

    BasicLocationHandler[] handlers = {
        new BootClassPathLocationHandler(StandardLocation.PLATFORM_CLASS_PATH),
        new BootClassPathLocationHandler(StandardLocation.SYSTEM_MODULES),
        new ClassFileLocationHandler(),
        new SimpleLocationHandler(StandardLocation.SOURCE_PATH, Option.SOURCE_PATH),
        new SimpleLocationHandler(StandardLocation.ANNOTATION_PROCESSOR_PATH, Option.PROCESSOR_PATH),
        new SimpleLocationHandler(StandardLocation.ANNOTATION_PROCESSOR_MODULE_PATH, Option.PROCESSOR_MODULE_PATH),
        new OutputLocationHandler(StandardLocation.CLASS_OUTPUT, Option.D),
        new OutputLocationHandler(StandardLocation.SOURCE_OUTPUT, Option.S),
        new OutputLocationHandler(StandardLocation.NATIVE_HEADER_OUTPUT, Option.H),
        new ModuleSourceFileLocationHandler(),
        new PatchModulesLocationHandler(),
        new ModuleFileLocationHandler(StandardLocation.UPGRADE_MODULE_PATH, Option.UPGRADE_MODULE_PATH),
        new ModuleFileLocationHandler(StandardLocation.MODULE_PATH, Option.MODULE_PATH)
    };

    for (BasicLocationHandler h : handlers) {
        handlersForLocation.put(h.location, h);
        for (Option o : h.options) {
            handlersForOption.put(o, h);
        }
    }
}
 
Example 11
Source File: Locations.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void initHandlers() {
    handlersForLocation = new HashMap<>();
    handlersForOption = new EnumMap<>(Option.class);

    BasicLocationHandler[] handlers = {
        new BootClassPathLocationHandler(),
        new ClassPathLocationHandler(),
        new SimpleLocationHandler(StandardLocation.SOURCE_PATH, Option.SOURCE_PATH),
        new SimpleLocationHandler(StandardLocation.ANNOTATION_PROCESSOR_PATH, Option.PROCESSOR_PATH),
        new SimpleLocationHandler(StandardLocation.ANNOTATION_PROCESSOR_MODULE_PATH, Option.PROCESSOR_MODULE_PATH),
        new OutputLocationHandler(StandardLocation.CLASS_OUTPUT, Option.D),
        new OutputLocationHandler(StandardLocation.SOURCE_OUTPUT, Option.S),
        new OutputLocationHandler(StandardLocation.NATIVE_HEADER_OUTPUT, Option.H),
        new ModuleSourcePathLocationHandler(),
        new PatchModulesLocationHandler(),
        new ModulePathLocationHandler(StandardLocation.UPGRADE_MODULE_PATH, Option.UPGRADE_MODULE_PATH),
        new ModulePathLocationHandler(StandardLocation.MODULE_PATH, Option.MODULE_PATH),
        new SystemModulesLocationHandler(),
    };

    for (BasicLocationHandler h : handlers) {
        handlersForLocation.put(h.location, h);
        for (Option o : h.options) {
            handlersForOption.put(o, h);
        }
    }
}
 
Example 12
Source File: ListenableFileManager.java    From buck with Apache License 2.0 5 votes vote down vote up
@Override
public Iterable<JavaFileObject> list(
    Location location, String packageName, Set<JavaFileObject.Kind> kinds, boolean recurse)
    throws IOException {
  Iterable<JavaFileObject> listIterator = super.list(location, packageName, kinds, recurse);
  if (location == StandardLocation.ANNOTATION_PROCESSOR_PATH) {
    return listIterator;
  } else {
    return new TrackingIterable(listIterator);
  }
}
 
Example 13
Source File: ListenableFileManager.java    From buck with Apache License 2.0 5 votes vote down vote up
@Override
@Nullable
public JavaFileObject getJavaFileForInput(
    Location location, String className, JavaFileObject.Kind kind) throws IOException {
  JavaFileObject javaFileObject = super.getJavaFileForInput(location, className, kind);
  if (javaFileObject == null) {
    return null;
  }
  if (location == StandardLocation.ANNOTATION_PROCESSOR_PATH) {
    return javaFileObject;
  } else {
    return fileTracker.wrap(javaFileObject);
  }
}
 
Example 14
Source File: ListenableFileManager.java    From buck with Apache License 2.0 5 votes vote down vote up
@Override
public JavaFileObject getJavaFileForOutput(
    Location location, String className, JavaFileObject.Kind kind, FileObject sibling)
    throws IOException {
  JavaFileObject javaFileObject = super.getJavaFileForOutput(location, className, kind, sibling);
  if (location == StandardLocation.ANNOTATION_PROCESSOR_PATH) {
    return javaFileObject;
  } else {
    return fileTracker.wrap(javaFileObject);
  }
}
 
Example 15
Source File: ListenableFileManager.java    From buck with Apache License 2.0 5 votes vote down vote up
@Override
public FileObject getFileForInput(Location location, String packageName, String relativeName)
    throws IOException {
  FileObject fileObject = super.getFileForInput(location, packageName, relativeName);
  if (location == StandardLocation.ANNOTATION_PROCESSOR_PATH) {
    return fileObject;
  } else {
    return fileTracker.wrap(fileObject);
  }
}
 
Example 16
Source File: ListenableFileManager.java    From buck with Apache License 2.0 5 votes vote down vote up
@Override
public FileObject getFileForOutput(
    Location location, String packageName, String relativeName, FileObject sibling)
    throws IOException {
  FileObject fileObject = super.getFileForOutput(location, packageName, relativeName, sibling);
  if (location == StandardLocation.ANNOTATION_PROCESSOR_PATH) {
    return fileObject;
  } else {
    return fileTracker.wrap(fileObject);
  }
}