langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java
changeset 42840 dfe1a03d4db4
parent 42827 36468b5fa7f4
child 43026 8e8b50c7491d
equal deleted inserted replaced
42839:33f705c03879 42840:dfe1a03d4db4
    68 
    68 
    69 public class JdepsConfiguration implements AutoCloseable {
    69 public class JdepsConfiguration implements AutoCloseable {
    70     // the token for "all modules on the module path"
    70     // the token for "all modules on the module path"
    71     public static final String ALL_MODULE_PATH = "ALL-MODULE-PATH";
    71     public static final String ALL_MODULE_PATH = "ALL-MODULE-PATH";
    72     public static final String ALL_DEFAULT = "ALL-DEFAULT";
    72     public static final String ALL_DEFAULT = "ALL-DEFAULT";
       
    73     public static final String ALL_SYSTEM = "ALL-SYSTEM";
    73     public static final String MODULE_INFO = "module-info.class";
    74     public static final String MODULE_INFO = "module-info.class";
    74 
    75 
    75     private final SystemModuleFinder system;
    76     private final SystemModuleFinder system;
    76     private final ModuleFinder finder;
    77     private final ModuleFinder finder;
    77 
    78 
   197         Objects.requireNonNull(name);
   198         Objects.requireNonNull(name);
   198         Module m = nameToModule.get(name);
   199         Module m = nameToModule.get(name);
   199         return m!= null ? Optional.of(m.descriptor()) : Optional.empty();
   200         return m!= null ? Optional.of(m.descriptor()) : Optional.empty();
   200     }
   201     }
   201 
   202 
   202     boolean isSystem(Module m) {
       
   203         return system.find(m.name()).isPresent();
       
   204     }
       
   205 
       
   206     boolean isValidToken(String name) {
   203     boolean isValidToken(String name) {
   207         return ALL_MODULE_PATH.equals(name) || ALL_DEFAULT.equals(name);
   204         return ALL_MODULE_PATH.equals(name) ||
       
   205                 ALL_DEFAULT.equals(name) ||
       
   206                 ALL_SYSTEM.equals(name);
   208     }
   207     }
   209 
   208 
   210     /**
   209     /**
   211      * Returns the modules that the given module can read
   210      * Returns the modules that the given module can read
   212      */
   211      */
   531                     case ALL_MODULE_PATH:
   530                     case ALL_MODULE_PATH:
   532                         this.addAllApplicationModules = true;
   531                         this.addAllApplicationModules = true;
   533                         break;
   532                         break;
   534                     case ALL_DEFAULT:
   533                     case ALL_DEFAULT:
   535                         this.addAllDefaultModules = true;
   534                         this.addAllDefaultModules = true;
       
   535                         break;
       
   536                     case ALL_SYSTEM:
       
   537                         this.addAllSystemModules = true;
   536                         break;
   538                         break;
   537                     default:
   539                     default:
   538                         this.rootModules.add(mn);
   540                         this.rootModules.add(mn);
   539                 }
   541                 }
   540             }
   542             }