Package com.sun.tools.javac.util

Examples of com.sun.tools.javac.util.Paths$Path


            origOptions = Collections.unmodifiableMap(origOptions);

            {
                // Note: it might be necessary to check for an empty
                // component ("") of the source path or class path
                Paths paths = Paths.instance(context);

                String sourceDest = options.get("-s");
                if (paths.sourcePath() != null) {
                    for(File f: paths.sourcePath())
                        augmentedSourcePath += (f + File.pathSeparator);
                    augmentedSourcePath += (sourceDest == null)?".":sourceDest;
                } else {
                    augmentedSourcePath = ".";

                    if (sourceDest != null)
                        augmentedSourcePath += (File.pathSeparator + sourceDest);
                }

                String classDest = options.get("-d");
                if (paths.userClassPath() != null) {
                    for(File f: paths.userClassPath())
                        baseClassPath += (f + File.pathSeparator);
                    // put baseClassPath into map to handle any
                    // value needed for the classloader
                    options.put("-classpath", baseClassPath);

                    augmentedClassPath = baseClassPath + ((classDest == null)?".":classDest);
                } else {
                    baseClassPath = ".";
                    if (classDest != null)
                        augmentedClassPath = baseClassPath + (File.pathSeparator + classDest);
                }
                assert options.get("-classpath") != null;
            }

            /*
             * Create base and augmented class loaders
             */
            ClassLoader augmentedAptCL = null;
            {
            /*
             * Use a url class loader to look for classes on the
             * user-specified class path. Prepend computed bootclass
             * path, which includes extdirs, to the URLClassLoader apt
             * uses.
             */
                String aptclasspath = "";
                Paths paths = Paths.instance(context);
                String bcp = "";
                Collection<File> bootclasspath = paths.bootClassPath();

                if (bootclasspath != null) {
                    for(File f: bootclasspath)
                        bcp += (f + File.pathSeparator);
                }
View Full Code Here


      throw new RuntimeException("Failed to add routes for " + routeControllerClass + ".", t);
    }

    for (Method routeMethod : routeControllerClass.getDeclaredMethods()) {
      String routeMethodName = routeMethod.getName();
      Path pathAnnotation = routeMethod.getAnnotation(Path.class);
      Paths pathsAnnotation = routeMethod.getAnnotation(Paths.class);
      if (pathAnnotation != null || pathsAnnotation != null) {
        String actionName;
        if (routeMethodName.endsWith("Action")) {
          actionName = routeMethodName.substring(0, routeMethodName.length() - "Action".length());
        }
        else {
          actionName = routeMethodName;
        }

        ERXRoute.Method method = null;
        // Search annotations for @PUT, @GET, etc.
        for (Annotation annotation : routeMethod.getAnnotations()) {
          HttpMethod httpMethod = annotation.annotationType().getAnnotation(HttpMethod.class);
          if (httpMethod != null) {
            if (method == null) {
              method = httpMethod.value();
            }
            else {
              throw new IllegalArgumentException(routeControllerClass.getSimpleName() + "." + routeMethod.getName() + " is annotated as more than one http method.");
            }
          }
        }

        // Finally default declared REST actions to @GET
        if (method == null) {
          method = ERXRoute.Method.Get;
        }

        if (pathAnnotation != null) {
          addRoute(new ERXRoute(entityName, pathAnnotation.value(), method, routeControllerClass, actionName));
          declaredRoutesFound = true;
        }
        if (pathsAnnotation != null) {
          for (Path path : pathsAnnotation.value()) {
            addRoute(new ERXRoute(entityName, path.value(), method, routeControllerClass, actionName));
View Full Code Here

      throw new ParserException("Reached end of xml document unexpectedly");
   }

   private Icon parseIcon(XMLStreamReader reader) throws XMLStreamException, ParserException
   {
      Path largeIcon = null;
      Path smallIcon = null;

      //getting attributes
      String id = reader.getAttributeValue(null, Icon.Attribute.ID.getLocalName());
      String lang = reader.getAttributeValue(null, Icon.Attribute.ID.getLocalName());
View Full Code Here

TOP

Related Classes of com.sun.tools.javac.util.Paths$Path

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.