Package javax.tools

Examples of javax.tools.JavaFileManager$Location


      clientOnly = true;
      argList.remove(0);
    }

    // Control how the compile process writes data to disk
    JavaFileManager fileManager =
        new JarOrDirectoryOutputFileManager(new File(argList.remove(0)), compiler
            .getStandardFileManager(null, null, null));

    // Create a validator and require it to process the specified types
    RfValidator processor = new RfValidator();
    if (clientOnly) {
      processor.setClientOnly(true);
    } else {
      processor.setMustResolveAllMappings(true);
    }
    processor.setRootOverride(argList);

    // Create the compilation task
    CompilationTask task =
        compiler.getTask(null, fileManager, null, null, null, Arrays
            .asList(new FakeJavaFileObject()));
    task.setProcessors(Arrays.asList(processor));
    if (!task.call()) {
      return false;
    }
    // Save data only on successful compilation
    fileManager.close();
    return true;
  }
View Full Code Here


    Context context = new Context();
    boolean success = false;
    Throwable failTrace = null;
    try {
      Class<?> dfm = Class.forName("com.sun.tools.javac.util.DefaultFileManager");
      JavaFileManager instance = (JavaFileManager) dfm.getConstructor(Context.class, boolean.class, Charset.class).newInstance(context, true, Charset.forName("UTF-8"));
      context.put(JavaFileManager.class, instance);
      success = true;
    } catch (Throwable t) {
      //Either DFM, or its replacement JFM, exists (or possibly both in odd classpath configurations). If something is wrong, NoMethodDefErrors and the like occur.
      failTrace = t;
    }
   
    try {
      Class<?> jfm = Class.forName("com.sun.tools.javac.util.JavacFileManager");
      JavaFileManager instance = (JavaFileManager) jfm.getConstructor(Context.class, boolean.class, Charset.class).newInstance(context, true, Charset.forName("UTF-8"));
      context.put(JavaFileManager.class, instance);
      success = true;
    } catch (Throwable t) {
      //Either DFM, or its replacement JFM, exists (or possibly both in odd classpath configurations). If something is wrong, NoMethodDefErrors and the like occur.
      failTrace = t;
View Full Code Here

  @Test(enabled = false)
  public void testShouldSetAndGetLocation() {
    //driver.get(pages.html5Page);

    LocationContext d = (LocationContext) new Augmenter().augment(driver);
    Location loc = new Location(40.714353, -74.005973, 0.056747);

    d.setLocation(loc);

    //driver.manage().timeouts().implicitlyWait(2000, MILLISECONDS);
View Full Code Here

          Map<Object, Object> map =
              (Map<Object, Object>) executeMethod.execute(DriverCommand.GET_LOCATION, null);
          double latitude = Long.valueOf((Long) map.get("latitude")).doubleValue();
          double longitude = Long.valueOf((Long) map.get("longitude")).doubleValue();
          double altitude = Long.valueOf((Long) map.get("altitude")).doubleValue();
          return new Location(latitude, longitude, altitude);
        } else if ("setLocation".equals(method.getName())) {
          return executeMethod.execute(DriverCommand.SET_LOCATION, ImmutableMap.of("location", args[0]));
        }
        return null;
      }
View Full Code Here

TOP

Related Classes of javax.tools.JavaFileManager$Location

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.